From ff0a564ac97b25e8a46c0f3f444adca75fc7f385 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 17 Dec 2025 12:40:45 +0000 Subject: [PATCH] Configurations: 'specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/tspconfig.yaml', API Version: 2025-12-01-preview, SDK Release Type: beta, and CommitSHA: '9564453c2af68fd5b29dd4bfc31d547f4e6e7cd1' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5679401 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../azure-mgmt-azurestackhci/CHANGELOG.md | 229 + .../azure-mgmt-azurestackhci/MANIFEST.in | 9 +- .../azure-mgmt-azurestackhci/README.md | 6 +- .../azure-mgmt-azurestackhci/_meta.json | 11 - .../azure-mgmt-azurestackhci/_metadata.json | 7 + .../apiview-properties.json | 468 + .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure/mgmt/azurestackhci/__init__.py | 14 +- ...{_azure_stack_hci_client.py => _client.py} | 127 +- .../mgmt/azurestackhci/_configuration.py | 33 +- .../azure/mgmt/azurestackhci/_patch.py | 39 +- .../mgmt/azurestackhci/_utils/__init__.py | 6 + .../mgmt/azurestackhci/_utils/model_base.py | 1271 ++ .../serialization.py} | 590 +- .../azure/mgmt/azurestackhci/_validation.py | 66 + .../azure/mgmt/azurestackhci/_version.py | 4 +- .../azure/mgmt/azurestackhci/aio/__init__.py | 14 +- ...{_azure_stack_hci_client.py => _client.py} | 131 +- .../mgmt/azurestackhci/aio/_configuration.py | 33 +- .../azure/mgmt/azurestackhci/aio/_patch.py | 39 +- .../azurestackhci/aio/operations/__init__.py | 62 +- .../operations/_arc_settings_operations.py | 980 - .../aio/operations/_clusters_operations.py | 1546 -- .../_deployment_settings_operations.py | 542 - .../operations/_edge_devices_operations.py | 711 - .../aio/operations/_extensions_operations.py | 1005 -- .../aio/operations/_offers_operations.py | 319 - .../aio/operations/_operations.py | 12359 ++++++++++++- .../azurestackhci/aio/operations/_patch.py | 13 +- .../aio/operations/_publishers_operations.py | 202 - .../_security_settings_operations.py | 542 - .../aio/operations/_skus_operations.py | 235 - .../aio/operations/_update_runs_operations.py | 492 - .../_update_summaries_operations.py | 450 - .../aio/operations/_updates_operations.py | 588 - .../mgmt/azurestackhci/models/__init__.py | 621 +- .../models/_azure_stack_hci_client_enums.py | 481 - .../azure/mgmt/azurestackhci/models/_enums.py | 1029 ++ .../mgmt/azurestackhci/models/_models.py | 10444 +++++++++++ .../mgmt/azurestackhci/models/_models_py3.py | 6472 ------- .../azure/mgmt/azurestackhci/models/_patch.py | 13 +- .../mgmt/azurestackhci/operations/__init__.py | 62 +- .../operations/_arc_settings_operations.py | 1279 -- .../operations/_clusters_operations.py | 1889 -- .../_deployment_settings_operations.py | 693 - .../operations/_edge_devices_operations.py | 831 - .../operations/_extensions_operations.py | 1233 -- .../operations/_offers_operations.py | 438 - .../azurestackhci/operations/_operations.py | 14755 +++++++++++++++- .../mgmt/azurestackhci/operations/_patch.py | 13 +- .../operations/_publishers_operations.py | 269 - .../_security_settings_operations.py | 693 - .../operations/_skus_operations.py | 327 - .../operations/_update_runs_operations.py | 645 - .../_update_summaries_operations.py | 572 - .../operations/_updates_operations.py | 752 - .../generated_samples/change_cluster_ring.py | 43 + .../clusters_update_secrets_locations.py | 43 + .../configure_remote_support.py | 6 +- .../consent_and_install_default_extensions.py | 6 +- .../generated_samples/create_arc_identity.py | 6 +- .../generated_samples/create_cluster.py | 6 +- .../create_cluster_identity.py | 6 +- .../create_hci_edge_device.py | 6 +- .../generated_samples/delete_arc_setting.py | 6 +- .../generated_samples/delete_cluster.py | 6 +- .../delete_deployment_settings.py | 7 +- .../generated_samples/delete_edge_devices.py | 6 +- .../generated_samples/delete_extension.py | 6 +- .../delete_security_settings.py | 7 +- .../generated_samples/delete_update_runs.py | 6 +- .../delete_update_summaries.py | 6 +- .../generated_samples/delete_updates.py | 6 +- ...evice_jobs_create_or_update_collect_log.py | 52 + ...ce_jobs_create_or_update_remote_support.py | 53 + .../edge_device_jobs_delete.py | 43 + .../edge_device_jobs_get_remote_support.py | 44 + .../edge_device_jobs_list_by_edge_device.py | 44 + ...chine_jobs_create_or_update_collect_log.py | 44 + ...chine_jobs_create_or_update_download_os.py | 62 + ...hine_jobs_create_or_update_provision_os.py | 98 + ...ne_jobs_create_or_update_remote_support.py | 51 + ...machine_jobs_create_or_update_update_os.py | 97 + ...dge_machine_jobs_delete_maximum_set_gen.py | 42 + .../edge_machine_jobs_get_collect_log.py | 43 + .../edge_machine_jobs_get_provision_os.py | 43 + .../edge_machine_jobs_get_remote_support.py | 43 + .../edge_machine_jobs_list_maximum_set_gen.py | 43 + .../edge_machines_create_or_update.py | 50 + .../generated_samples/edge_machines_delete.py | 41 + .../generated_samples/edge_machines_get.py | 42 + .../edge_machines_list_by_resource_group.py | 42 + .../edge_machines_list_by_subscription.py | 40 + .../generated_samples/edge_machines_update.py | 43 + .../extend_software_assurance_benefit.py | 6 +- .../generated_samples/extensions_upgrade.py | 6 +- .../generated_samples/generate_password.py | 6 +- .../generated_samples/get_arc_setting.py | 6 +- .../generated_samples/get_cluster.py | 6 +- .../get_deployment_settings.py | 7 +- .../generated_samples/get_edge_devices.py | 6 +- .../generated_samples/get_extension.py | 6 +- .../generated_samples/get_offer.py | 6 +- .../generated_samples/get_publisher.py | 6 +- .../get_security_settings.py | 7 +- .../generated_samples/get_sku.py | 6 +- .../generated_samples/get_update_runs.py | 6 +- .../generated_samples/get_update_summaries.py | 6 +- .../generated_samples/get_updates.py | 6 +- .../initialize_disable_process.py | 6 +- ...ption_location_resource_maximum_set_gen.py | 42 + .../list_arc_settings_by_cluster.py | 6 +- .../list_clusters_by_resource_group.py | 6 +- .../list_clusters_by_subscription.py | 6 +- .../list_deployment_settings_by_cluster.py | 6 +- .../generated_samples/list_edge_devices.py | 5 +- .../list_extensions_by_arc_setting.py | 6 +- .../list_offers_by_cluster.py | 6 +- .../list_offers_by_publisher.py | 6 +- .../list_publishers_by_cluster.py | 6 +- .../list_security_settings_by_cluster.py | 6 +- .../generated_samples/list_skus_by_offer.py | 6 +- .../generated_samples/list_update_runs.py | 6 +- .../list_update_summaries.py | 6 +- .../generated_samples/list_updates.py | 6 +- ...{list_operations.py => operations_list.py} | 9 +- .../os_images_get_maximum_set_gen.py | 42 + ...ption_location_resource_maximum_set_gen.py | 42 + .../generated_samples/patch_arc_setting.py | 6 +- .../generated_samples/patch_extension.py | 6 +- .../platform_updates_get_maximum_set_gen.py | 42 + ...pdates_list_by_location_maximum_set_gen.py | 42 + .../generated_samples/post_updates.py | 6 +- .../put_deployment_settings.py | 10 +- .../put_deployment_settings_with_ad_less.py | 188 + .../generated_samples/put_extension.py | 6 +- .../put_security_settings.py | 7 +- .../generated_samples/put_update_runs.py | 6 +- .../generated_samples/put_update_summaries.py | 6 +- .../generated_samples/put_updates.py | 6 +- .../reconcile_arc_settings.py | 51 + .../trigger_log_collection.py | 6 +- .../generated_samples/update_cluster.py | 6 +- .../update_contents_get_maximum_set_gen.py | 42 + ...ntents_list_by_location_maximum_set_gen.py | 42 + .../generated_samples/upload_certificate.py | 6 +- .../validate_edge_devices.py | 50 + ...te_ownership_vouchers_by_resource_group.py | 47 + .../validated_solution_recipes_get.py | 42 + ..._list_by_subscription_location_resource.py | 42 + .../generated_tests/conftest.py | 4 +- ...azure_stack_hci_arc_settings_operations.py | 101 +- ...stack_hci_arc_settings_operations_async.py | 103 +- ...est_azure_stack_hci_clusters_operations.py | 342 +- ...ure_stack_hci_clusters_operations_async.py | 346 +- ...tack_hci_deployment_settings_operations.py | 325 +- ...ci_deployment_settings_operations_async.py | 331 +- ...e_stack_hci_edge_device_jobs_operations.py | 81 + ...k_hci_edge_device_jobs_operations_async.py | 86 + ...azure_stack_hci_edge_devices_operations.py | 52 +- ...stack_hci_edge_devices_operations_async.py | 52 +- ..._stack_hci_edge_machine_jobs_operations.py | 80 + ..._hci_edge_machine_jobs_operations_async.py | 85 + ...zure_stack_hci_edge_machines_operations.py | 243 + ...tack_hci_edge_machines_operations_async.py | 250 + ...t_azure_stack_hci_extensions_operations.py | 115 +- ...e_stack_hci_extensions_operations_async.py | 115 +- ...tack_hci_kubernetes_versions_operations.py | 29 + ...ci_kubernetes_versions_operations_async.py | 30 + .../test_azure_stack_hci_offers_operations.py | 25 +- ...azure_stack_hci_offers_operations_async.py | 25 +- .../test_azure_stack_hci_operations.py | 10 +- .../test_azure_stack_hci_operations_async.py | 10 +- ...st_azure_stack_hci_os_images_operations.py | 40 + ...re_stack_hci_os_images_operations_async.py | 41 + ...stack_hci_ownership_vouchers_operations.py | 31 + ...hci_ownership_vouchers_operations_async.py | 32 + ...e_stack_hci_platform_updates_operations.py | 40 + ...k_hci_platform_updates_operations_async.py | 41 + ...t_azure_stack_hci_publishers_operations.py | 18 +- ...e_stack_hci_publishers_operations_async.py | 18 +- ..._stack_hci_security_settings_operations.py | 62 +- ..._hci_security_settings_operations_async.py | 62 +- .../test_azure_stack_hci_skus_operations.py | 18 +- ...t_azure_stack_hci_skus_operations_async.py | 18 +- ...re_stack_hci_update_contents_operations.py | 40 + ...ck_hci_update_contents_operations_async.py | 41 + ..._azure_stack_hci_update_runs_operations.py | 69 +- ..._stack_hci_update_runs_operations_async.py | 75 +- ...e_stack_hci_update_summaries_operations.py | 104 +- ...k_hci_update_summaries_operations_async.py | 108 +- ...test_azure_stack_hci_updates_operations.py | 144 +- ...zure_stack_hci_updates_operations_async.py | 156 +- ...i_validated_solution_recipes_operations.py | 40 + ...dated_solution_recipes_operations_async.py | 41 + .../azure-mgmt-azurestackhci/pyproject.toml | 82 + .../sdk_packaging.toml | 8 - .../azure-mgmt-azurestackhci/setup.py | 83 - ...tack_hci_clusters_operations_async_test.py | 1 - ...t_azure_stack_hci_operations_async_test.py | 1 - .../tsp-location.yaml | 4 + 202 files changed, 46591 insertions(+), 26544 deletions(-) delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/_metadata.json create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/apiview-properties.json rename sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/{_azure_stack_hci_client.py => _client.py} (59%) create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/__init__.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/model_base.py rename sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/{_serialization.py => _utils/serialization.py} (82%) create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_validation.py rename sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/{_azure_stack_hci_client.py => _client.py} (60%) delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_arc_settings_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_clusters_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_deployment_settings_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_edge_devices_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_extensions_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_offers_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_publishers_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_security_settings_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_skus_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_runs_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_summaries_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_updates_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_enums.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models_py3.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_arc_settings_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_clusters_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_deployment_settings_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_edge_devices_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_extensions_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_offers_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_publishers_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_security_settings_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_skus_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_runs_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_summaries_operations.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_updates_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/change_cluster_ring.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/clusters_update_secrets_locations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_collect_log.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_remote_support.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_delete.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_get_remote_support.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_list_by_edge_device.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_collect_log.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_download_os.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_provision_os.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_remote_support.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_update_os.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_delete_maximum_set_gen.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_collect_log.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_provision_os.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_remote_support.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_list_maximum_set_gen.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_create_or_update.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_delete.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_get.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_resource_group.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_subscription.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_update.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/kubernetes_versions_list_by_subscription_location_resource_maximum_set_gen.py rename sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/{list_operations.py => operations_list.py} (82%) create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_get_maximum_set_gen.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_list_by_subscription_location_resource_maximum_set_gen.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_get_maximum_set_gen.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_list_by_location_maximum_set_gen.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_with_ad_less.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/reconcile_arc_settings.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_get_maximum_set_gen.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_list_by_location_maximum_set_gen.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_edge_devices.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_ownership_vouchers_by_resource_group.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_get.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_list_by_subscription_location_resource.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_device_jobs_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_device_jobs_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_validated_solution_recipes_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_validated_solution_recipes_operations_async.py delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/sdk_packaging.toml delete mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/setup.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/tsp-location.yaml diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/CHANGELOG.md b/sdk/azurestackhci/azure-mgmt-azurestackhci/CHANGELOG.md index ea4081977196..94c325d72a69 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/CHANGELOG.md +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/CHANGELOG.md @@ -1,5 +1,234 @@ # Release History +## 8.0.0b5 (2025-12-17) + +### Features Added + + - Model `AzureStackHCIClient` added parameter `cloud_setting` in method `__init__` + - Client `AzureStackHCIClient` added method `send_request` + - Client `AzureStackHCIClient` added operation group `kubernetes_versions` + - Client `AzureStackHCIClient` added operation group `platform_updates` + - Client `AzureStackHCIClient` added operation group `os_images` + - Client `AzureStackHCIClient` added operation group `update_contents` + - Client `AzureStackHCIClient` added operation group `edge_device_jobs` + - Client `AzureStackHCIClient` added operation group `validated_solution_recipes` + - Client `AzureStackHCIClient` added operation group `edge_machines` + - Client `AzureStackHCIClient` added operation group `edge_machine_jobs` + - Client `AzureStackHCIClient` added operation group `ownership_vouchers` + - Model `Cluster` added property `identity` + - Model `Cluster` added property `kind` + - Model `ClusterPatch` added property `identity` + - Model `ClusterReportedProperties` added property `msi_expiration_time_stamp` + - Model `ClusterReportedProperties` added property `hardware_class` + - Model `DeploymentCluster` added property `hardware_class` + - Model `DeploymentCluster` added property `cluster_pattern` + - Model `DeploymentData` added property `identity_provider` + - Model `DeploymentData` added property `is_management_cluster` + - Model `DeploymentData` added property `local_availability_zones` + - Model `DeploymentData` added property `assembly_info` + - Model `DeploymentSetting` added property `properties` + - Model `HciNetworkProfile` added property `sdn_properties` + - Model `HciNicDetail` added property `rdma_capability` + - Model `HciReportedProperties` added property `storage_profile` + - Model `HciReportedProperties` added property `hardware_profile` + - Model `HciReportedProperties` added property `last_sync_timestamp` + - Model `HciReportedProperties` added property `confidential_vm_profile` + - Model `InfrastructureNetwork` added property `dns_server_config` + - Model `InfrastructureNetwork` added property `dns_zones` + - Model `ReportedProperties` added property `last_sync_timestamp` + - Model `ReportedProperties` added property `confidential_vm_profile` + - Model `SecuritySetting` added property `properties` + - Added model `ArcIdentityResponseProperties` + - Added model `AssemblyInfo` + - Added model `AssemblyInfoPayload` + - Added model `ChangeRingRequest` + - Added model `ChangeRingRequestProperties` + - Added model `ClusterIdentityResponseProperties` + - Added enum `ClusterPattern` + - Added model `ClusterSdnProperties` + - Added enum `ConfidentialVmIntent` + - Added model `ConfidentialVmProfile` + - Added model `ConfidentialVmProperties` + - Added enum `ConfidentialVmStatus` + - Added model `ContentPayload` + - Added model `DeploymentSettingsProperties` + - Added enum `DeviceLogCollectionStatus` + - Added enum `DnsServerConfig` + - Added model `DnsZones` + - Added model `DownloadOsJobProperties` + - Added model `DownloadOsProfile` + - Added model `DownloadRequest` + - Added model `EdgeDeviceJob` + - Added enum `EdgeDeviceKind` + - Added model `EdgeMachine` + - Added model `EdgeMachineCollectLogJobProperties` + - Added model `EdgeMachineCollectLogJobReportedProperties` + - Added enum `EdgeMachineConnectivityStatus` + - Added model `EdgeMachineJob` + - Added model `EdgeMachineJobProperties` + - Added enum `EdgeMachineJobType` + - Added enum `EdgeMachineKind` + - Added model `EdgeMachineNetworkProfile` + - Added model `EdgeMachineNicDetail` + - Added model `EdgeMachinePatch` + - Added model `EdgeMachineProperties` + - Added model `EdgeMachineRemoteSupportJobProperties` + - Added model `EdgeMachineRemoteSupportJobReportedProperties` + - Added model `EdgeMachineRemoteSupportNodeSettings` + - Added model `EdgeMachineReportedProperties` + - Added enum `EdgeMachineState` + - Added model `ExtensionParameters` + - Added model `ExtensionPatchProperties` + - Added model `ExtensionResource` + - Added enum `HardwareClass` + - Added model `HardwareProfile` + - Added model `HciCollectLogJobProperties` + - Added model `HciEdgeDeviceJob` + - Added model `HciEdgeDeviceJobProperties` + - Added enum `HciEdgeDeviceJobType` + - Added model `HciHardwareProfile` + - Added model `HciRemoteSupportJobProperties` + - Added model `HciStorageProfile` + - Added enum `IdentityProvider` + - Added enum `IgvmStatus` + - Added model `IgvmStatusDetail` + - Added model `IpAddressRange` + - Added enum `IpAssignmentType` + - Added enum `JobStatus` + - Added model `KubernetesVersion` + - Added model `KubernetesVersionProperties` + - Added model `LocalAvailabilityZones` + - Added model `LogCollectionJobSession` + - Added model `LogCollectionReportedProperties` + - Added model `ManagedServiceIdentity` + - Added model `NetworkAdapter` + - Added model `NetworkConfiguration` + - Added enum `OSOperationType` + - Added model `OnboardingConfiguration` + - Added enum `OnboardingResourceType` + - Added model `OperationDetail` + - Added model `OsImage` + - Added model `OsImageProperties` + - Added model `OsProfile` + - Added model `OsProvisionProfile` + - Added enum `OwnerKeyType` + - Added model `OwnershipVoucherDetails` + - Added model `OwnershipVoucherValidationDetails` + - Added enum `OwnershipVoucherValidationStatus` + - Added model `PlatformPayload` + - Added model `PlatformUpdate` + - Added model `PlatformUpdateDetails` + - Added model `PlatformUpdateProperties` + - Added model `ProvisionOsJobProperties` + - Added model `ProvisionOsReportedProperties` + - Added model `ProvisioningDetails` + - Added enum `ProvisioningOsType` + - Added model `ProvisioningRequest` + - Added enum `RdmaCapability` + - Added model `ReconcileArcSettingsRequest` + - Added model `ReconcileArcSettingsRequestProperties` + - Added enum `RemoteSupportAccessLevel` + - Added model `RemoteSupportJobNodeSettings` + - Added model `RemoteSupportJobReportedProperties` + - Added model `RemoteSupportSession` + - Added enum `SdnIntegrationIntent` + - Added model `SdnProperties` + - Added enum `SdnStatus` + - Added enum `SecretType` + - Added model `SecretsLocationDetails` + - Added model `SecretsLocationsChangeRequest` + - Added enum `SecretsType` + - Added model `SecurityProperties` + - Added model `SiteDetails` + - Added model `StorageConfiguration` + - Added model `StorageProfile` + - Added enum `SupportStatus` + - Added model `TargetDeviceConfiguration` + - Added model `TimeConfiguration` + - Added model `UpdateContent` + - Added model `UpdateContentProperties` + - Added model `UpdateStateProperties` + - Added model `UserDetails` + - Added model `ValidateOwnershipVouchersRequest` + - Added model `ValidateOwnershipVouchersResponse` + - Added model `ValidatedSolutionRecipe` + - Added model `ValidatedSolutionRecipeCapabilities` + - Added model `ValidatedSolutionRecipeCapability` + - Added model `ValidatedSolutionRecipeComponent` + - Added model `ValidatedSolutionRecipeComponentMetadata` + - Added model `ValidatedSolutionRecipeComponentPayload` + - Added model `ValidatedSolutionRecipeContent` + - Added model `ValidatedSolutionRecipeInfo` + - Added model `ValidatedSolutionRecipeProperties` + - Added model `WebProxyConfiguration` + - Model `ArcSettingsOperations` added method `begin_reconcile` + - Model `ClustersOperations` added method `begin_change_ring` + - Model `ClustersOperations` added method `begin_update_secrets_locations` + - Added model `EdgeDeviceJobsOperations` + - Added model `EdgeMachineJobsOperations` + - Added model `EdgeMachinesOperations` + - Added model `KubernetesVersionsOperations` + - Added model `OsImagesOperations` + - Added model `OwnershipVouchersOperations` + - Added model `PlatformUpdatesOperations` + - Added model `UpdateContentsOperations` + - Added model `ValidatedSolutionRecipesOperations` + +### Breaking Changes + + - Method `Operations.list` changed from `asynchronous` to `synchronous` + - Model `ArcIdentityResponse` deleted or renamed its instance variable `arc_application_client_id` + - Model `ArcIdentityResponse` deleted or renamed its instance variable `arc_application_tenant_id` + - Model `ArcIdentityResponse` deleted or renamed its instance variable `arc_service_principal_object_id` + - Model `ArcIdentityResponse` deleted or renamed its instance variable `arc_application_object_id` + - Model `ClusterIdentityResponse` deleted or renamed its instance variable `aad_client_id` + - Model `ClusterIdentityResponse` deleted or renamed its instance variable `aad_tenant_id` + - Model `ClusterIdentityResponse` deleted or renamed its instance variable `aad_service_principal_object_id` + - Model `ClusterIdentityResponse` deleted or renamed its instance variable `aad_application_object_id` + - Model `DeploymentSetting` deleted or renamed its instance variable `provisioning_state` + - Model `DeploymentSetting` deleted or renamed its instance variable `arc_node_resource_ids` + - Model `DeploymentSetting` deleted or renamed its instance variable `deployment_mode` + - Model `DeploymentSetting` deleted or renamed its instance variable `operation_type` + - Model `DeploymentSetting` deleted or renamed its instance variable `deployment_configuration` + - Model `DeploymentSetting` deleted or renamed its instance variable `reported_properties` + - Model `ExtensionPatch` deleted or renamed its instance variable `extension_parameters` + - Model `SecuritySetting` deleted or renamed its instance variable `secured_core_compliance_assignment` + - Model `SecuritySetting` deleted or renamed its instance variable `wdac_compliance_assignment` + - Model `SecuritySetting` deleted or renamed its instance variable `smb_encryption_for_intra_cluster_traffic_compliance_assignment` + - Model `SecuritySetting` deleted or renamed its instance variable `security_compliance_status` + - Model `SecuritySetting` deleted or renamed its instance variable `provisioning_state` + - Deleted or renamed enum value `Status.FAILED` + - Deleted or renamed enum value `Status.IN_PROGRESS` + - Deleted or renamed enum value `Status.SUCCEEDED` + - Deleted or renamed model `ArcSettingList` + - Deleted or renamed model `ClusterList` + - Deleted or renamed model `ExtensionList` + - Deleted or renamed model `OfferList` + - Deleted or renamed model `PublisherList` + - Deleted or renamed model `SkuList` + - Deleted or renamed model `UpdateList` + - Deleted or renamed model `UpdateRunList` + - Deleted or renamed model `UpdateSummariesList` + - Method `DeploymentSettingsOperations.begin_create_or_update` removed default value `None` from its parameter `deployment_settings_name` + - Method `DeploymentSettingsOperations.begin_delete` removed default value `None` from its parameter `deployment_settings_name` + - Method `DeploymentSettingsOperations.get` removed default value `None` from its parameter `deployment_settings_name` + - Method `EdgeDevicesOperations.begin_create_or_update` removed default value `None` from its parameter `edge_device_name` + - Method `EdgeDevicesOperations.begin_delete` removed default value `None` from its parameter `edge_device_name` + - Method `EdgeDevicesOperations.begin_validate` removed default value `None` from its parameter `edge_device_name` + - Method `EdgeDevicesOperations.get` removed default value `None` from its parameter `edge_device_name` + - Method `OffersOperations.get` changed its parameter `expand` from `positional_or_keyword` to `keyword_only` + - Method `OffersOperations.list_by_cluster` changed its parameter `expand` from `positional_or_keyword` to `keyword_only` + - Method `OffersOperations.list_by_publisher` changed its parameter `expand` from `positional_or_keyword` to `keyword_only` + - Method `SecuritySettingsOperations.begin_create_or_update` removed default value `None` from its parameter `security_settings_name` + - Method `SecuritySettingsOperations.begin_delete` removed default value `None` from its parameter `security_settings_name` + - Method `SecuritySettingsOperations.get` removed default value `None` from its parameter `security_settings_name` + - Method `SkusOperations.get` changed its parameter `expand` from `positional_or_keyword` to `keyword_only` + - Method `SkusOperations.list_by_offer` changed its parameter `expand` from `positional_or_keyword` to `keyword_only` + - Method `EdgeDevicesOperations.begin_create_or_update` re-ordered its parameters from `['self', 'resource_uri', 'resource', 'edge_device_name', 'kwargs']` to `['self', 'resource_uri', 'edge_device_name', 'resource', 'kwargs']` + - Method `EdgeDevicesOperations.begin_validate` re-ordered its parameters from `['self', 'resource_uri', 'validate_request', 'edge_device_name', 'kwargs']` to `['self', 'resource_uri', 'edge_device_name', 'validate_request', 'kwargs']` + - Method `DeploymentSettingsOperations.begin_create_or_update` re-ordered its parameters from `['self', 'resource_group_name', 'cluster_name', 'resource', 'deployment_settings_name', 'kwargs']` to `['self', 'resource_group_name', 'cluster_name', 'deployment_settings_name', 'resource', 'kwargs']` + - Method `SecuritySettingsOperations.begin_create_or_update` re-ordered its parameters from `['self', 'resource_group_name', 'cluster_name', 'resource', 'security_settings_name', 'kwargs']` to `['self', 'resource_group_name', 'cluster_name', 'security_settings_name', 'resource', 'kwargs']` + ## 8.0.0b4 (2024-08-26) ### Features Added diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/MANIFEST.in b/sdk/azurestackhci/azure-mgmt-azurestackhci/MANIFEST.in index a56cf9842636..00325987e1c4 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/MANIFEST.in +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/MANIFEST.in @@ -1,8 +1,7 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/azurestackhci/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/README.md b/sdk/azurestackhci/azure-mgmt-azurestackhci/README.md index b789bc3caed3..608a7ffd35c8 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/README.md +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Azure Stack HCI Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.9+. 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.8+ is required to use this package. +- Python 3.9+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables. +By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json deleted file mode 100644 index 5bb25bc73234..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "30d040e41a4cea0d31a6c7e56726ea2df17fdcc5", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.19.0", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/readme.md" -} \ No newline at end of file diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/_metadata.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/_metadata.json new file mode 100644 index 000000000000..376c335c0e4b --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/_metadata.json @@ -0,0 +1,7 @@ +{ + "apiVersion": "2025-12-01-preview", + "commit": "9564453c2af68fd5b29dd4bfc31d547f4e6e7cd1", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI", + "emitterVersion": "0.56.0" +} \ No newline at end of file diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/apiview-properties.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/apiview-properties.json new file mode 100644 index 000000000000..ed2a0959d828 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/apiview-properties.json @@ -0,0 +1,468 @@ +{ + "CrossLanguagePackageId": "Microsoft.AzureStackHCI", + "CrossLanguageDefinitionId": { + "azure.mgmt.azurestackhci.models.ArcConnectivityProperties": "Microsoft.AzureStackHCI.ArcConnectivityProperties", + "azure.mgmt.azurestackhci.models.ArcIdentityResponse": "Microsoft.AzureStackHCI.ArcIdentityResponse", + "azure.mgmt.azurestackhci.models.ArcIdentityResponseProperties": "Microsoft.AzureStackHCI.ArcIdentityResponseProperties", + "azure.mgmt.azurestackhci.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.azurestackhci.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.azurestackhci.models.ArcSetting": "Microsoft.AzureStackHCI.ArcSetting", + "azure.mgmt.azurestackhci.models.ArcSettingProperties": "Microsoft.AzureStackHCI.ArcSettingProperties", + "azure.mgmt.azurestackhci.models.ArcSettingsPatch": "Microsoft.AzureStackHCI.ArcSettingsPatch", + "azure.mgmt.azurestackhci.models.ArcSettingsPatchProperties": "Microsoft.AzureStackHCI.ArcSettingsPatchProperties", + "azure.mgmt.azurestackhci.models.AssemblyInfo": "Microsoft.AzureStackHCI.AssemblyInfo", + "azure.mgmt.azurestackhci.models.AssemblyInfoPayload": "Microsoft.AzureStackHCI.AssemblyInfoPayload", + "azure.mgmt.azurestackhci.models.ChangeRingRequest": "Microsoft.AzureStackHCI.ChangeRingRequest", + "azure.mgmt.azurestackhci.models.ChangeRingRequestProperties": "Microsoft.AzureStackHCI.ChangeRingRequestProperties", + "azure.mgmt.azurestackhci.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.azurestackhci.models.Cluster": "Microsoft.AzureStackHCI.Cluster", + "azure.mgmt.azurestackhci.models.ClusterDesiredProperties": "Microsoft.AzureStackHCI.ClusterDesiredProperties", + "azure.mgmt.azurestackhci.models.ClusterIdentityResponse": "Microsoft.AzureStackHCI.ClusterIdentityResponse", + "azure.mgmt.azurestackhci.models.ClusterIdentityResponseProperties": "Microsoft.AzureStackHCI.ClusterIdentityResponseProperties", + "azure.mgmt.azurestackhci.models.ClusterNode": "Microsoft.AzureStackHCI.ClusterNode", + "azure.mgmt.azurestackhci.models.ClusterPatch": "Microsoft.AzureStackHCI.ClusterPatch", + "azure.mgmt.azurestackhci.models.ClusterPatchProperties": "Microsoft.AzureStackHCI.ClusterPatchProperties", + "azure.mgmt.azurestackhci.models.ClusterProperties": "Microsoft.AzureStackHCI.ClusterProperties", + "azure.mgmt.azurestackhci.models.ClusterReportedProperties": "Microsoft.AzureStackHCI.ClusterReportedProperties", + "azure.mgmt.azurestackhci.models.SdnProperties": "Microsoft.AzureStackHCI.SdnProperties", + "azure.mgmt.azurestackhci.models.ClusterSdnProperties": "Microsoft.AzureStackHCI.ClusterSdnProperties", + "azure.mgmt.azurestackhci.models.ConfidentialVmProfile": "Microsoft.AzureStackHCI.ConfidentialVmProfile", + "azure.mgmt.azurestackhci.models.ConfidentialVmProperties": "Microsoft.AzureStackHCI.ConfidentialVmProperties", + "azure.mgmt.azurestackhci.models.ContentPayload": "Microsoft.AzureStackHCI.ContentPayload", + "azure.mgmt.azurestackhci.models.DefaultExtensionDetails": "Microsoft.AzureStackHCI.DefaultExtensionDetails", + "azure.mgmt.azurestackhci.models.DeploymentCluster": "Microsoft.AzureStackHCI.DeploymentCluster", + "azure.mgmt.azurestackhci.models.DeploymentConfiguration": "Microsoft.AzureStackHCI.DeploymentConfiguration", + "azure.mgmt.azurestackhci.models.DeploymentData": "Microsoft.AzureStackHCI.DeploymentData", + "azure.mgmt.azurestackhci.models.DeploymentSecuritySettings": "Microsoft.AzureStackHCI.DeploymentSecuritySettings", + "azure.mgmt.azurestackhci.models.DeploymentSetting": "Microsoft.AzureStackHCI.DeploymentSetting", + "azure.mgmt.azurestackhci.models.DeploymentSettingAdapterPropertyOverrides": "Microsoft.AzureStackHCI.DeploymentSettingAdapterPropertyOverrides", + "azure.mgmt.azurestackhci.models.DeploymentSettingHostNetwork": "Microsoft.AzureStackHCI.DeploymentSettingHostNetwork", + "azure.mgmt.azurestackhci.models.DeploymentSettingIntents": "Microsoft.AzureStackHCI.DeploymentSettingIntents", + "azure.mgmt.azurestackhci.models.DeploymentSettingsProperties": "Microsoft.AzureStackHCI.DeploymentSettingsProperties", + "azure.mgmt.azurestackhci.models.DeploymentSettingStorageAdapterIPInfo": "Microsoft.AzureStackHCI.DeploymentSettingStorageAdapterIPInfo", + "azure.mgmt.azurestackhci.models.DeploymentSettingStorageNetworks": "Microsoft.AzureStackHCI.DeploymentSettingStorageNetworks", + "azure.mgmt.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides": "Microsoft.AzureStackHCI.DeploymentSettingVirtualSwitchConfigurationOverrides", + "azure.mgmt.azurestackhci.models.DeploymentStep": "Microsoft.AzureStackHCI.DeploymentStep", + "azure.mgmt.azurestackhci.models.DeviceConfiguration": "Microsoft.AzureStackHCI.DeviceConfiguration", + "azure.mgmt.azurestackhci.models.DnsZones": "Microsoft.AzureStackHCI.DnsZones", + "azure.mgmt.azurestackhci.models.EdgeMachineJobProperties": "Microsoft.AzureStackHCI.EdgeMachineJobProperties", + "azure.mgmt.azurestackhci.models.DownloadOsJobProperties": "Microsoft.AzureStackHCI.DownloadOsJobProperties", + "azure.mgmt.azurestackhci.models.DownloadOsProfile": "Microsoft.AzureStackHCI.DownloadOsProfile", + "azure.mgmt.azurestackhci.models.DownloadRequest": "Microsoft.AzureStackHCI.DownloadRequest", + "azure.mgmt.azurestackhci.models.EceActionStatus": "Microsoft.AzureStackHCI.EceActionStatus", + "azure.mgmt.azurestackhci.models.EceDeploymentSecrets": "Microsoft.AzureStackHCI.EceDeploymentSecrets", + "azure.mgmt.azurestackhci.models.EceReportedProperties": "Microsoft.AzureStackHCI.EceReportedProperties", + "azure.mgmt.azurestackhci.models.ExtensionResource": "Azure.ResourceManager.CommonTypes.ExtensionResource", + "azure.mgmt.azurestackhci.models.EdgeDevice": "Microsoft.AzureStackHCI.EdgeDevice", + "azure.mgmt.azurestackhci.models.EdgeDeviceJob": "Microsoft.AzureStackHCI.EdgeDeviceJob", + "azure.mgmt.azurestackhci.models.EdgeDeviceProperties": "Microsoft.AzureStackHCI.EdgeDeviceProperties", + "azure.mgmt.azurestackhci.models.EdgeMachine": "Microsoft.AzureStackHCI.EdgeMachine", + "azure.mgmt.azurestackhci.models.EdgeMachineCollectLogJobProperties": "Microsoft.AzureStackHCI.EdgeMachineCollectLogJobProperties", + "azure.mgmt.azurestackhci.models.EdgeMachineCollectLogJobReportedProperties": "Microsoft.AzureStackHCI.EdgeMachineCollectLogJobReportedProperties", + "azure.mgmt.azurestackhci.models.EdgeMachineJob": "Microsoft.AzureStackHCI.EdgeMachineJob", + "azure.mgmt.azurestackhci.models.EdgeMachineNetworkProfile": "Microsoft.AzureStackHCI.EdgeMachineNetworkProfile", + "azure.mgmt.azurestackhci.models.EdgeMachineNicDetail": "Microsoft.AzureStackHCI.EdgeMachineNicDetail", + "azure.mgmt.azurestackhci.models.EdgeMachinePatch": "Microsoft.AzureStackHCI.EdgeMachinePatch", + "azure.mgmt.azurestackhci.models.EdgeMachineProperties": "Microsoft.AzureStackHCI.EdgeMachineProperties", + "azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportJobProperties": "Microsoft.AzureStackHCI.EdgeMachineRemoteSupportJobProperties", + "azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportJobReportedProperties": "Microsoft.AzureStackHCI.EdgeMachineRemoteSupportJobReportedProperties", + "azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportNodeSettings": "Microsoft.AzureStackHCI.EdgeMachineRemoteSupportNodeSettings", + "azure.mgmt.azurestackhci.models.EdgeMachineReportedProperties": "Microsoft.AzureStackHCI.EdgeMachineReportedProperties", + "azure.mgmt.azurestackhci.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.azurestackhci.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.azurestackhci.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.azurestackhci.models.Extension": "Microsoft.AzureStackHCI.Extension", + "azure.mgmt.azurestackhci.models.ExtensionInstanceView": "Microsoft.AzureStackHCI.ExtensionInstanceView", + "azure.mgmt.azurestackhci.models.ExtensionInstanceViewStatus": "Microsoft.AzureStackHCI.ExtensionInstanceViewStatus", + "azure.mgmt.azurestackhci.models.ExtensionParameters": "Microsoft.AzureStackHCI.ExtensionParameters", + "azure.mgmt.azurestackhci.models.ExtensionPatch": "Microsoft.AzureStackHCI.ExtensionPatch", + "azure.mgmt.azurestackhci.models.ExtensionPatchParameters": "Microsoft.AzureStackHCI.ExtensionPatchParameters", + "azure.mgmt.azurestackhci.models.ExtensionPatchProperties": "Microsoft.AzureStackHCI.ExtensionPatchProperties", + "azure.mgmt.azurestackhci.models.ExtensionProfile": "Microsoft.AzureStackHCI.ExtensionProfile", + "azure.mgmt.azurestackhci.models.ExtensionProperties": "Microsoft.AzureStackHCI.ExtensionProperties", + "azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters": "Microsoft.AzureStackHCI.ExtensionUpgradeParameters", + "azure.mgmt.azurestackhci.models.HardwareProfile": "Microsoft.AzureStackHCI.HardwareProfile", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceJobProperties": "Microsoft.AzureStackHCI.HciEdgeDeviceJobProperties", + "azure.mgmt.azurestackhci.models.HciCollectLogJobProperties": "Microsoft.AzureStackHCI.HciCollectLogJobProperties", + "azure.mgmt.azurestackhci.models.HciEdgeDevice": "Microsoft.AzureStackHCI.HciEdgeDevice", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceAdapterPropertyOverrides": "Microsoft.AzureStackHCI.HciEdgeDeviceAdapterPropertyOverrides", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceArcExtension": "Microsoft.AzureStackHCI.HciEdgeDeviceArcExtension", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceHostNetwork": "Microsoft.AzureStackHCI.HciEdgeDeviceHostNetwork", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceIntents": "Microsoft.AzureStackHCI.HciEdgeDeviceIntents", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceJob": "Microsoft.AzureStackHCI.HciEdgeDeviceJob", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceProperties": "Microsoft.AzureStackHCI.HciEdgeDeviceProperties", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceStorageAdapterIPInfo": "Microsoft.AzureStackHCI.HciEdgeDeviceStorageAdapterIPInfo", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceStorageNetworks": "Microsoft.AzureStackHCI.HciEdgeDeviceStorageNetworks", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceVirtualSwitchConfigurationOverrides": "Microsoft.AzureStackHCI.HciEdgeDeviceVirtualSwitchConfigurationOverrides", + "azure.mgmt.azurestackhci.models.HciHardwareProfile": "Microsoft.AzureStackHCI.HciHardwareProfile", + "azure.mgmt.azurestackhci.models.HciNetworkProfile": "Microsoft.AzureStackHCI.HciNetworkProfile", + "azure.mgmt.azurestackhci.models.HciNicDetail": "Microsoft.AzureStackHCI.HciNicDetail", + "azure.mgmt.azurestackhci.models.HciOsProfile": "Microsoft.AzureStackHCI.HciOsProfile", + "azure.mgmt.azurestackhci.models.HciRemoteSupportJobProperties": "Microsoft.AzureStackHCI.HciRemoteSupportJobProperties", + "azure.mgmt.azurestackhci.models.ReportedProperties": "Microsoft.AzureStackHCI.ReportedProperties", + "azure.mgmt.azurestackhci.models.HciReportedProperties": "Microsoft.AzureStackHCI.HciReportedProperties", + "azure.mgmt.azurestackhci.models.HciStorageProfile": "Microsoft.AzureStackHCI.HciStorageProfile", + "azure.mgmt.azurestackhci.models.HciValidationFailureDetail": "Microsoft.AzureStackHCI.HciValidationFailureDetail", + "azure.mgmt.azurestackhci.models.IgvmStatusDetail": "Microsoft.AzureStackHCI.IgvmStatusDetail", + "azure.mgmt.azurestackhci.models.InfrastructureNetwork": "Microsoft.AzureStackHCI.InfrastructureNetwork", + "azure.mgmt.azurestackhci.models.IpAddressRange": "Microsoft.AzureStackHCI.IpAddressRange", + "azure.mgmt.azurestackhci.models.IpPools": "Microsoft.AzureStackHCI.IpPools", + "azure.mgmt.azurestackhci.models.IsolatedVmAttestationConfiguration": "Microsoft.AzureStackHCI.IsolatedVmAttestationConfiguration", + "azure.mgmt.azurestackhci.models.KubernetesVersion": "Microsoft.AzureStackHCI.KubernetesVersion", + "azure.mgmt.azurestackhci.models.KubernetesVersionProperties": "Microsoft.AzureStackHCI.KubernetesVersionProperties", + "azure.mgmt.azurestackhci.models.LocalAvailabilityZones": "Microsoft.AzureStackHCI.LocalAvailabilityZones", + "azure.mgmt.azurestackhci.models.LogCollectionError": "Microsoft.AzureStackHCI.LogCollectionError", + "azure.mgmt.azurestackhci.models.LogCollectionJobSession": "Microsoft.AzureStackHCI.LogCollectionJobSession", + "azure.mgmt.azurestackhci.models.LogCollectionProperties": "Microsoft.AzureStackHCI.LogCollectionProperties", + "azure.mgmt.azurestackhci.models.LogCollectionReportedProperties": "Microsoft.AzureStackHCI.LogCollectionReportedProperties", + "azure.mgmt.azurestackhci.models.LogCollectionRequest": "Microsoft.AzureStackHCI.LogCollectionRequest", + "azure.mgmt.azurestackhci.models.LogCollectionRequestProperties": "Microsoft.AzureStackHCI.LogCollectionRequestProperties", + "azure.mgmt.azurestackhci.models.LogCollectionSession": "Microsoft.AzureStackHCI.LogCollectionSession", + "azure.mgmt.azurestackhci.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "azure.mgmt.azurestackhci.models.NetworkAdapter": "Microsoft.AzureStackHCI.NetworkAdapter", + "azure.mgmt.azurestackhci.models.NetworkConfiguration": "Microsoft.AzureStackHCI.NetworkConfiguration", + "azure.mgmt.azurestackhci.models.NetworkController": "Microsoft.AzureStackHCI.NetworkController", + "azure.mgmt.azurestackhci.models.NicDetail": "Microsoft.AzureStackHCI.NicDetail", + "azure.mgmt.azurestackhci.models.Observability": "Microsoft.AzureStackHCI.Observability", + "azure.mgmt.azurestackhci.models.Offer": "Microsoft.AzureStackHCI.Offer", + "azure.mgmt.azurestackhci.models.OfferProperties": "Microsoft.AzureStackHCI.OfferProperties", + "azure.mgmt.azurestackhci.models.OnboardingConfiguration": "Microsoft.AzureStackHCI.OnboardingConfiguration", + "azure.mgmt.azurestackhci.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", + "azure.mgmt.azurestackhci.models.OperationDetail": "Microsoft.AzureStackHCI.OperationDetail", + "azure.mgmt.azurestackhci.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "azure.mgmt.azurestackhci.models.OptionalServices": "Microsoft.AzureStackHCI.OptionalServices", + "azure.mgmt.azurestackhci.models.OsImage": "Microsoft.AzureStackHCI.OsImage", + "azure.mgmt.azurestackhci.models.OsImageProperties": "Microsoft.AzureStackHCI.OsImageProperties", + "azure.mgmt.azurestackhci.models.OsProfile": "Microsoft.AzureStackHCI.OsProfile", + "azure.mgmt.azurestackhci.models.OsProvisionProfile": "Microsoft.AzureStackHCI.OsProvisionProfile", + "azure.mgmt.azurestackhci.models.OwnershipVoucherDetails": "Microsoft.AzureStackHCI.OwnershipVoucherDetails", + "azure.mgmt.azurestackhci.models.OwnershipVoucherValidationDetails": "Microsoft.AzureStackHCI.OwnershipVoucherValidationDetails", + "azure.mgmt.azurestackhci.models.PackageVersionInfo": "Microsoft.AzureStackHCI.PackageVersionInfo", + "azure.mgmt.azurestackhci.models.PasswordCredential": "Microsoft.AzureStackHCI.PasswordCredential", + "azure.mgmt.azurestackhci.models.PerNodeExtensionState": "Microsoft.AzureStackHCI.PerNodeExtensionState", + "azure.mgmt.azurestackhci.models.PerNodeRemoteSupportSession": "Microsoft.AzureStackHCI.PerNodeRemoteSupportSession", + "azure.mgmt.azurestackhci.models.PerNodeState": "Microsoft.AzureStackHCI.PerNodeState", + "azure.mgmt.azurestackhci.models.PhysicalNodes": "Microsoft.AzureStackHCI.PhysicalNodes", + "azure.mgmt.azurestackhci.models.PlatformPayload": "Microsoft.AzureStackHCI.PlatformPayload", + "azure.mgmt.azurestackhci.models.PlatformUpdate": "Microsoft.AzureStackHCI.PlatformUpdate", + "azure.mgmt.azurestackhci.models.PlatformUpdateDetails": "Microsoft.AzureStackHCI.PlatformUpdateDetails", + "azure.mgmt.azurestackhci.models.PlatformUpdateProperties": "Microsoft.AzureStackHCI.PlatformUpdateProperties", + "azure.mgmt.azurestackhci.models.PrecheckResult": "Microsoft.AzureStackHCI.PrecheckResult", + "azure.mgmt.azurestackhci.models.PrecheckResultTags": "Microsoft.AzureStackHCI.PrecheckResultTags", + "azure.mgmt.azurestackhci.models.ProvisioningDetails": "Microsoft.AzureStackHCI.ProvisioningDetails", + "azure.mgmt.azurestackhci.models.ProvisioningRequest": "Microsoft.AzureStackHCI.ProvisioningRequest", + "azure.mgmt.azurestackhci.models.ProvisionOsJobProperties": "Microsoft.AzureStackHCI.ProvisionOsJobProperties", + "azure.mgmt.azurestackhci.models.ProvisionOsReportedProperties": "Microsoft.AzureStackHCI.ProvisionOsReportedProperties", + "azure.mgmt.azurestackhci.models.Publisher": "Microsoft.AzureStackHCI.Publisher", + "azure.mgmt.azurestackhci.models.PublisherProperties": "Microsoft.AzureStackHCI.PublisherProperties", + "azure.mgmt.azurestackhci.models.QosPolicyOverrides": "Microsoft.AzureStackHCI.QosPolicyOverrides", + "azure.mgmt.azurestackhci.models.RawCertificateData": "Microsoft.AzureStackHCI.RawCertificateData", + "azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest": "Microsoft.AzureStackHCI.ReconcileArcSettingsRequest", + "azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequestProperties": "Microsoft.AzureStackHCI.ReconcileArcSettingsRequestProperties", + "azure.mgmt.azurestackhci.models.RemoteSupportJobNodeSettings": "Microsoft.AzureStackHCI.RemoteSupportJobNodeSettings", + "azure.mgmt.azurestackhci.models.RemoteSupportJobReportedProperties": "Microsoft.AzureStackHCI.RemoteSupportJobReportedProperties", + "azure.mgmt.azurestackhci.models.RemoteSupportNodeSettings": "Microsoft.AzureStackHCI.RemoteSupportNodeSettings", + "azure.mgmt.azurestackhci.models.RemoteSupportProperties": "Microsoft.AzureStackHCI.RemoteSupportProperties", + "azure.mgmt.azurestackhci.models.RemoteSupportRequest": "Microsoft.AzureStackHCI.RemoteSupportRequest", + "azure.mgmt.azurestackhci.models.RemoteSupportRequestProperties": "Microsoft.AzureStackHCI.RemoteSupportRequestProperties", + "azure.mgmt.azurestackhci.models.RemoteSupportSession": "Microsoft.AzureStackHCI.RemoteSupportSession", + "azure.mgmt.azurestackhci.models.SbeCredentials": "Microsoft.AzureStackHCI.SbeCredentials", + "azure.mgmt.azurestackhci.models.SbeDeploymentInfo": "Microsoft.AzureStackHCI.SbeDeploymentInfo", + "azure.mgmt.azurestackhci.models.SbeDeploymentPackageInfo": "Microsoft.AzureStackHCI.SbeDeploymentPackageInfo", + "azure.mgmt.azurestackhci.models.SbePartnerInfo": "Microsoft.AzureStackHCI.SbePartnerInfo", + "azure.mgmt.azurestackhci.models.SbePartnerProperties": "Microsoft.AzureStackHCI.SbePartnerProperties", + "azure.mgmt.azurestackhci.models.ScaleUnits": "Microsoft.AzureStackHCI.ScaleUnits", + "azure.mgmt.azurestackhci.models.SdnIntegration": "Microsoft.AzureStackHCI.SdnIntegration", + "azure.mgmt.azurestackhci.models.SecretsLocationDetails": "Microsoft.AzureStackHCI.SecretsLocationDetails", + "azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest": "Microsoft.AzureStackHCI.SecretsLocationsChangeRequest", + "azure.mgmt.azurestackhci.models.SecurityComplianceStatus": "Microsoft.AzureStackHCI.SecurityComplianceStatus", + "azure.mgmt.azurestackhci.models.SecurityProperties": "Microsoft.AzureStackHCI.SecurityProperties", + "azure.mgmt.azurestackhci.models.SecuritySetting": "Microsoft.AzureStackHCI.SecuritySetting", + "azure.mgmt.azurestackhci.models.ServiceConfiguration": "Microsoft.AzureStackHCI.ServiceConfiguration", + "azure.mgmt.azurestackhci.models.SiteDetails": "Microsoft.AzureStackHCI.SiteDetails", + "azure.mgmt.azurestackhci.models.Sku": "Microsoft.AzureStackHCI.Sku", + "azure.mgmt.azurestackhci.models.SkuMappings": "Microsoft.AzureStackHCI.SkuMappings", + "azure.mgmt.azurestackhci.models.SkuProperties": "Microsoft.AzureStackHCI.SkuProperties", + "azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest": "Microsoft.AzureStackHCI.SoftwareAssuranceChangeRequest", + "azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequestProperties": "Microsoft.AzureStackHCI.SoftwareAssuranceChangeRequestProperties", + "azure.mgmt.azurestackhci.models.SoftwareAssuranceProperties": "Microsoft.AzureStackHCI.SoftwareAssuranceProperties", + "azure.mgmt.azurestackhci.models.Step": "Microsoft.AzureStackHCI.Step", + "azure.mgmt.azurestackhci.models.Storage": "Microsoft.AzureStackHCI.Storage", + "azure.mgmt.azurestackhci.models.StorageConfiguration": "Microsoft.AzureStackHCI.StorageConfiguration", + "azure.mgmt.azurestackhci.models.StorageProfile": "Microsoft.AzureStackHCI.StorageProfile", + "azure.mgmt.azurestackhci.models.SwitchDetail": "Microsoft.AzureStackHCI.SwitchDetail", + "azure.mgmt.azurestackhci.models.SwitchExtension": "Microsoft.AzureStackHCI.SwitchExtension", + "azure.mgmt.azurestackhci.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.azurestackhci.models.TargetDeviceConfiguration": "Microsoft.AzureStackHCI.TargetDeviceConfiguration", + "azure.mgmt.azurestackhci.models.TimeConfiguration": "Microsoft.AzureStackHCI.TimeConfiguration", + "azure.mgmt.azurestackhci.models.Update": "Microsoft.AzureStackHCI.Update", + "azure.mgmt.azurestackhci.models.UpdateContent": "Microsoft.AzureStackHCI.UpdateContent", + "azure.mgmt.azurestackhci.models.UpdateContentProperties": "Microsoft.AzureStackHCI.UpdateContentProperties", + "azure.mgmt.azurestackhci.models.UpdatePrerequisite": "Microsoft.AzureStackHCI.UpdatePrerequisite", + "azure.mgmt.azurestackhci.models.UpdateProperties": "Microsoft.AzureStackHCI.UpdateProperties", + "azure.mgmt.azurestackhci.models.UpdateRun": "Microsoft.AzureStackHCI.UpdateRun", + "azure.mgmt.azurestackhci.models.UpdateRunProperties": "Microsoft.AzureStackHCI.UpdateRunProperties", + "azure.mgmt.azurestackhci.models.UpdateStateProperties": "Microsoft.AzureStackHCI.UpdateStateProperties", + "azure.mgmt.azurestackhci.models.UpdateSummaries": "Microsoft.AzureStackHCI.UpdateSummaries", + "azure.mgmt.azurestackhci.models.UpdateSummariesProperties": "Microsoft.AzureStackHCI.UpdateSummariesProperties", + "azure.mgmt.azurestackhci.models.UploadCertificateRequest": "Microsoft.AzureStackHCI.UploadCertificateRequest", + "azure.mgmt.azurestackhci.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "azure.mgmt.azurestackhci.models.UserDetails": "Microsoft.AzureStackHCI.UserDetails", + "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe": "Microsoft.AzureStackHCI.ValidatedSolutionRecipe", + "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeCapabilities": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeCapabilities", + "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeCapability": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeCapability", + "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeComponent": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeComponent", + "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeComponentMetadata": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeComponentMetadata", + "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeComponentPayload": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeComponentPayload", + "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeContent": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeContent", + "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeInfo": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeInfo", + "azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeProperties": "Microsoft.AzureStackHCI.ValidatedSolutionRecipeProperties", + "azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest": "Microsoft.AzureStackHCI.ValidateOwnershipVouchersRequest", + "azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse": "Microsoft.AzureStackHCI.ValidateOwnershipVouchersResponse", + "azure.mgmt.azurestackhci.models.ValidateRequest": "Microsoft.AzureStackHCI.ValidateRequest", + "azure.mgmt.azurestackhci.models.ValidateResponse": "Microsoft.AzureStackHCI.ValidateResponse", + "azure.mgmt.azurestackhci.models.WebProxyConfiguration": "Microsoft.AzureStackHCI.WebProxyConfiguration", + "azure.mgmt.azurestackhci.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.azurestackhci.models.Origin": "Azure.ResourceManager.CommonTypes.Origin", + "azure.mgmt.azurestackhci.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType", + "azure.mgmt.azurestackhci.models.ProvisioningState": "Microsoft.AzureStackHCI.ProvisioningState", + "azure.mgmt.azurestackhci.models.ArcSettingAggregateState": "Microsoft.AzureStackHCI.ArcSettingAggregateState", + "azure.mgmt.azurestackhci.models.NodeArcState": "Microsoft.AzureStackHCI.NodeArcState", + "azure.mgmt.azurestackhci.models.ServiceName": "Microsoft.AzureStackHCI.ServiceName", + "azure.mgmt.azurestackhci.models.Status": "Microsoft.AzureStackHCI.Status", + "azure.mgmt.azurestackhci.models.ConnectivityStatus": "Microsoft.AzureStackHCI.ConnectivityStatus", + "azure.mgmt.azurestackhci.models.SupportStatus": "Microsoft.AzureStackHCI.SupportStatus", + "azure.mgmt.azurestackhci.models.SoftwareAssuranceStatus": "Microsoft.AzureStackHCI.SoftwareAssuranceStatus", + "azure.mgmt.azurestackhci.models.SoftwareAssuranceIntent": "Microsoft.AzureStackHCI.SoftwareAssuranceIntent", + "azure.mgmt.azurestackhci.models.LogCollectionStatus": "Microsoft.AzureStackHCI.LogCollectionStatus", + "azure.mgmt.azurestackhci.models.LogCollectionJobType": "Microsoft.AzureStackHCI.LogCollectionJobType", + "azure.mgmt.azurestackhci.models.AccessLevel": "Microsoft.AzureStackHCI.AccessLevel", + "azure.mgmt.azurestackhci.models.RemoteSupportType": "Microsoft.AzureStackHCI.RemoteSupportType", + "azure.mgmt.azurestackhci.models.WindowsServerSubscription": "Microsoft.AzureStackHCI.WindowsServerSubscription", + "azure.mgmt.azurestackhci.models.DiagnosticLevel": "Microsoft.AzureStackHCI.DiagnosticLevel", + "azure.mgmt.azurestackhci.models.ClusterNodeType": "Microsoft.AzureStackHCI.ClusterNodeType", + "azure.mgmt.azurestackhci.models.OemActivation": "Microsoft.AzureStackHCI.OemActivation", + "azure.mgmt.azurestackhci.models.ImdsAttestation": "Microsoft.AzureStackHCI.ImdsAttestation", + "azure.mgmt.azurestackhci.models.HardwareClass": "Microsoft.AzureStackHCI.HardwareClass", + "azure.mgmt.azurestackhci.models.SecretsType": "Microsoft.AzureStackHCI.SecretsType", + "azure.mgmt.azurestackhci.models.ClusterPattern": "Microsoft.AzureStackHCI.ClusterPattern", + "azure.mgmt.azurestackhci.models.ConfidentialVmIntent": "Microsoft.AzureStackHCI.ConfidentialVmIntent", + "azure.mgmt.azurestackhci.models.ConfidentialVmStatus": "Microsoft.AzureStackHCI.ConfidentialVmStatus", + "azure.mgmt.azurestackhci.models.SdnStatus": "Microsoft.AzureStackHCI.SdnStatus", + "azure.mgmt.azurestackhci.models.SdnIntegrationIntent": "Microsoft.AzureStackHCI.SdnIntegrationIntent", + "azure.mgmt.azurestackhci.models.IdentityProvider": "Microsoft.AzureStackHCI.IdentityProvider", + "azure.mgmt.azurestackhci.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "azure.mgmt.azurestackhci.models.DeploymentMode": "Microsoft.AzureStackHCI.DeploymentMode", + "azure.mgmt.azurestackhci.models.OperationType": "Microsoft.AzureStackHCI.OperationType", + "azure.mgmt.azurestackhci.models.DnsServerConfig": "Microsoft.AzureStackHCI.DnsServerConfig", + "azure.mgmt.azurestackhci.models.EceSecrets": "Microsoft.AzureStackHCI.EceSecrets", + "azure.mgmt.azurestackhci.models.EdgeDeviceKind": "Microsoft.AzureStackHCI.EdgeDeviceKind", + "azure.mgmt.azurestackhci.models.JobStatus": "Microsoft.AzureStackHCI.JobStatus", + "azure.mgmt.azurestackhci.models.HciEdgeDeviceJobType": "Microsoft.AzureStackHCI.HciEdgeDeviceJobType", + "azure.mgmt.azurestackhci.models.DeviceLogCollectionStatus": "Microsoft.AzureStackHCI.DeviceLogCollectionStatus", + "azure.mgmt.azurestackhci.models.RemoteSupportAccessLevel": "Microsoft.AzureStackHCI.RemoteSupportAccessLevel", + "azure.mgmt.azurestackhci.models.DeviceKind": "Microsoft.AzureStackHCI.DeviceKind", + "azure.mgmt.azurestackhci.models.DeviceState": "Microsoft.AzureStackHCI.DeviceState", + "azure.mgmt.azurestackhci.models.ArcExtensionState": "Microsoft.AzureStackHCI.ArcExtensionState", + "azure.mgmt.azurestackhci.models.ExtensionManagedBy": "Microsoft.AzureStackHCI.ExtensionManagedBy", + "azure.mgmt.azurestackhci.models.IgvmStatus": "Microsoft.AzureStackHCI.IgvmStatus", + "azure.mgmt.azurestackhci.models.RdmaCapability": "Microsoft.AzureStackHCI.RdmaCapability", + "azure.mgmt.azurestackhci.models.ExtensionAggregateState": "Microsoft.AzureStackHCI.ExtensionAggregateState", + "azure.mgmt.azurestackhci.models.NodeExtensionState": "Microsoft.AzureStackHCI.NodeExtensionState", + "azure.mgmt.azurestackhci.models.StatusLevelTypes": "Microsoft.AzureStackHCI.StatusLevelTypes", + "azure.mgmt.azurestackhci.models.ComplianceAssignmentType": "Microsoft.AzureStackHCI.ComplianceAssignmentType", + "azure.mgmt.azurestackhci.models.ComplianceStatus": "Microsoft.AzureStackHCI.ComplianceStatus", + "azure.mgmt.azurestackhci.models.UpdateRunPropertiesState": "Microsoft.AzureStackHCI.UpdateRunPropertiesState", + "azure.mgmt.azurestackhci.models.State": "Microsoft.AzureStackHCI.State", + "azure.mgmt.azurestackhci.models.RebootRequirement": "Microsoft.AzureStackHCI.RebootRequirement", + "azure.mgmt.azurestackhci.models.HealthState": "Microsoft.AzureStackHCI.HealthState", + "azure.mgmt.azurestackhci.models.Severity": "Microsoft.AzureStackHCI.Severity", + "azure.mgmt.azurestackhci.models.AvailabilityType": "Microsoft.AzureStackHCI.AvailabilityType", + "azure.mgmt.azurestackhci.models.EdgeMachineKind": "Microsoft.AzureStackHCI.EdgeMachineKind", + "azure.mgmt.azurestackhci.models.OwnerKeyType": "Microsoft.AzureStackHCI.OwnerKeyType", + "azure.mgmt.azurestackhci.models.OSOperationType": "Microsoft.AzureStackHCI.OSOperationType", + "azure.mgmt.azurestackhci.models.SecretType": "Microsoft.AzureStackHCI.SecretType", + "azure.mgmt.azurestackhci.models.EdgeMachineState": "Microsoft.AzureStackHCI.EdgeMachineState", + "azure.mgmt.azurestackhci.models.EdgeMachineConnectivityStatus": "Microsoft.AzureStackHCI.EdgeMachineConnectivityStatus", + "azure.mgmt.azurestackhci.models.EdgeMachineJobType": "Microsoft.AzureStackHCI.EdgeMachineJobType", + "azure.mgmt.azurestackhci.models.ProvisioningOsType": "Microsoft.AzureStackHCI.ProvisioningOsType", + "azure.mgmt.azurestackhci.models.OnboardingResourceType": "Microsoft.AzureStackHCI.OnboardingResourceType", + "azure.mgmt.azurestackhci.models.IpAssignmentType": "Microsoft.AzureStackHCI.IpAssignmentType", + "azure.mgmt.azurestackhci.models.OwnershipVoucherValidationStatus": "Microsoft.AzureStackHCI.OwnershipVoucherValidationStatus", + "azure.mgmt.azurestackhci.models.UpdateSummariesPropertiesState": "Microsoft.AzureStackHCI.UpdateSummariesPropertiesState", + "azure.mgmt.azurestackhci.operations.KubernetesVersionsOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.KubernetesVersions.listBySubscriptionLocationResource", + "azure.mgmt.azurestackhci.aio.operations.KubernetesVersionsOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.KubernetesVersions.listBySubscriptionLocationResource", + "azure.mgmt.azurestackhci.operations.PlatformUpdatesOperations.get": "Microsoft.AzureStackHCI.PlatformUpdates.get", + "azure.mgmt.azurestackhci.aio.operations.PlatformUpdatesOperations.get": "Microsoft.AzureStackHCI.PlatformUpdates.get", + "azure.mgmt.azurestackhci.operations.PlatformUpdatesOperations.list": "Microsoft.AzureStackHCI.PlatformUpdates.list", + "azure.mgmt.azurestackhci.aio.operations.PlatformUpdatesOperations.list": "Microsoft.AzureStackHCI.PlatformUpdates.list", + "azure.mgmt.azurestackhci.operations.OsImagesOperations.get": "Microsoft.AzureStackHCI.OsImages.get", + "azure.mgmt.azurestackhci.aio.operations.OsImagesOperations.get": "Microsoft.AzureStackHCI.OsImages.get", + "azure.mgmt.azurestackhci.operations.OsImagesOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.OsImages.listBySubscriptionLocationResource", + "azure.mgmt.azurestackhci.aio.operations.OsImagesOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.OsImages.listBySubscriptionLocationResource", + "azure.mgmt.azurestackhci.operations.UpdateContentsOperations.get": "Microsoft.AzureStackHCI.UpdateContents.get", + "azure.mgmt.azurestackhci.aio.operations.UpdateContentsOperations.get": "Microsoft.AzureStackHCI.UpdateContents.get", + "azure.mgmt.azurestackhci.operations.UpdateContentsOperations.list": "Microsoft.AzureStackHCI.UpdateContents.list", + "azure.mgmt.azurestackhci.aio.operations.UpdateContentsOperations.list": "Microsoft.AzureStackHCI.UpdateContents.list", + "azure.mgmt.azurestackhci.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.azurestackhci.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.get": "Microsoft.AzureStackHCI.ArcSettings.get", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.get": "Microsoft.AzureStackHCI.ArcSettings.get", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.create": "Microsoft.AzureStackHCI.ArcSettings.create", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.create": "Microsoft.AzureStackHCI.ArcSettings.create", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.update": "Microsoft.AzureStackHCI.ArcSettings.update", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.update": "Microsoft.AzureStackHCI.ArcSettings.update", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.begin_delete": "Microsoft.AzureStackHCI.ArcSettings.delete", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.begin_delete": "Microsoft.AzureStackHCI.ArcSettings.delete", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.list_by_cluster": "Microsoft.AzureStackHCI.ArcSettings.listByCluster", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.list_by_cluster": "Microsoft.AzureStackHCI.ArcSettings.listByCluster", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.generate_password": "Microsoft.AzureStackHCI.ArcSettings.generatePassword", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.generate_password": "Microsoft.AzureStackHCI.ArcSettings.generatePassword", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.begin_create_identity": "Microsoft.AzureStackHCI.ArcSettings.createIdentity", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.begin_create_identity": "Microsoft.AzureStackHCI.ArcSettings.createIdentity", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.begin_reconcile": "Microsoft.AzureStackHCI.ArcSettings.reconcile", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.begin_reconcile": "Microsoft.AzureStackHCI.ArcSettings.reconcile", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.consent_and_install_default_extensions": "Microsoft.AzureStackHCI.ArcSettings.consentAndInstallDefaultExtensions", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.consent_and_install_default_extensions": "Microsoft.AzureStackHCI.ArcSettings.consentAndInstallDefaultExtensions", + "azure.mgmt.azurestackhci.operations.ArcSettingsOperations.begin_initialize_disable_process": "Microsoft.AzureStackHCI.ArcSettings.initializeDisableProcess", + "azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations.begin_initialize_disable_process": "Microsoft.AzureStackHCI.ArcSettings.initializeDisableProcess", + "azure.mgmt.azurestackhci.operations.OffersOperations.get": "Microsoft.AzureStackHCI.Offers.get", + "azure.mgmt.azurestackhci.aio.operations.OffersOperations.get": "Microsoft.AzureStackHCI.Offers.get", + "azure.mgmt.azurestackhci.operations.OffersOperations.list_by_publisher": "Microsoft.AzureStackHCI.Offers.listByPublisher", + "azure.mgmt.azurestackhci.aio.operations.OffersOperations.list_by_publisher": "Microsoft.AzureStackHCI.Offers.listByPublisher", + "azure.mgmt.azurestackhci.operations.OffersOperations.list_by_cluster": "Microsoft.AzureStackHCI.Clusters.listByCluster", + "azure.mgmt.azurestackhci.aio.operations.OffersOperations.list_by_cluster": "Microsoft.AzureStackHCI.Clusters.listByCluster", + "azure.mgmt.azurestackhci.operations.ClustersOperations.get": "Microsoft.AzureStackHCI.Clusters.get", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.get": "Microsoft.AzureStackHCI.Clusters.get", + "azure.mgmt.azurestackhci.operations.ClustersOperations.create": "Microsoft.AzureStackHCI.Clusters.create", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.create": "Microsoft.AzureStackHCI.Clusters.create", + "azure.mgmt.azurestackhci.operations.ClustersOperations.update": "Microsoft.AzureStackHCI.Clusters.update", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.update": "Microsoft.AzureStackHCI.Clusters.update", + "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_delete": "Microsoft.AzureStackHCI.Clusters.delete", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_delete": "Microsoft.AzureStackHCI.Clusters.delete", + "azure.mgmt.azurestackhci.operations.ClustersOperations.list_by_resource_group": "Microsoft.AzureStackHCI.Clusters.listByResourceGroup", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.list_by_resource_group": "Microsoft.AzureStackHCI.Clusters.listByResourceGroup", + "azure.mgmt.azurestackhci.operations.ClustersOperations.list_by_subscription": "Microsoft.AzureStackHCI.Clusters.listBySubscription", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.list_by_subscription": "Microsoft.AzureStackHCI.Clusters.listBySubscription", + "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_update_secrets_locations": "Microsoft.AzureStackHCI.Clusters.updateSecretsLocations", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_update_secrets_locations": "Microsoft.AzureStackHCI.Clusters.updateSecretsLocations", + "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_upload_certificate": "Microsoft.AzureStackHCI.Clusters.uploadCertificate", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_upload_certificate": "Microsoft.AzureStackHCI.Clusters.uploadCertificate", + "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_create_identity": "Microsoft.AzureStackHCI.Clusters.createIdentity", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_create_identity": "Microsoft.AzureStackHCI.Clusters.createIdentity", + "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_extend_software_assurance_benefit": "Microsoft.AzureStackHCI.Clusters.extendSoftwareAssuranceBenefit", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_extend_software_assurance_benefit": "Microsoft.AzureStackHCI.Clusters.extendSoftwareAssuranceBenefit", + "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_change_ring": "Microsoft.AzureStackHCI.Clusters.changeRing", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_change_ring": "Microsoft.AzureStackHCI.Clusters.changeRing", + "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_trigger_log_collection": "Microsoft.AzureStackHCI.Clusters.triggerLogCollection", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_trigger_log_collection": "Microsoft.AzureStackHCI.Clusters.triggerLogCollection", + "azure.mgmt.azurestackhci.operations.ClustersOperations.begin_configure_remote_support": "Microsoft.AzureStackHCI.Clusters.configureRemoteSupport", + "azure.mgmt.azurestackhci.aio.operations.ClustersOperations.begin_configure_remote_support": "Microsoft.AzureStackHCI.Clusters.configureRemoteSupport", + "azure.mgmt.azurestackhci.operations.DeploymentSettingsOperations.get": "Microsoft.AzureStackHCI.DeploymentSettings.get", + "azure.mgmt.azurestackhci.aio.operations.DeploymentSettingsOperations.get": "Microsoft.AzureStackHCI.DeploymentSettings.get", + "azure.mgmt.azurestackhci.operations.DeploymentSettingsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.DeploymentSettings.createOrUpdate", + "azure.mgmt.azurestackhci.aio.operations.DeploymentSettingsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.DeploymentSettings.createOrUpdate", + "azure.mgmt.azurestackhci.operations.DeploymentSettingsOperations.begin_delete": "Microsoft.AzureStackHCI.DeploymentSettings.delete", + "azure.mgmt.azurestackhci.aio.operations.DeploymentSettingsOperations.begin_delete": "Microsoft.AzureStackHCI.DeploymentSettings.delete", + "azure.mgmt.azurestackhci.operations.DeploymentSettingsOperations.list_by_clusters": "Microsoft.AzureStackHCI.DeploymentSettings.listByClusters", + "azure.mgmt.azurestackhci.aio.operations.DeploymentSettingsOperations.list_by_clusters": "Microsoft.AzureStackHCI.DeploymentSettings.listByClusters", + "azure.mgmt.azurestackhci.operations.EdgeDeviceJobsOperations.get": "Microsoft.AzureStackHCI.EdgeDeviceJobs.get", + "azure.mgmt.azurestackhci.aio.operations.EdgeDeviceJobsOperations.get": "Microsoft.AzureStackHCI.EdgeDeviceJobs.get", + "azure.mgmt.azurestackhci.operations.EdgeDeviceJobsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeDeviceJobs.createOrUpdate", + "azure.mgmt.azurestackhci.aio.operations.EdgeDeviceJobsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeDeviceJobs.createOrUpdate", + "azure.mgmt.azurestackhci.operations.EdgeDeviceJobsOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeDeviceJobs.delete", + "azure.mgmt.azurestackhci.aio.operations.EdgeDeviceJobsOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeDeviceJobs.delete", + "azure.mgmt.azurestackhci.operations.EdgeDeviceJobsOperations.list_by_edge_device": "Microsoft.AzureStackHCI.EdgeDeviceJobs.listByEdgeDevice", + "azure.mgmt.azurestackhci.aio.operations.EdgeDeviceJobsOperations.list_by_edge_device": "Microsoft.AzureStackHCI.EdgeDeviceJobs.listByEdgeDevice", + "azure.mgmt.azurestackhci.operations.EdgeDevicesOperations.get": "Microsoft.AzureStackHCI.EdgeDevices.get", + "azure.mgmt.azurestackhci.aio.operations.EdgeDevicesOperations.get": "Microsoft.AzureStackHCI.EdgeDevices.get", + "azure.mgmt.azurestackhci.operations.EdgeDevicesOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeDevices.createOrUpdate", + "azure.mgmt.azurestackhci.aio.operations.EdgeDevicesOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeDevices.createOrUpdate", + "azure.mgmt.azurestackhci.operations.EdgeDevicesOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeDevices.delete", + "azure.mgmt.azurestackhci.aio.operations.EdgeDevicesOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeDevices.delete", + "azure.mgmt.azurestackhci.operations.EdgeDevicesOperations.list": "Microsoft.AzureStackHCI.EdgeDevices.list", + "azure.mgmt.azurestackhci.aio.operations.EdgeDevicesOperations.list": "Microsoft.AzureStackHCI.EdgeDevices.list", + "azure.mgmt.azurestackhci.operations.EdgeDevicesOperations.begin_validate": "Microsoft.AzureStackHCI.EdgeDevices.validate", + "azure.mgmt.azurestackhci.aio.operations.EdgeDevicesOperations.begin_validate": "Microsoft.AzureStackHCI.EdgeDevices.validate", + "azure.mgmt.azurestackhci.operations.ExtensionsOperations.get": "Microsoft.AzureStackHCI.Extensions.get", + "azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations.get": "Microsoft.AzureStackHCI.Extensions.get", + "azure.mgmt.azurestackhci.operations.ExtensionsOperations.begin_create": "Microsoft.AzureStackHCI.Extensions.create", + "azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations.begin_create": "Microsoft.AzureStackHCI.Extensions.create", + "azure.mgmt.azurestackhci.operations.ExtensionsOperations.begin_update": "Microsoft.AzureStackHCI.Extensions.update", + "azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations.begin_update": "Microsoft.AzureStackHCI.Extensions.update", + "azure.mgmt.azurestackhci.operations.ExtensionsOperations.begin_delete": "Microsoft.AzureStackHCI.Extensions.delete", + "azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations.begin_delete": "Microsoft.AzureStackHCI.Extensions.delete", + "azure.mgmt.azurestackhci.operations.ExtensionsOperations.list_by_arc_setting": "Microsoft.AzureStackHCI.Extensions.listByArcSetting", + "azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations.list_by_arc_setting": "Microsoft.AzureStackHCI.Extensions.listByArcSetting", + "azure.mgmt.azurestackhci.operations.ExtensionsOperations.begin_upgrade": "Microsoft.AzureStackHCI.Extensions.upgrade", + "azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations.begin_upgrade": "Microsoft.AzureStackHCI.Extensions.upgrade", + "azure.mgmt.azurestackhci.operations.PublishersOperations.get": "Microsoft.AzureStackHCI.Publishers.get", + "azure.mgmt.azurestackhci.aio.operations.PublishersOperations.get": "Microsoft.AzureStackHCI.Publishers.get", + "azure.mgmt.azurestackhci.operations.PublishersOperations.list_by_cluster": "Microsoft.AzureStackHCI.Publishers.listByCluster", + "azure.mgmt.azurestackhci.aio.operations.PublishersOperations.list_by_cluster": "Microsoft.AzureStackHCI.Publishers.listByCluster", + "azure.mgmt.azurestackhci.operations.SecuritySettingsOperations.get": "Microsoft.AzureStackHCI.SecuritySettings.get", + "azure.mgmt.azurestackhci.aio.operations.SecuritySettingsOperations.get": "Microsoft.AzureStackHCI.SecuritySettings.get", + "azure.mgmt.azurestackhci.operations.SecuritySettingsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.SecuritySettings.createOrUpdate", + "azure.mgmt.azurestackhci.aio.operations.SecuritySettingsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.SecuritySettings.createOrUpdate", + "azure.mgmt.azurestackhci.operations.SecuritySettingsOperations.begin_delete": "Microsoft.AzureStackHCI.SecuritySettings.delete", + "azure.mgmt.azurestackhci.aio.operations.SecuritySettingsOperations.begin_delete": "Microsoft.AzureStackHCI.SecuritySettings.delete", + "azure.mgmt.azurestackhci.operations.SecuritySettingsOperations.list_by_clusters": "Microsoft.AzureStackHCI.SecuritySettings.listByClusters", + "azure.mgmt.azurestackhci.aio.operations.SecuritySettingsOperations.list_by_clusters": "Microsoft.AzureStackHCI.SecuritySettings.listByClusters", + "azure.mgmt.azurestackhci.operations.SkusOperations.get": "Microsoft.AzureStackHCI.Skus.get", + "azure.mgmt.azurestackhci.aio.operations.SkusOperations.get": "Microsoft.AzureStackHCI.Skus.get", + "azure.mgmt.azurestackhci.operations.SkusOperations.list_by_offer": "Microsoft.AzureStackHCI.Skus.listByOffer", + "azure.mgmt.azurestackhci.aio.operations.SkusOperations.list_by_offer": "Microsoft.AzureStackHCI.Skus.listByOffer", + "azure.mgmt.azurestackhci.operations.UpdateRunsOperations.get": "Microsoft.AzureStackHCI.UpdateRuns.get", + "azure.mgmt.azurestackhci.aio.operations.UpdateRunsOperations.get": "Microsoft.AzureStackHCI.UpdateRuns.get", + "azure.mgmt.azurestackhci.operations.UpdateRunsOperations.put": "Microsoft.AzureStackHCI.UpdateRuns.put", + "azure.mgmt.azurestackhci.aio.operations.UpdateRunsOperations.put": "Microsoft.AzureStackHCI.UpdateRuns.put", + "azure.mgmt.azurestackhci.operations.UpdateRunsOperations.begin_delete": "Microsoft.AzureStackHCI.UpdateRuns.delete", + "azure.mgmt.azurestackhci.aio.operations.UpdateRunsOperations.begin_delete": "Microsoft.AzureStackHCI.UpdateRuns.delete", + "azure.mgmt.azurestackhci.operations.UpdateRunsOperations.list": "Microsoft.AzureStackHCI.UpdateRuns.list", + "azure.mgmt.azurestackhci.aio.operations.UpdateRunsOperations.list": "Microsoft.AzureStackHCI.UpdateRuns.list", + "azure.mgmt.azurestackhci.operations.UpdatesOperations.get": "Microsoft.AzureStackHCI.Updates.get", + "azure.mgmt.azurestackhci.aio.operations.UpdatesOperations.get": "Microsoft.AzureStackHCI.Updates.get", + "azure.mgmt.azurestackhci.operations.UpdatesOperations.put": "Microsoft.AzureStackHCI.Updates.put", + "azure.mgmt.azurestackhci.aio.operations.UpdatesOperations.put": "Microsoft.AzureStackHCI.Updates.put", + "azure.mgmt.azurestackhci.operations.UpdatesOperations.begin_delete": "Microsoft.AzureStackHCI.Updates.delete", + "azure.mgmt.azurestackhci.aio.operations.UpdatesOperations.begin_delete": "Microsoft.AzureStackHCI.Updates.delete", + "azure.mgmt.azurestackhci.operations.UpdatesOperations.list": "Microsoft.AzureStackHCI.Updates.list", + "azure.mgmt.azurestackhci.aio.operations.UpdatesOperations.list": "Microsoft.AzureStackHCI.Updates.list", + "azure.mgmt.azurestackhci.operations.UpdatesOperations.begin_post": "Microsoft.AzureStackHCI.Updates.post", + "azure.mgmt.azurestackhci.aio.operations.UpdatesOperations.begin_post": "Microsoft.AzureStackHCI.Updates.post", + "azure.mgmt.azurestackhci.operations.ValidatedSolutionRecipesOperations.get": "Microsoft.AzureStackHCI.ValidatedSolutionRecipes.get", + "azure.mgmt.azurestackhci.aio.operations.ValidatedSolutionRecipesOperations.get": "Microsoft.AzureStackHCI.ValidatedSolutionRecipes.get", + "azure.mgmt.azurestackhci.operations.ValidatedSolutionRecipesOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.ValidatedSolutionRecipes.listBySubscriptionLocationResource", + "azure.mgmt.azurestackhci.aio.operations.ValidatedSolutionRecipesOperations.list_by_subscription_location_resource": "Microsoft.AzureStackHCI.ValidatedSolutionRecipes.listBySubscriptionLocationResource", + "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.get": "Microsoft.AzureStackHCI.EdgeMachines.get", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.get": "Microsoft.AzureStackHCI.EdgeMachines.get", + "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeMachines.createOrUpdate", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeMachines.createOrUpdate", + "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.begin_update": "Microsoft.AzureStackHCI.EdgeMachines.update", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.begin_update": "Microsoft.AzureStackHCI.EdgeMachines.update", + "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeMachines.delete", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeMachines.delete", + "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.list_by_resource_group": "Microsoft.AzureStackHCI.EdgeMachines.listByResourceGroup", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.list_by_resource_group": "Microsoft.AzureStackHCI.EdgeMachines.listByResourceGroup", + "azure.mgmt.azurestackhci.operations.EdgeMachinesOperations.list_by_subscription": "Microsoft.AzureStackHCI.EdgeMachines.listBySubscription", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations.list_by_subscription": "Microsoft.AzureStackHCI.EdgeMachines.listBySubscription", + "azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations.get": "Microsoft.AzureStackHCI.EdgeMachineJobs.get", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations.get": "Microsoft.AzureStackHCI.EdgeMachineJobs.get", + "azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeMachineJobs.createOrUpdate", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations.begin_create_or_update": "Microsoft.AzureStackHCI.EdgeMachineJobs.createOrUpdate", + "azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeMachineJobs.delete", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations.begin_delete": "Microsoft.AzureStackHCI.EdgeMachineJobs.delete", + "azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations.list": "Microsoft.AzureStackHCI.EdgeMachineJobs.list", + "azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations.list": "Microsoft.AzureStackHCI.EdgeMachineJobs.list", + "azure.mgmt.azurestackhci.operations.OwnershipVouchersOperations.validate": "Microsoft.AzureStackHCI.OwnershipVouchers.validate", + "azure.mgmt.azurestackhci.aio.operations.OwnershipVouchersOperations.validate": "Microsoft.AzureStackHCI.OwnershipVouchers.validate", + "azure.mgmt.azurestackhci.operations.UpdateSummariesOperations.get": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.get", + "azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations.get": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.get", + "azure.mgmt.azurestackhci.operations.UpdateSummariesOperations.put": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.put", + "azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations.put": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.put", + "azure.mgmt.azurestackhci.operations.UpdateSummariesOperations.begin_delete": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.delete", + "azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations.begin_delete": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.delete", + "azure.mgmt.azurestackhci.operations.UpdateSummariesOperations.list": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.list", + "azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations.list": "Microsoft.AzureStackHCI.UpdateSummariesOperationGroup.list" + } +} \ No newline at end of file diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/__init__.py index f49c077d7b8a..2f6613c1adc4 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/__init__.py @@ -2,18 +2,24 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._azure_stack_hci_client import AzureStackHCIClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import AzureStackHCIClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "AzureStackHCIClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_client.py similarity index 59% rename from sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py rename to sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_client.py index fd250e7d509a..63b8212a1c99 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_client.py @@ -2,60 +2,80 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from . import models as _models from ._configuration import AzureStackHCIClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( ArcSettingsOperations, ClustersOperations, DeploymentSettingsOperations, + EdgeDeviceJobsOperations, EdgeDevicesOperations, + EdgeMachineJobsOperations, + EdgeMachinesOperations, ExtensionsOperations, + KubernetesVersionsOperations, OffersOperations, Operations, + OsImagesOperations, + OwnershipVouchersOperations, + PlatformUpdatesOperations, PublishersOperations, SecuritySettingsOperations, SkusOperations, + UpdateContentsOperations, UpdateRunsOperations, UpdateSummariesOperations, UpdatesOperations, + ValidatedSolutionRecipesOperations, ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """Azure Stack HCI management service. +class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes + """Azure Stack HCI service. + :ivar kubernetes_versions: KubernetesVersionsOperations operations + :vartype kubernetes_versions: azure.mgmt.azurestackhci.operations.KubernetesVersionsOperations + :ivar platform_updates: PlatformUpdatesOperations operations + :vartype platform_updates: azure.mgmt.azurestackhci.operations.PlatformUpdatesOperations + :ivar os_images: OsImagesOperations operations + :vartype os_images: azure.mgmt.azurestackhci.operations.OsImagesOperations + :ivar update_contents: UpdateContentsOperations operations + :vartype update_contents: azure.mgmt.azurestackhci.operations.UpdateContentsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.azurestackhci.operations.Operations :ivar arc_settings: ArcSettingsOperations operations :vartype arc_settings: azure.mgmt.azurestackhci.operations.ArcSettingsOperations + :ivar offers: OffersOperations operations + :vartype offers: azure.mgmt.azurestackhci.operations.OffersOperations :ivar clusters: ClustersOperations operations :vartype clusters: azure.mgmt.azurestackhci.operations.ClustersOperations :ivar deployment_settings: DeploymentSettingsOperations operations :vartype deployment_settings: azure.mgmt.azurestackhci.operations.DeploymentSettingsOperations + :ivar edge_device_jobs: EdgeDeviceJobsOperations operations + :vartype edge_device_jobs: azure.mgmt.azurestackhci.operations.EdgeDeviceJobsOperations :ivar edge_devices: EdgeDevicesOperations operations :vartype edge_devices: azure.mgmt.azurestackhci.operations.EdgeDevicesOperations :ivar extensions: ExtensionsOperations operations :vartype extensions: azure.mgmt.azurestackhci.operations.ExtensionsOperations - :ivar offers: OffersOperations operations - :vartype offers: azure.mgmt.azurestackhci.operations.OffersOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.azurestackhci.operations.Operations :ivar publishers: PublishersOperations operations :vartype publishers: azure.mgmt.azurestackhci.operations.PublishersOperations :ivar security_settings: SecuritySettingsOperations operations @@ -64,18 +84,31 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :vartype skus: azure.mgmt.azurestackhci.operations.SkusOperations :ivar update_runs: UpdateRunsOperations operations :vartype update_runs: azure.mgmt.azurestackhci.operations.UpdateRunsOperations - :ivar update_summaries: UpdateSummariesOperations operations - :vartype update_summaries: azure.mgmt.azurestackhci.operations.UpdateSummariesOperations :ivar updates: UpdatesOperations operations :vartype updates: azure.mgmt.azurestackhci.operations.UpdatesOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar validated_solution_recipes: ValidatedSolutionRecipesOperations operations + :vartype validated_solution_recipes: + azure.mgmt.azurestackhci.operations.ValidatedSolutionRecipesOperations + :ivar edge_machines: EdgeMachinesOperations operations + :vartype edge_machines: azure.mgmt.azurestackhci.operations.EdgeMachinesOperations + :ivar edge_machine_jobs: EdgeMachineJobsOperations operations + :vartype edge_machine_jobs: azure.mgmt.azurestackhci.operations.EdgeMachineJobsOperations + :ivar ownership_vouchers: OwnershipVouchersOperations operations + :vartype ownership_vouchers: azure.mgmt.azurestackhci.operations.OwnershipVouchersOperations + :ivar update_summaries: UpdateSummariesOperations operations + :vartype update_summaries: azure.mgmt.azurestackhci.operations.UpdateSummariesOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this - default value may result in unsupported behavior. + :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. Default value is + "2025-12-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. @@ -85,12 +118,26 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = AzureStackHCIClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -109,39 +156,57 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False + self.kubernetes_versions = KubernetesVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.platform_updates = PlatformUpdatesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.os_images = OsImagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.update_contents = UpdateContentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.arc_settings = ArcSettingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.offers = OffersOperations(self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.deployment_settings = DeploymentSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.edge_device_jobs = EdgeDeviceJobsOperations(self._client, self._config, self._serialize, self._deserialize) self.edge_devices = EdgeDevicesOperations(self._client, self._config, self._serialize, self._deserialize) self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.offers = OffersOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) self.security_settings = SecuritySettingsOperations( self._client, self._config, self._serialize, self._deserialize ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) self.update_runs = UpdateRunsOperations(self._client, self._config, self._serialize, self._deserialize) + self.updates = UpdatesOperations(self._client, self._config, self._serialize, self._deserialize) + self.validated_solution_recipes = ValidatedSolutionRecipesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.edge_machines = EdgeMachinesOperations(self._client, self._config, self._serialize, self._deserialize) + self.edge_machine_jobs = EdgeMachineJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.ownership_vouchers = OwnershipVouchersOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.update_summaries = UpdateSummariesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.updates = UpdatesOperations(self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = client._send_request(request) + >>> response = client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -154,7 +219,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py index 697c6b2eb7fc..7d6a1453f7df 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,27 +14,40 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class AzureStackHCIClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class AzureStackHCIClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for AzureStackHCIClient. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :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. Default value is + "2025-12-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ - def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-04-01") + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2025-12-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -43,6 +56,8 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-azurestackhci/{}".format(VERSION)) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_patch.py index 17dbc073e01b..87676c65a8f0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_patch.py @@ -1,32 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/model_base.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/model_base.py new file mode 100644 index 000000000000..83322a4e6eb8 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/model_base.py @@ -0,0 +1,1271 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null +from azure.core.rest import HttpResponse + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: # pylint: disable=too-many-nested-blocks + 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) + 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) + 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()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + 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._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + 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)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + try: + if ( + isinstance(obj, str) + and isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ): + # encoded string may be deserialized to sequence + return deserializer(obj) + except: # pylint: disable=bare-except + pass + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value) + except ValueError: + # for unknown value, return raw value + return value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + item = obj.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + return _deserialize(self._type, _serialize(item, self._format), rf=self) + + def __set__(self, obj: Model, value) -> None: + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # 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 + 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") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # 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)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if 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")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + 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 + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element(tag, prefix=None, ns=None): + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_serialization.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/serialization.py similarity index 82% rename from sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_serialization.py rename to sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/serialization.py index 8139854b97bb..45a3e44e45cb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_serialization.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_utils/serialization.py @@ -1,30 +1,12 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# 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. # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -39,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -48,11 +29,7 @@ IO, Mapping, Callable, - TypeVar, MutableMapping, - Type, - List, - Mapping, ) try: @@ -62,13 +39,13 @@ import xml.etree.ElementTree as ET import isodate # type: ignore +from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") -ModelType = TypeVar("ModelType", bound="Model") JSON = MutableMapping[str, Any] @@ -91,6 +68,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +91,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -155,6 +134,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -179,80 +163,31 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], except NameError: _long_type = int - -class UTC(datetime.tzinfo): - """Time Zone info for handling UTC""" - - def utcoffset(self, dt): - """UTF offset for UTC is 0.""" - return datetime.timedelta(0) - - def tzname(self, dt): - """Timestamp representation.""" - return "Z" - - def dst(self, dt): - """No daylight saving for UTC.""" - return datetime.timedelta(hours=1) - - -try: - from datetime import timezone as _FixedOffset # type: ignore -except ImportError: # Python 2.7 - - class _FixedOffset(datetime.tzinfo): # type: ignore - """Fixed offset in minutes east from UTC. - Copy/pasted from Python doc - :param datetime.timedelta offset: offset in timedelta format - """ - - def __init__(self, offset): - self.__offset = offset - - def utcoffset(self, dt): - return self.__offset - - def tzname(self, dt): - return str(self.__offset.total_seconds() / 3600) - - def __repr__(self): - return "".format(self.tzname(None)) - - def dst(self, dt): - return datetime.timedelta(0) - - def __getinitargs__(self): - return (self.__offset,) - - -try: - from datetime import timezone - - TZ_UTC = timezone.utc -except ImportError: - TZ_UTC = UTC() # type: ignore +TZ_UTC = datetime.timezone.utc _FLATTEN = re.compile(r"(? None: - self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + self.additional_properties: Optional[dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -300,13 +242,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -326,7 +278,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -346,12 +302,14 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,12 +338,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -395,30 +356,31 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @classmethod - def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @classmethod def from_dict( - cls: Type[ModelType], + cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, - ) -> ModelType: + ) -> Self: """Parse a dict using given key extractor return a model. By default consider key @@ -426,9 +388,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model - :raises: DeserializationError if something went wrong + :raises DeserializationError: if something went wrong + :rtype: Self """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -448,21 +412,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -501,11 +469,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -540,7 +510,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -556,17 +526,20 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict - :raises: SerializationError if serialization fails. + :raises SerializationError: if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -592,17 +565,19 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -633,7 +608,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -664,17 +640,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict - :raises: SerializationError if serialization fails. - :raises: ValueError if data is None + :raises SerializationError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -703,7 +679,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -712,11 +688,13 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :returns: The serialized URL path + :raises TypeError: if serialization fails. + :raises ValueError: if data is None """ try: output = self.serialize_data(data, data_type, **kwargs) @@ -728,21 +706,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :keyword bool skip_quote: Whether to skip quote the serialized result. - Defaults to False. :rtype: str, list - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -759,19 +736,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str - :raises: TypeError if serialization fails. - :raises: ValueError if data is None + :raises TypeError: if serialization fails. + :raises ValueError: if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -780,21 +758,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None - :raises: AttributeError if required data is None. - :raises: ValueError if data is None - :raises: SerializationError if serialization fails. + :raises AttributeError: if required data is None. + :raises ValueError: if data is None + :raises SerializationError: if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -805,12 +782,12 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -821,11 +798,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -841,23 +817,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -871,8 +850,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -882,15 +860,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. Defaults to False. :rtype: list, str + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -945,9 +921,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -971,7 +946,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -979,6 +954,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1003,7 +979,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1034,56 +1010,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1091,11 +1072,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1105,30 +1087,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: TypeError if format invalid. + :raises TypeError: if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1141,12 +1125,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str - :raises: SerializationError if format invalid. + :raises SerializationError: if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1172,13 +1157,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int - :raises: SerializationError if format invalid + :raises SerializationError: if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1186,17 +1172,17 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1211,7 +1197,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1232,17 +1220,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1279,7 +1279,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1331,22 +1331,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1354,7 +1353,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1363,9 +1362,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1385,7 +1384,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1401,27 +1400,29 @@ def __call__(self, target_obj, response_data, content_type=None): :param str target_obj: Target data type to deserialize to. :param requests.Response response_data: REST response object. :param str content_type: Swagger "produces" if available. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree :param str target_obj: Target data type to deserialize to. :param object data: Object to deserialize. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1440,13 +1441,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1476,9 +1477,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1505,6 +1505,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1516,7 +1518,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1531,10 +1533,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1552,10 +1556,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1579,24 +1585,35 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1605,15 +1622,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. - :raises: DeserializationError if deserialization fails. + :raises DeserializationError: if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1627,7 +1645,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1647,14 +1669,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1671,6 +1693,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1681,13 +1704,14 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict - :raises: TypeError if non-builtin datatype encountered. + :raises TypeError: if non-builtin datatype encountered. """ if attr is None: return None @@ -1720,11 +1744,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1732,8 +1755,9 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool - :raises: TypeError if string format is not valid. + :raises TypeError: if string format is not valid. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1743,24 +1767,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1768,6 +1791,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1781,8 +1805,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1794,6 +1817,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1804,9 +1828,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1822,8 +1846,9 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1834,8 +1859,9 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray - :raises: TypeError if string format invalid. + :raises TypeError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1849,8 +1875,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal - :raises: DeserializationError if string format invalid. + :return: Deserialized decimal + :raises DeserializationError: if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1865,8 +1892,9 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int - :raises: ValueError if string format invalid. + :raises ValueError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1877,8 +1905,9 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1887,16 +1916,16 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1910,8 +1939,9 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1924,31 +1954,32 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text try: parsed_date = email.utils.parsedate_tz(attr) # type: ignore date_obj = datetime.datetime( - *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + *parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) ) if not date_obj.tzinfo: date_obj = date_obj.astimezone(tz=TZ_UTC) except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime - :raises: DeserializationError if string format invalid. + :raises DeserializationError: if string format invalid. """ if isinstance(attr, ET.Element): attr = attr.text @@ -1976,8 +2007,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1985,8 +2015,9 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime - :raises: DeserializationError if format invalid + :raises DeserializationError: if format invalid """ if isinstance(attr, ET.Element): attr = int(attr.text) # type: ignore @@ -1996,5 +2027,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_validation.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_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/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py index 2d6bcdb50d74..ab9cf4875231 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py @@ -2,8 +2,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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.0.0b4" +VERSION = "8.0.0b5" diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/__init__.py index 923883679124..264c4c5fc7fc 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/__init__.py @@ -2,15 +2,21 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._azure_stack_hci_client import AzureStackHCIClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import AzureStackHCIClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "AzureStackHCIClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_azure_stack_hci_client.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_client.py similarity index 60% rename from sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_azure_stack_hci_client.py rename to sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_client.py index 337a69cb70e8..5ac1685b31e1 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_azure_stack_hci_client.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_client.py @@ -2,61 +2,82 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from .. import models as _models -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import AzureStackHCIClientConfiguration from .operations import ( ArcSettingsOperations, ClustersOperations, DeploymentSettingsOperations, + EdgeDeviceJobsOperations, EdgeDevicesOperations, + EdgeMachineJobsOperations, + EdgeMachinesOperations, ExtensionsOperations, + KubernetesVersionsOperations, OffersOperations, Operations, + OsImagesOperations, + OwnershipVouchersOperations, + PlatformUpdatesOperations, PublishersOperations, SecuritySettingsOperations, SkusOperations, + UpdateContentsOperations, UpdateRunsOperations, UpdateSummariesOperations, UpdatesOperations, + ValidatedSolutionRecipesOperations, ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """Azure Stack HCI management service. +class AzureStackHCIClient: # pylint: disable=too-many-instance-attributes + """Azure Stack HCI service. + :ivar kubernetes_versions: KubernetesVersionsOperations operations + :vartype kubernetes_versions: + azure.mgmt.azurestackhci.aio.operations.KubernetesVersionsOperations + :ivar platform_updates: PlatformUpdatesOperations operations + :vartype platform_updates: azure.mgmt.azurestackhci.aio.operations.PlatformUpdatesOperations + :ivar os_images: OsImagesOperations operations + :vartype os_images: azure.mgmt.azurestackhci.aio.operations.OsImagesOperations + :ivar update_contents: UpdateContentsOperations operations + :vartype update_contents: azure.mgmt.azurestackhci.aio.operations.UpdateContentsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.azurestackhci.aio.operations.Operations :ivar arc_settings: ArcSettingsOperations operations :vartype arc_settings: azure.mgmt.azurestackhci.aio.operations.ArcSettingsOperations + :ivar offers: OffersOperations operations + :vartype offers: azure.mgmt.azurestackhci.aio.operations.OffersOperations :ivar clusters: ClustersOperations operations :vartype clusters: azure.mgmt.azurestackhci.aio.operations.ClustersOperations :ivar deployment_settings: DeploymentSettingsOperations operations :vartype deployment_settings: azure.mgmt.azurestackhci.aio.operations.DeploymentSettingsOperations + :ivar edge_device_jobs: EdgeDeviceJobsOperations operations + :vartype edge_device_jobs: azure.mgmt.azurestackhci.aio.operations.EdgeDeviceJobsOperations :ivar edge_devices: EdgeDevicesOperations operations :vartype edge_devices: azure.mgmt.azurestackhci.aio.operations.EdgeDevicesOperations :ivar extensions: ExtensionsOperations operations :vartype extensions: azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations - :ivar offers: OffersOperations operations - :vartype offers: azure.mgmt.azurestackhci.aio.operations.OffersOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.azurestackhci.aio.operations.Operations :ivar publishers: PublishersOperations operations :vartype publishers: azure.mgmt.azurestackhci.aio.operations.PublishersOperations :ivar security_settings: SecuritySettingsOperations operations @@ -65,18 +86,32 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :vartype skus: azure.mgmt.azurestackhci.aio.operations.SkusOperations :ivar update_runs: UpdateRunsOperations operations :vartype update_runs: azure.mgmt.azurestackhci.aio.operations.UpdateRunsOperations - :ivar update_summaries: UpdateSummariesOperations operations - :vartype update_summaries: azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations :ivar updates: UpdatesOperations operations :vartype updates: azure.mgmt.azurestackhci.aio.operations.UpdatesOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar validated_solution_recipes: ValidatedSolutionRecipesOperations operations + :vartype validated_solution_recipes: + azure.mgmt.azurestackhci.aio.operations.ValidatedSolutionRecipesOperations + :ivar edge_machines: EdgeMachinesOperations operations + :vartype edge_machines: azure.mgmt.azurestackhci.aio.operations.EdgeMachinesOperations + :ivar edge_machine_jobs: EdgeMachineJobsOperations operations + :vartype edge_machine_jobs: azure.mgmt.azurestackhci.aio.operations.EdgeMachineJobsOperations + :ivar ownership_vouchers: OwnershipVouchersOperations operations + :vartype ownership_vouchers: + azure.mgmt.azurestackhci.aio.operations.OwnershipVouchersOperations + :ivar update_summaries: UpdateSummariesOperations operations + :vartype update_summaries: azure.mgmt.azurestackhci.aio.operations.UpdateSummariesOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this - default value may result in unsupported behavior. + :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. Default value is + "2025-12-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. @@ -86,12 +121,26 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = AzureStackHCIClientConfiguration( - credential=credential, subscription_id=subscription_id, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -110,33 +159,53 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False + self.kubernetes_versions = KubernetesVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.platform_updates = PlatformUpdatesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.os_images = OsImagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.update_contents = UpdateContentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.arc_settings = ArcSettingsOperations(self._client, self._config, self._serialize, self._deserialize) + self.offers = OffersOperations(self._client, self._config, self._serialize, self._deserialize) self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.deployment_settings = DeploymentSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.edge_device_jobs = EdgeDeviceJobsOperations(self._client, self._config, self._serialize, self._deserialize) self.edge_devices = EdgeDevicesOperations(self._client, self._config, self._serialize, self._deserialize) self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.offers = OffersOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) self.security_settings = SecuritySettingsOperations( self._client, self._config, self._serialize, self._deserialize ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) self.update_runs = UpdateRunsOperations(self._client, self._config, self._serialize, self._deserialize) + self.updates = UpdatesOperations(self._client, self._config, self._serialize, self._deserialize) + self.validated_solution_recipes = ValidatedSolutionRecipesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.edge_machines = EdgeMachinesOperations(self._client, self._config, self._serialize, self._deserialize) + self.edge_machine_jobs = EdgeMachineJobsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.ownership_vouchers = OwnershipVouchersOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.update_summaries = UpdateSummariesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.updates = UpdatesOperations(self._client, self._config, self._serialize, self._deserialize) - def _send_request( + def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -144,7 +213,7 @@ def _send_request( >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client._send_request(request) + >>> response = await client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -157,7 +226,11 @@ def _send_request( """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py index 5877b8b405b6..0fcbf6d903b1 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_configuration.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,27 +14,40 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class AzureStackHCIClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class AzureStackHCIClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for AzureStackHCIClient. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this - default value may result in unsupported behavior. + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :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. Default value is + "2025-12-01-preview". Note that overriding this default value may result in unsupported + behavior. :paramtype api_version: str """ - def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-04-01") + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2025-12-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -43,6 +56,8 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-azurestackhci/{}".format(VERSION)) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_patch.py index 17dbc073e01b..87676c65a8f0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/_patch.py @@ -1,32 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level -# This file is used for handwritten extensions to the generated code. Example: -# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py index 0cfd35e48b6b..97db2a0489f3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/__init__.py @@ -2,42 +2,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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._arc_settings_operations import ArcSettingsOperations -from ._clusters_operations import ClustersOperations -from ._deployment_settings_operations import DeploymentSettingsOperations -from ._edge_devices_operations import EdgeDevicesOperations -from ._extensions_operations import ExtensionsOperations -from ._offers_operations import OffersOperations -from ._operations import Operations -from ._publishers_operations import PublishersOperations -from ._security_settings_operations import SecuritySettingsOperations -from ._skus_operations import SkusOperations -from ._update_runs_operations import UpdateRunsOperations -from ._update_summaries_operations import UpdateSummariesOperations -from ._updates_operations import UpdatesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import KubernetesVersionsOperations # type: ignore +from ._operations import PlatformUpdatesOperations # type: ignore +from ._operations import OsImagesOperations # type: ignore +from ._operations import UpdateContentsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._operations import ArcSettingsOperations # type: ignore +from ._operations import OffersOperations # type: ignore +from ._operations import ClustersOperations # type: ignore +from ._operations import DeploymentSettingsOperations # type: ignore +from ._operations import EdgeDeviceJobsOperations # type: ignore +from ._operations import EdgeDevicesOperations # type: ignore +from ._operations import ExtensionsOperations # type: ignore +from ._operations import PublishersOperations # type: ignore +from ._operations import SecuritySettingsOperations # type: ignore +from ._operations import SkusOperations # type: ignore +from ._operations import UpdateRunsOperations # type: ignore +from ._operations import UpdatesOperations # type: ignore +from ._operations import ValidatedSolutionRecipesOperations # type: ignore +from ._operations import EdgeMachinesOperations # type: ignore +from ._operations import EdgeMachineJobsOperations # type: ignore +from ._operations import OwnershipVouchersOperations # type: ignore +from ._operations import UpdateSummariesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "KubernetesVersionsOperations", + "PlatformUpdatesOperations", + "OsImagesOperations", + "UpdateContentsOperations", + "Operations", "ArcSettingsOperations", + "OffersOperations", "ClustersOperations", "DeploymentSettingsOperations", + "EdgeDeviceJobsOperations", "EdgeDevicesOperations", "ExtensionsOperations", - "OffersOperations", - "Operations", "PublishersOperations", "SecuritySettingsOperations", "SkusOperations", "UpdateRunsOperations", - "UpdateSummariesOperations", "UpdatesOperations", + "ValidatedSolutionRecipesOperations", + "EdgeMachinesOperations", + "EdgeMachineJobsOperations", + "OwnershipVouchersOperations", + "UpdateSummariesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_arc_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_arc_settings_operations.py deleted file mode 100644 index b866e388c4aa..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_arc_settings_operations.py +++ /dev/null @@ -1,980 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._arc_settings_operations import ( - build_consent_and_install_default_extensions_request, - build_create_identity_request, - build_create_request, - build_delete_request, - build_generate_password_request, - build_get_request, - build_initialize_disable_process_request, - build_list_by_cluster_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ArcSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`arc_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ArcSetting"]: - """Get ArcSetting resources of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either ArcSetting or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ArcSettingList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ArcSettingList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.ArcSetting: - """Get ArcSetting resource details of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArcSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: _models.ArcSetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: Union[_models.ArcSetting, IO[bytes]], - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Is either a ArcSetting type or a IO[bytes] type. Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting or IO[bytes] - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(arc_setting, (IOBase, bytes)): - _content = arc_setting - else: - _json = self._serialize.body(arc_setting, "ArcSetting") - - _request = build_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArcSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: _models.ArcSettingsPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: Union[_models.ArcSettingsPatch, IO[bytes]], - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Is either a - ArcSettingsPatch type or a IO[bytes] type. Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch or IO[bytes] - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(arc_setting, (IOBase, bytes)): - _content = arc_setting - else: - _json = self._serialize.body(arc_setting, "ArcSettingsPatch") - - _request = build_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArcSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete ArcSetting resource details of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def generate_password( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.PasswordCredential: - """Generate password for arc settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: PasswordCredential or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) - - _request = build_generate_password_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PasswordCredential", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_identity_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_identity_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_create_identity( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ArcIdentityResponse]: - """Create Aad identity for arc settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of AsyncLROPoller that returns either ArcIdentityResponse or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_identity_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - api_version=api_version, - 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): - deserialized = self._deserialize("ArcIdentityResponse", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ArcIdentityResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ArcIdentityResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def consent_and_install_default_extensions( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.ArcSetting: - """Add consent time for default extensions and initiate extensions installation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - _request = build_consent_and_install_default_extensions_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArcSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _initialize_disable_process_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_initialize_disable_process_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_initialize_disable_process( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Initializes ARC Disable process on the cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._initialize_disable_process_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_clusters_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_clusters_operations.py deleted file mode 100644 index 15676f3d4572..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_clusters_operations.py +++ /dev/null @@ -1,1546 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._clusters_operations import ( - build_configure_remote_support_request, - build_create_identity_request, - build_create_request, - build_delete_request, - build_extend_software_assurance_benefit_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_trigger_log_collection_request, - build_update_request, - build_upload_certificate_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ClustersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Cluster"]: - """List all HCI clusters in a subscription. - - :return: An iterator like instance of either Cluster or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Cluster"]: - """List all HCI clusters in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either Cluster or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: - """Get HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: _models.Cluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: ~azure.mgmt.azurestackhci.models.Cluster - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create( - self, resource_group_name: str, cluster_name: str, cluster: Union[_models.Cluster, IO[bytes]], **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Is either a Cluster type or a IO[bytes] type. - Required. - :type cluster: ~azure.mgmt.azurestackhci.models.Cluster or IO[bytes] - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster, (IOBase, bytes)): - _content = cluster - else: - _json = self._serialize.body(cluster, "Cluster") - - _request = build_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: _models.ClusterPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: Union[_models.ClusterPatch, IO[bytes]], - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Is either a ClusterPatch type or a IO[bytes] type. - Required. - :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch or IO[bytes] - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster, (IOBase, bytes)): - _content = cluster - else: - _json = self._serialize.body(cluster, "ClusterPatch") - - _request = build_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _upload_certificate_initial( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: Union[_models.UploadCertificateRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(upload_certificate_request, (IOBase, bytes)): - _content = upload_certificate_request - else: - _json = self._serialize.body(upload_certificate_request, "UploadCertificateRequest") - - _request = build_upload_certificate_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: _models.UploadCertificateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: Union[_models.UploadCertificateRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Is either a - UploadCertificateRequest type or a IO[bytes] type. Required. - :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._upload_certificate_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - upload_certificate_request=upload_certificate_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _create_identity_initial( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_identity_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_create_identity( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ClusterIdentityResponse]: - """Create cluster identity. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of AsyncLROPoller that returns either ClusterIdentityResponse or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_identity_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - api_version=api_version, - 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): - deserialized = self._deserialize("ClusterIdentityResponse", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ClusterIdentityResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ClusterIdentityResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _extend_software_assurance_benefit_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(software_assurance_change_request, (IOBase, bytes)): - _content = software_assurance_change_request - else: - _json = self._serialize.body(software_assurance_change_request, "SoftwareAssuranceChangeRequest") - - _request = build_extend_software_assurance_benefit_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: _models.SoftwareAssuranceChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Is either - a SoftwareAssuranceChangeRequest type or a IO[bytes] type. Required. - :type software_assurance_change_request: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._extend_software_assurance_benefit_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - software_assurance_change_request=software_assurance_change_request, - api_version=api_version, - 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): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _trigger_log_collection_initial( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: Union[_models.LogCollectionRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(log_collection_request, (IOBase, bytes)): - _content = log_collection_request - else: - _json = self._serialize.body(log_collection_request, "LogCollectionRequest") - - _request = build_trigger_log_collection_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: _models.LogCollectionRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: Union[_models.LogCollectionRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Is either a - LogCollectionRequest type or a IO[bytes] type. Required. - :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._trigger_log_collection_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - log_collection_request=log_collection_request, - api_version=api_version, - 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): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _configure_remote_support_initial( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: Union[_models.RemoteSupportRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(remote_support_request, (IOBase, bytes)): - _content = remote_support_request - else: - _json = self._serialize.body(remote_support_request, "RemoteSupportRequest") - - _request = build_configure_remote_support_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: _models.RemoteSupportRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: Union[_models.RemoteSupportRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Is either a - RemoteSupportRequest type or a IO[bytes] type. Required. - :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either Cluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._configure_remote_support_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - remote_support_request=remote_support_request, - api_version=api_version, - 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): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_deployment_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_deployment_settings_operations.py deleted file mode 100644 index e833fe03fcc5..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_deployment_settings_operations.py +++ /dev/null @@ -1,542 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._deployment_settings_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_clusters_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DeploymentSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`deployment_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DeploymentSetting"]: - """List DeploymentSetting resources by Clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either DeploymentSetting or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DeploymentSettingListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DeploymentSettingListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> _models.DeploymentSetting: - """Get a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: DeploymentSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.DeploymentSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DeploymentSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.DeploymentSetting, IO[bytes]], - deployment_settings_name: str = "default", - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "DeploymentSetting") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: _models.DeploymentSetting, - deployment_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either DeploymentSetting or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: IO[bytes], - deployment_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either DeploymentSetting or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.DeploymentSetting, IO[bytes]], - deployment_settings_name: str = "default", - **kwargs: Any - ) -> AsyncLROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Is either a DeploymentSetting type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting or IO[bytes] - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: An instance of AsyncLROPoller that returns either DeploymentSetting or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - resource=resource, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - 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): - deserialized = self._deserialize("DeploymentSetting", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DeploymentSetting].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DeploymentSetting]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_edge_devices_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_edge_devices_operations.py deleted file mode 100644 index 90afd36b683a..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_edge_devices_operations.py +++ /dev/null @@ -1,711 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._edge_devices_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_validate_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class EdgeDevicesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`edge_devices` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.EdgeDevice"]: - """List EdgeDevice resources by parent. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :return: An iterator like instance of either EdgeDevice or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.EdgeDeviceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_request( - resource_uri=resource_uri, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EdgeDeviceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> _models.EdgeDevice: - """Get a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: EdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.EdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("EdgeDevice", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_uri: str, - resource: Union[_models.EdgeDevice, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "EdgeDevice") - - _request = build_create_or_update_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_uri: str, - resource: _models.EdgeDevice, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either EdgeDevice or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_uri: str, - resource: IO[bytes], - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either EdgeDevice or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_uri: str, - resource: Union[_models.EdgeDevice, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncLROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Is either a EdgeDevice type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of AsyncLROPoller that returns either EdgeDevice or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_uri=resource_uri, - resource=resource, - edge_device_name=edge_device_name, - api_version=api_version, - 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): - deserialized = self._deserialize("EdgeDevice", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.EdgeDevice].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EdgeDevice]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _validate_initial( - self, - resource_uri: str, - validate_request: Union[_models.ValidateRequest, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(validate_request, (IOBase, bytes)): - _content = validate_request - else: - _json = self._serialize.body(validate_request, "ValidateRequest") - - _request = build_validate_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_validate( - self, - resource_uri: str, - validate_request: _models.ValidateRequest, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ValidateResponse or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_validate( - self, - resource_uri: str, - validate_request: IO[bytes], - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ValidateResponse or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_validate( - self, - resource_uri: str, - validate_request: Union[_models.ValidateRequest, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> AsyncLROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Is either a ValidateRequest type or - a IO[bytes] type. Required. - :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of AsyncLROPoller that returns either ValidateResponse or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateResponse] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._validate_initial( - resource_uri=resource_uri, - validate_request=validate_request, - edge_device_name=edge_device_name, - api_version=api_version, - 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): - deserialized = self._deserialize("ValidateResponse", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ValidateResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ValidateResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_extensions_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_extensions_operations.py deleted file mode 100644 index 079c6a6938b5..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_extensions_operations.py +++ /dev/null @@ -1,1005 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._extensions_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_arc_setting_request, - build_update_request, - build_upgrade_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ExtensionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`extensions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_arc_setting( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Extension"]: - """List all Extensions under ArcSetting resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An iterator like instance of either Extension or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExtensionList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_arc_setting_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> _models.Extension: - """Get particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :return: Extension or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Extension - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Extension", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.Extension, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(extension, (IOBase, bytes)): - _content = extension - else: - _json = self._serialize.body(extension, "Extension") - - _request = build_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: _models.Extension, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Create Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: ~azure.mgmt.azurestackhci.models.Extension - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Extension or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Create Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: 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 either Extension or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.Extension, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Create Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Is either a Extension type or - a IO[bytes] type. Required. - :type extension: ~azure.mgmt.azurestackhci.models.Extension or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Extension or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension=extension, - api_version=api_version, - 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): - deserialized = self._deserialize("Extension", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Extension].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Extension]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.ExtensionPatch, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(extension, (IOBase, bytes)): - _content = extension - else: - _json = self._serialize.body(extension, "ExtensionPatch") - - _request = build_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: _models.ExtensionPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Extension or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Extension or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.ExtensionPatch, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Is either a ExtensionPatch - type or a IO[bytes] type. Required. - :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Extension or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension=extension, - api_version=api_version, - 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): - deserialized = self._deserialize("Extension", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Extension].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Extension]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _upgrade_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(extension_upgrade_parameters, (IOBase, bytes)): - _content = extension_upgrade_parameters - else: - _json = self._serialize.body(extension_upgrade_parameters, "ExtensionUpgradeParameters") - - _request = build_upgrade_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_upgrade( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: _models.ExtensionUpgradeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_upgrade( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_upgrade( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Is either a ExtensionUpgradeParameters type or a IO[bytes] type. Required. - :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters - or IO[bytes] - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._upgrade_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension_upgrade_parameters=extension_upgrade_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_offers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_offers_operations.py deleted file mode 100644 index 3c1d6a1da3ed..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_offers_operations.py +++ /dev/null @@ -1,319 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._offers_operations import ( - build_get_request, - build_list_by_cluster_request, - build_list_by_publisher_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class OffersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`offers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_publisher( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.Offer"]: - """List Offers available for a publisher within the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: An iterator like instance of either Offer or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Offer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OfferList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_publisher_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OfferList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.Offer"]: - """List Offers available across publishers for the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: An iterator like instance of either Offer or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Offer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OfferList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OfferList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.Offer: - """Get Offer resource details within a publisher of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: Offer or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Offer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Offer] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Offer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py index 2ea57019c0d3..7fcc8914dba1 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_operations.py @@ -1,67 +1,633 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse +from azure.core import AsyncPipelineClient +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ...operations._operations import build_list_request +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_arc_settings_consent_and_install_default_extensions_request, + build_arc_settings_create_identity_request, + build_arc_settings_create_request, + build_arc_settings_delete_request, + build_arc_settings_generate_password_request, + build_arc_settings_get_request, + build_arc_settings_initialize_disable_process_request, + build_arc_settings_list_by_cluster_request, + build_arc_settings_reconcile_request, + build_arc_settings_update_request, + build_clusters_change_ring_request, + build_clusters_configure_remote_support_request, + build_clusters_create_identity_request, + build_clusters_create_request, + build_clusters_delete_request, + build_clusters_extend_software_assurance_benefit_request, + build_clusters_get_request, + build_clusters_list_by_resource_group_request, + build_clusters_list_by_subscription_request, + build_clusters_trigger_log_collection_request, + build_clusters_update_request, + build_clusters_update_secrets_locations_request, + build_clusters_upload_certificate_request, + build_deployment_settings_create_or_update_request, + build_deployment_settings_delete_request, + build_deployment_settings_get_request, + build_deployment_settings_list_by_clusters_request, + build_edge_device_jobs_create_or_update_request, + build_edge_device_jobs_delete_request, + build_edge_device_jobs_get_request, + build_edge_device_jobs_list_by_edge_device_request, + build_edge_devices_create_or_update_request, + build_edge_devices_delete_request, + build_edge_devices_get_request, + build_edge_devices_list_request, + build_edge_devices_validate_request, + build_edge_machine_jobs_create_or_update_request, + build_edge_machine_jobs_delete_request, + build_edge_machine_jobs_get_request, + build_edge_machine_jobs_list_request, + build_edge_machines_create_or_update_request, + build_edge_machines_delete_request, + build_edge_machines_get_request, + build_edge_machines_list_by_resource_group_request, + build_edge_machines_list_by_subscription_request, + build_edge_machines_update_request, + build_extensions_create_request, + build_extensions_delete_request, + build_extensions_get_request, + build_extensions_list_by_arc_setting_request, + build_extensions_update_request, + build_extensions_upgrade_request, + build_kubernetes_versions_list_by_subscription_location_resource_request, + build_offers_get_request, + build_offers_list_by_cluster_request, + build_offers_list_by_publisher_request, + build_operations_list_request, + build_os_images_get_request, + build_os_images_list_by_subscription_location_resource_request, + build_ownership_vouchers_validate_request, + build_platform_updates_get_request, + build_platform_updates_list_request, + build_publishers_get_request, + build_publishers_list_by_cluster_request, + build_security_settings_create_or_update_request, + build_security_settings_delete_request, + build_security_settings_get_request, + build_security_settings_list_by_clusters_request, + build_skus_get_request, + build_skus_list_by_offer_request, + build_update_contents_get_request, + build_update_contents_list_request, + build_update_runs_delete_request, + build_update_runs_get_request, + build_update_runs_list_request, + build_update_runs_put_request, + build_update_summaries_delete_request, + build_update_summaries_get_request, + build_update_summaries_list_request, + build_update_summaries_put_request, + build_updates_delete_request, + build_updates_get_request, + build_updates_list_request, + build_updates_post_request, + build_updates_put_request, + build_validated_solution_recipes_get_request, + build_validated_solution_recipes_list_by_subscription_location_resource_request, +) +from .._configuration import AzureStackHCIClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list -class Operations: +class KubernetesVersionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`operations` attribute. + :attr:`kubernetes_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription_location_resource( + self, location: str, **kwargs: Any + ) -> AsyncItemPaged["_models.KubernetesVersion"]: + """List all kubernetes versions. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of KubernetesVersion + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.KubernetesVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.KubernetesVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_kubernetes_versions_list_by_subscription_location_resource_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.KubernetesVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, 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 PlatformUpdatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`platform_updates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, platform_update_name: str, **kwargs: Any) -> _models.PlatformUpdate: + """Get a platform update. + + :param location: The name of the Azure region. Required. + :type location: str + :param platform_update_name: The name of the PlatformUpdate. Required. + :type platform_update_name: str + :return: PlatformUpdate. The PlatformUpdate is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.PlatformUpdate + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PlatformUpdate] = kwargs.pop("cls", None) + + _request = build_platform_updates_get_request( + location=location, + platform_update_name=platform_update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.PlatformUpdate, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.PlatformUpdate"]: + """List all platform updates. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of PlatformUpdate + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.PlatformUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PlatformUpdate]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_platform_updates_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.PlatformUpdate], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + 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 OsImagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`os_images` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, os_image_name: str, **kwargs: Any) -> _models.OsImage: + """Get a os image. + + :param location: The name of the Azure region. Required. + :type location: str + :param os_image_name: The name of the OsImage. Required. + :type os_image_name: str + :return: OsImage. The OsImage is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.OsImage + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OsImage] = kwargs.pop("cls", None) + + _request = build_os_images_get_request( + location=location, + os_image_name=os_image_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.OsImage, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription_location_resource(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.OsImage"]: + """List all os images. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of OsImage + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.OsImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OsImage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_os_images_list_by_subscription_location_resource_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.OsImage], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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 UpdateContentsOperations: """ + .. warning:: + **DO NOT** instantiate this class directly. - models = _models + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`update_contents` attribute. + """ def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def list(self, **kwargs: Any) -> _models.OperationListResult: - """List all available Microsoft.AzureStackHCI provider operations. + async def get(self, location: str, update_content_name: str, **kwargs: Any) -> _models.UpdateContent: + """Gets content for an update. - :return: OperationListResult or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.OperationListResult + :param location: The name of the Azure region. Required. + :type location: str + :param update_content_name: The name of the UpdateContent. Required. + :type update_content_name: str + :return: UpdateContent. The UpdateContent is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateContent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -70,19 +636,24 @@ async def list(self, **kwargs: Any) -> _models.OperationListResult: error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[_models.UpdateContent] = kwargs.pop("cls", None) - _request = build_list_request( - api_version=api_version, + _request = build_update_contents_get_request( + location=location, + update_content_name=update_content_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -90,13 +661,11739 @@ async def list(self, **kwargs: Any) -> _models.OperationListResult: 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OperationListResult", pipeline_response.http_response) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.UpdateContent, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.UpdateContent"]: + """List all update contents. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of UpdateContent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.UpdateContent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UpdateContent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_update_contents_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.UpdateContent], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, 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 Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ArcSettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`arc_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.ArcSetting: + """Get ArcSetting resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + + _request = build_arc_settings_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: _models.ArcSetting, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: Union[_models.ArcSetting, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Is one of the following types: ArcSetting, JSON, IO[bytes] Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting or JSON or IO[bytes] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(arc_setting, (IOBase, bytes)): + _content = arc_setting + else: + _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_arc_settings_create_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: _models.ArcSettingsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: Union[_models.ArcSettingsPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Is one of the following + types: ArcSettingsPatch, JSON, IO[bytes] Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch or JSON or IO[bytes] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(arc_setting, (IOBase, bytes)): + _content = arc_setting + else: + _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_arc_settings_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_arc_settings_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, arc_setting_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete ArcSetting resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ArcSetting"]: + """Get ArcSetting resources of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of ArcSetting + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ArcSetting]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_arc_settings_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ArcSetting], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def generate_password( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.PasswordCredential: + """Generate password for arc settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: PasswordCredential. The PasswordCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) + + _request = build_arc_settings_generate_password_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.PasswordCredential, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_identity_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_arc_settings_create_identity_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_create_identity( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ArcIdentityResponse]: + """Create Aad identity for arc settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An instance of AsyncLROPoller that returns ArcIdentityResponse. The + ArcIdentityResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ArcIdentityResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ArcIdentityResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ArcIdentityResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _reconcile_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, 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(reconcile_arc_settings_request, (IOBase, bytes)): + _content = reconcile_arc_settings_request + else: + _content = json.dumps(reconcile_arc_settings_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_arc_settings_reconcile_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: _models.ReconcileArcSettingsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: + ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Is one of the + following types: ReconcileArcSettingsRequest, JSON, IO[bytes] Required. + :type reconcile_arc_settings_request: + ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ArcSetting. The ArcSetting is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reconcile_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + reconcile_arc_settings_request=reconcile_arc_settings_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ArcSetting, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: 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.ArcSetting].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ArcSetting]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def consent_and_install_default_extensions( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.ArcSetting: + """Add consent time for default extensions and initiate extensions installation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + + _request = build_arc_settings_consent_and_install_default_extensions_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _initialize_disable_process_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_arc_settings_initialize_disable_process_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_initialize_disable_process( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Initializes ARC Disable process on the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._initialize_disable_process_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class OffersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`offers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.Offer: + """Get Offer resource details within a publisher of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: Offer. The Offer is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Offer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Offer] = kwargs.pop("cls", None) + + _request = build_offers_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Offer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_publisher( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.Offer"]: + """List Offers available for a publisher within the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Offer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Offer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_offers_list_by_publisher_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Offer], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Offer"]: + """List Offers available across publishers for the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Offer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Offer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_offers_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Offer], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ClustersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: + """Get HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + + _request = build_clusters_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Cluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: _models.Cluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: Union[_models.Cluster, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Is one of the following types: Cluster, JSON, + IO[bytes] Required. + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster or JSON or IO[bytes] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(cluster, (IOBase, bytes)): + _content = cluster + else: + _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_create_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Cluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + cluster_name: str, + cluster: _models.ClusterPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + cluster_name: str, + cluster: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + cluster_name: str, + cluster: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + cluster_name: str, + cluster: Union[_models.ClusterPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Cluster: + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Is one of the following types: ClusterPatch, JSON, + IO[bytes] Required. + :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch or JSON or IO[bytes] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(cluster, (IOBase, bytes)): + _content = cluster + else: + _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Cluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_clusters_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Cluster"]: + """List all HCI clusters in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Cluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Cluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Cluster"]: + """List all HCI clusters in a subscription. + + :return: An iterator like instance of Cluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Cluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _update_secrets_locations_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_update_secrets_locations_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: _models.SecretsLocationsChangeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Update cluster secrets locations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Update cluster secrets locations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Update cluster secrets locations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Update cluster secrets locations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Is one of the following types: + SecretsLocationsChangeRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_secrets_locations_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _upload_certificate_initial( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(upload_certificate_request, (IOBase, bytes)): + _content = upload_certificate_request + else: + _content = json.dumps(upload_certificate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_upload_certificate_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: _models.UploadCertificateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upload certificate. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upload certificate. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upload certificate. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upload certificate. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param upload_certificate_request: Upload certificate request. Is one of the following types: + UploadCertificateRequest, JSON, IO[bytes] Required. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._upload_certificate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + upload_certificate_request=upload_certificate_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _create_identity_initial( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_clusters_create_identity_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_create_identity( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ClusterIdentityResponse]: + """Create cluster identity. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An instance of AsyncLROPoller that returns ClusterIdentityResponse. The + ClusterIdentityResponse is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ClusterIdentityResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ClusterIdentityResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ClusterIdentityResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _extend_software_assurance_benefit_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(software_assurance_change_request, (IOBase, bytes)): + _content = software_assurance_change_request + else: + _content = json.dumps(software_assurance_change_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_extend_software_assurance_benefit_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: _models.SoftwareAssuranceChangeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Is one of + the following types: SoftwareAssuranceChangeRequest, JSON, IO[bytes] Required. + :type software_assurance_change_request: + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._extend_software_assurance_benefit_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + software_assurance_change_request=software_assurance_change_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _change_ring_initial( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: Union[_models.ChangeRingRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(change_ring_request, (IOBase, bytes)): + _content = change_ring_request + else: + _content = json.dumps(change_ring_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_change_ring_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_change_ring( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: _models.ChangeRingRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Changes ring of a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param change_ring_request: Change ring request payload. Required. + :type change_ring_request: ~azure.mgmt.azurestackhci.models.ChangeRingRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_ring( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Changes ring of a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param change_ring_request: Change ring request payload. Required. + :type change_ring_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_ring( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Changes ring of a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param change_ring_request: Change ring request payload. Required. + :type change_ring_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_change_ring( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: Union[_models.ChangeRingRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Changes ring of a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param change_ring_request: Change ring request payload. Is one of the following types: + ChangeRingRequest, JSON, IO[bytes] Required. + :type change_ring_request: ~azure.mgmt.azurestackhci.models.ChangeRingRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._change_ring_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + change_ring_request=change_ring_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _trigger_log_collection_initial( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(log_collection_request, (IOBase, bytes)): + _content = log_collection_request + else: + _content = json.dumps(log_collection_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_trigger_log_collection_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_trigger_log_collection( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: _models.LogCollectionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_trigger_log_collection( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_trigger_log_collection( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_trigger_log_collection( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Is one of the following + types: LogCollectionRequest, JSON, IO[bytes] Required. + :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._trigger_log_collection_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + log_collection_request=log_collection_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _configure_remote_support_initial( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(remote_support_request, (IOBase, bytes)): + _content = remote_support_request + else: + _content = json.dumps(remote_support_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_configure_remote_support_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: _models.RemoteSupportRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Is one of the + following types: RemoteSupportRequest, JSON, IO[bytes] Required. + :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._configure_remote_support_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + remote_support_request=remote_support_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DeploymentSettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`deployment_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str, **kwargs: Any + ) -> _models.DeploymentSetting: + """Get a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :return: DeploymentSetting. The DeploymentSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.DeploymentSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) + + _request = build_deployment_settings_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_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) + + _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() + else: + deserialized = _deserialize(_models.DeploymentSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_deployment_settings_create_or_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: _models.DeploymentSetting, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :param resource: Resource create parameters. Is one of the following types: DeploymentSetting, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DeploymentSetting, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DeploymentSetting].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DeploymentSetting]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_deployment_settings_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DeploymentSetting"]: + """List DeploymentSetting resources by Clusters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of DeploymentSetting + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DeploymentSetting]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_deployment_settings_list_by_clusters_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DeploymentSetting], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class EdgeDeviceJobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`edge_device_jobs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_uri: str, edge_device_name: str, jobs_name: str, **kwargs: Any + ) -> _models.EdgeDeviceJob: + """Get a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :return: EdgeDeviceJob. The EdgeDeviceJob is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) + + _request = build_edge_device_jobs_get_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_device_jobs_create_or_update_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: _models.EdgeDeviceJob, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 EdgeDeviceJob. The EdgeDeviceJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeDeviceJob, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EdgeDeviceJob].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EdgeDeviceJob]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_uri: str, edge_device_name: str, jobs_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_edge_device_jobs_delete_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_uri: str, edge_device_name: str, jobs_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_edge_device( + self, resource_uri: str, edge_device_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.EdgeDeviceJob"]: + """List EdgeDeviceJob resources by EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :return: An iterator like instance of EdgeDeviceJob + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeDeviceJob]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_device_jobs_list_by_edge_device_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.EdgeDeviceJob], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class EdgeDevicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`edge_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_uri: str, edge_device_name: str, **kwargs: Any) -> _models.EdgeDevice: + """Get a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :return: EdgeDevice. The EdgeDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) + + _request = build_edge_devices_get_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.EdgeDevice, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_uri: str, + edge_device_name: str, + resource: Union[_models.EdgeDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_devices_create_or_update_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + resource: _models.EdgeDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 EdgeDevice. The EdgeDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + resource: Union[_models.EdgeDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeDevice, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns EdgeDevice. The EdgeDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EdgeDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EdgeDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial(self, resource_uri: str, edge_device_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_edge_devices_delete_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_uri: str, edge_device_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.EdgeDevice"]: + """List EdgeDevice resources by parent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :return: An iterator like instance of EdgeDevice + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_devices_list_request( + resource_uri=resource_uri, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.EdgeDevice], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _validate_initial( + self, + resource_uri: str, + edge_device_name: str, + validate_request: Union[_models.ValidateRequest, 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(validate_request, (IOBase, bytes)): + _content = validate_request + else: + _content = json.dumps(validate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_devices_validate_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_validate( + self, + resource_uri: str, + edge_device_name: str, + validate_request: _models.ValidateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param validate_request: The content of the action request. Required. + :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate( + self, + resource_uri: str, + edge_device_name: str, + validate_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param validate_request: The content of the action request. Required. + :type validate_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate( + self, + resource_uri: str, + edge_device_name: str, + validate_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param validate_request: The content of the action request. Required. + :type validate_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_validate( + self, + resource_uri: str, + edge_device_name: str, + validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param validate_request: The content of the action request. Is one of the following types: + ValidateRequest, JSON, IO[bytes] Required. + :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateResponse] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._validate_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + validate_request=validate_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ValidateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ValidateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExtensionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`extensions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> _models.Extension: + """Get particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :return: Extension. The Extension is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Extension + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Extension] = kwargs.pop("cls", None) + + _request = build_extensions_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Extension, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.Extension, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(extension, (IOBase, bytes)): + _content = extension + else: + _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extensions_create_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: _models.Extension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: ~azure.mgmt.azurestackhci.models.Extension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.Extension, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Is one of the following + types: Extension, JSON, IO[bytes] Required. + :type extension: ~azure.mgmt.azurestackhci.models.Extension or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Extension] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Extension, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + 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.Extension].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Extension]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(extension, (IOBase, bytes)): + _content = extension + else: + _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extensions_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: _models.ExtensionPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Extension]: + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Is one of the following + types: ExtensionPatch, JSON, IO[bytes] Required. + :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.Extension] + :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.Extension] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Extension, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + 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.Extension].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Extension]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_extensions_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + 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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["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 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, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_arc_setting( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Extension"]: + """List all Extensions under ArcSetting resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An iterator like instance of Extension + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Extension]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_extensions_list_by_arc_setting_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Extension], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + 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 _upgrade_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(extension_upgrade_parameters, (IOBase, bytes)): + _content = extension_upgrade_parameters + else: + _content = json.dumps(extension_upgrade_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extensions_upgrade_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: _models.ExtensionUpgradeParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Is one of the following types: ExtensionUpgradeParameters, JSON, IO[bytes] Required. + :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._upgrade_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension_upgrade_parameters=extension_upgrade_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class PublishersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`publishers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, publisher_name: str, **kwargs: Any + ) -> _models.Publisher: + """Get Publisher resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :return: Publisher. The Publisher is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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.Publisher] = kwargs.pop("cls", None) + + _request = build_publishers_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_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) + + _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() + else: + deserialized = _deserialize(_models.Publisher, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Publisher"]: + """List Publishers available for the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Publisher + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Publisher]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_publishers_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Publisher], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SecuritySettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`security_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, security_settings_name: str, **kwargs: Any + ) -> _models.SecuritySetting: + """Get a SecuritySetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :return: SecuritySetting. The SecuritySetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.SecuritySetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.SecuritySetting] = kwargs.pop("cls", None) + + _request = build_security_settings_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_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) + + _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() + else: + deserialized = _deserialize(_models.SecuritySetting, 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, + security_settings_name: str, + resource: Union[_models.SecuritySetting, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_security_settings_create_or_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + security_settings_name: str, + resource: _models.SecuritySetting, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecuritySetting]: + """Create a security setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + security_settings_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecuritySetting]: + """Create a security setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + security_settings_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SecuritySetting]: + """Create a security setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + security_settings_name: str, + resource: Union[_models.SecuritySetting, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SecuritySetting]: + """Create a security setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :param resource: Resource create parameters. Is one of the following types: SecuritySetting, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SecuritySetting, 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.SecuritySetting].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SecuritySetting]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, cluster_name: str, security_settings_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_security_settings_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, security_settings_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a SecuritySetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SecuritySetting"]: + """List SecuritySetting resources by Clusters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of SecuritySetting + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SecuritySetting]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_settings_list_by_clusters_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.SecuritySetting], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, 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 SkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`skus` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + sku_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.Sku: + """Get SKU resource details within a offer of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :param sku_name: The name of the SKU available within HCI cluster. Required. + :type sku_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: Sku. The Sku is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Sku + :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.Sku] = kwargs.pop("cls", None) + + _request = build_skus_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + sku_name=sku_name, + subscription_id=self._config.subscription_id, + expand=expand, + 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) + + _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() + else: + deserialized = _deserialize(_models.Sku, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_offer( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.Sku"]: + """List Skus available for a offer within the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Sku + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Sku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Sku]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_skus_list_by_offer_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Sku], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class UpdateRunsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`update_runs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + ) -> _models.UpdateRun: + """Get the Update run for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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.UpdateRun] = kwargs.pop("cls", None) + + _request = build_update_runs_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + 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) + + _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() + else: + deserialized = _deserialize(_models.UpdateRun, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: _models.UpdateRun, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: Union[_models.UpdateRun, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Is one of the following + types: UpdateRun, JSON, IO[bytes] Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or JSON or IO[bytes] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(update_runs_properties, (IOBase, bytes)): + _content = update_runs_properties + else: + _content = json.dumps(update_runs_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_update_runs_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.UpdateRun, 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, update_name: str, update_run_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_update_runs_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + 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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, update_name: str, update_run_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete specified Update Run. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.UpdateRun"]: + """List all Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An iterator like instance of UpdateRun + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.UpdateRun] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UpdateRun]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_update_runs_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + 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.UpdateRun], 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 UpdatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`updates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: + """Get specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.Update] = kwargs.pop("cls", None) + + _request = build_updates_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + 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) + + _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() + else: + deserialized = _deserialize(_models.Update, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: _models.Update, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: Union[_models.Update, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Is one of the following types: + Update, JSON, IO[bytes] Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update or JSON or IO[bytes] + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Update] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(update_properties, (IOBase, bytes)): + _content = update_properties + else: + _content = json.dumps(update_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_updates_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Update, 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, update_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_updates_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, update_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Update"]: + """List all Updates. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Update + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Update] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Update]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_updates_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), 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.Update], 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 _post_initial( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_updates_post_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_post( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Apply Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._post_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ValidatedSolutionRecipesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`validated_solution_recipes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, location: str, validated_solution_recipe_name: str, **kwargs: Any + ) -> _models.ValidatedSolutionRecipe: + """Get a validated solution recipe. + + :param location: The name of the Azure region. Required. + :type location: str + :param validated_solution_recipe_name: The name of the ValidatedSolutionRecipe. Required. + :type validated_solution_recipe_name: str + :return: ValidatedSolutionRecipe. The ValidatedSolutionRecipe is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidatedSolutionRecipe] = kwargs.pop("cls", None) + + _request = build_validated_solution_recipes_get_request( + location=location, + validated_solution_recipe_name=validated_solution_recipe_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ValidatedSolutionRecipe, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription_location_resource( + self, location: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ValidatedSolutionRecipe"]: + """List all validated solution recipes. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of ValidatedSolutionRecipe + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ValidatedSolutionRecipe]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_validated_solution_recipes_list_by_subscription_location_resource_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ValidatedSolutionRecipe], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class EdgeMachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`edge_machines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def get(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) -> _models.EdgeMachine: + """Get an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :return: EdgeMachine. The EdgeMachine is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeMachine + :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.EdgeMachine] = kwargs.pop("cls", None) + + _request = build_edge_machines_get_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_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) + + _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() + else: + deserialized = _deserialize(_models.EdgeMachine, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + edge_machine_name: str, + resource: Union[_models.EdgeMachine, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_machines_create_or_update_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, + edge_machine_name: str, + resource: _models.EdgeMachine, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachine]: + """Create or update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachine + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachine]: + """Create or update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachine]: + """Create or update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + resource: Union[_models.EdgeMachine, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachine]: + """Create or update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeMachine, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachine or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeMachine, 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.EdgeMachine].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EdgeMachine]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def _update_initial( + self, + resource_group_name: str, + edge_machine_name: str, + properties: Union[_models.EdgeMachinePatch, 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(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_machines_update_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + edge_machine_name: str, + properties: _models.EdgeMachinePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachine]: + """Update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.azurestackhci.models.EdgeMachinePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + edge_machine_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachine]: + """Update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + edge_machine_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachine]: + """Update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def begin_update( + self, + resource_group_name: str, + edge_machine_name: str, + properties: Union[_models.EdgeMachinePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachine]: + """Update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param properties: The resource properties to be updated. Is one of the following types: + EdgeMachinePatch, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.azurestackhci.models.EdgeMachinePatch or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns EdgeMachine. The EdgeMachine is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + properties=properties, + 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.EdgeMachine, 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.EdgeMachine].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EdgeMachine]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "edge_machine_name"] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, edge_machine_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_edge_machines_delete_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "edge_machine_name"] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def begin_delete( + self, resource_group_name: str, edge_machine_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={"2025-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=["2025-12-01-preview"], + ) + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.EdgeMachine"]: + """List all edge machines in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of EdgeMachine + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeMachine]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_machines_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.EdgeMachine], 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 + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={"2025-12-01-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2025-12-01-preview"], + ) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.EdgeMachine"]: + """List all edge machines in a subscription. + + :return: An iterator like instance of EdgeMachine + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeMachine]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_machines_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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.EdgeMachine], 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 EdgeMachineJobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`edge_machine_jobs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def get( + self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + ) -> _models.EdgeMachineJob: + """Get a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :return: EdgeMachineJob. The EdgeMachineJob is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeMachineJob + :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.EdgeMachineJob] = kwargs.pop("cls", None) + + _request = build_edge_machine_jobs_get_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_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) + + _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() + else: + deserialized = _deserialize(_models.EdgeMachineJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + edge_machine_name: str, + jobs_name: str, + resource: Union[_models.EdgeMachineJob, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_machine_jobs_create_or_update_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, + edge_machine_name: str, + jobs_name: str, + resource: _models.EdgeMachineJob, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachineJob]: + """Create a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachineJob + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeMachineJob. The EdgeMachineJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + jobs_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachineJob]: + """Create a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 EdgeMachineJob. The EdgeMachineJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + jobs_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachineJob]: + """Create a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns EdgeMachineJob. The EdgeMachineJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + jobs_name: str, + resource: Union[_models.EdgeMachineJob, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.EdgeMachineJob]: + """Create a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeMachineJob, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachineJob or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns EdgeMachineJob. The EdgeMachineJob is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeMachineJob] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeMachineJob, 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.EdgeMachineJob].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EdgeMachineJob]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_edge_machine_jobs_delete_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_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) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def begin_delete( + self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def list( + self, resource_group_name: str, edge_machine_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.EdgeMachineJob"]: + """List EdgeMachineJob resources by EdgeMachines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :return: An iterator like instance of EdgeMachineJob + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeMachineJob]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_machine_jobs_list_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_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) + + 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.EdgeMachineJob], 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 OwnershipVouchersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`ownership_vouchers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def validate( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidateOwnershipVouchersRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidateOwnershipVouchersResponse: + """Validates ownership vouchers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Ownership vouchers to be validated. Required. + :type validation_request: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate( + self, + resource_group_name: str, + location: str, + validation_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidateOwnershipVouchersResponse: + """Validates ownership vouchers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Ownership vouchers to be validated. Required. + :type validation_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate( + self, + resource_group_name: str, + location: str, + validation_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidateOwnershipVouchersResponse: + """Validates ownership vouchers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Ownership vouchers to be validated. Required. + :type validation_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "location", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + async def validate( + self, + resource_group_name: str, + location: str, + validation_request: Union[_models.ValidateOwnershipVouchersRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ValidateOwnershipVouchersResponse: + """Validates ownership vouchers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Ownership vouchers to be validated. Is one of the following types: + ValidateOwnershipVouchersRequest, JSON, IO[bytes] Required. + :type validation_request: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest or + JSON or IO[bytes] + :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateOwnershipVouchersResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(validation_request, (IOBase, bytes)): + _content = validation_request + else: + _content = json.dumps(validation_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ownership_vouchers_validate_request( + resource_group_name=resource_group_name, + location=location, + 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) + + _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() + else: + deserialized = _deserialize(_models.ValidateOwnershipVouchersResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class UpdateSummariesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`update_summaries` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.UpdateSummaries: + """Get all Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :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.UpdateSummaries] = kwargs.pop("cls", None) + + _request = build_update_summaries_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) + + _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() + else: + deserialized = _deserialize(_models.UpdateSummaries, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: _models.UpdateSummaries, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: Union[_models.UpdateSummaries, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Is one of the + following types: UpdateSummaries, JSON, IO[bytes] Required. + :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries or JSON or + IO[bytes] + :return: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(update_location_properties, (IOBase, bytes)): + _content = update_location_properties + else: + _content = json.dumps(update_location_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_update_summaries_put_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) + + _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() + else: + deserialized = _deserialize(_models.UpdateSummaries, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_update_summaries_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Delete Update Summaries. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.UpdateSummaries"]: + """List all Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of UpdateSummaries + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.UpdateSummaries] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UpdateSummaries]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_update_summaries_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), 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.UpdateSummaries], 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_publishers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_publishers_operations.py deleted file mode 100644 index 01acb51d017f..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_publishers_operations.py +++ /dev/null @@ -1,202 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._publishers_operations import build_get_request, build_list_by_cluster_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class PublishersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`publishers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.Publisher"]: - """List Publishers available for the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either Publisher or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Publisher] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PublisherList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PublisherList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, publisher_name: str, **kwargs: Any - ) -> _models.Publisher: - """Get Publisher resource details of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :return: Publisher or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Publisher - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Publisher", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_security_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_security_settings_operations.py deleted file mode 100644 index 357ed26012ab..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_security_settings_operations.py +++ /dev/null @@ -1,542 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._security_settings_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_clusters_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SecuritySettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`security_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SecuritySetting"]: - """List SecuritySetting resources by Clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either SecuritySetting or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.SecuritySetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SecuritySettingListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SecuritySettingListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any - ) -> _models.SecuritySetting: - """Get a SecuritySetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: SecuritySetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.SecuritySetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SecuritySetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.SecuritySetting, IO[bytes]], - security_settings_name: str = "default", - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "SecuritySetting") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: _models.SecuritySetting, - security_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SecuritySetting]: - """Create a security setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :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 either SecuritySetting or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: IO[bytes], - security_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SecuritySetting]: - """Create a security setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SecuritySetting or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.SecuritySetting, IO[bytes]], - security_settings_name: str = "default", - **kwargs: Any - ) -> AsyncLROPoller[_models.SecuritySetting]: - """Create a security setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Is either a SecuritySetting type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting or IO[bytes] - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: An instance of AsyncLROPoller that returns either SecuritySetting or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - resource=resource, - security_settings_name=security_settings_name, - api_version=api_version, - 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): - deserialized = self._deserialize("SecuritySetting", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.SecuritySetting].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SecuritySetting]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, security_settings_name: str = "default", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a SecuritySetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - security_settings_name=security_settings_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_skus_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_skus_operations.py deleted file mode 100644 index 1128099c6cdb..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_skus_operations.py +++ /dev/null @@ -1,235 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._skus_operations import build_get_request, build_list_by_offer_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class SkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`skus` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_offer( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.Sku"]: - """List Skus available for a offer within the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: An iterator like instance of either Sku or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Sku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SkuList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_offer_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SkuList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - sku_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.Sku: - """Get SKU resource details within a offer of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :param sku_name: The name of the SKU available within HCI cluster. Required. - :type sku_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: Sku or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Sku - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Sku] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - sku_name=sku_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Sku", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_runs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_runs_operations.py deleted file mode 100644 index ba520d13901f..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_runs_operations.py +++ /dev/null @@ -1,492 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._update_runs_operations import ( - build_delete_request, - build_get_request, - build_list_request, - build_put_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class UpdateRunsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`update_runs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> AsyncIterable["_models.UpdateRun"]: - """List all Update runs for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An iterator like instance of either UpdateRun or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.UpdateRun] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateRunList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("UpdateRunList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, update_name: str, update_run_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete specified Update Run. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - async def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: _models.UpdateRun, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateRun or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateRun or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: Union[_models.UpdateRun, IO[bytes]], - **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Is either a UpdateRun type - or a IO[bytes] type. Required. - :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or IO[bytes] - :return: UpdateRun or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_runs_properties, (IOBase, bytes)): - _content = update_runs_properties - else: - _json = self._serialize.body(update_runs_properties, "UpdateRun") - - _request = build_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateRun", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any - ) -> _models.UpdateRun: - """Get the Update run for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :return: UpdateRun or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateRun", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_summaries_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_summaries_operations.py deleted file mode 100644 index 9d60e2f18315..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_update_summaries_operations.py +++ /dev/null @@ -1,450 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._update_summaries_operations import ( - build_delete_request, - build_get_request, - build_list_request, - build_put_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class UpdateSummariesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`update_summaries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.UpdateSummaries"]: - """List all Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either UpdateSummaries or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.UpdateSummaries] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateSummariesList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("UpdateSummariesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete Update Summaries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - async def put( - self, - resource_group_name: str, - cluster_name: str, - update_location_properties: _models.UpdateSummaries, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateSummaries: - """Put Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_location_properties: Properties of the UpdateSummaries resource. Required. - :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateSummaries or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def put( - self, - resource_group_name: str, - cluster_name: str, - update_location_properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateSummaries: - """Put Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_location_properties: Properties of the UpdateSummaries resource. Required. - :type update_location_properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateSummaries or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def put( - self, - resource_group_name: str, - cluster_name: str, - update_location_properties: Union[_models.UpdateSummaries, IO[bytes]], - **kwargs: Any - ) -> _models.UpdateSummaries: - """Put Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_location_properties: Properties of the UpdateSummaries resource. Is either a - UpdateSummaries type or a IO[bytes] type. Required. - :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries or IO[bytes] - :return: UpdateSummaries or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_location_properties, (IOBase, bytes)): - _content = update_location_properties - else: - _json = self._serialize.body(update_location_properties, "UpdateSummaries") - - _request = build_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateSummaries", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.UpdateSummaries: - """Get all Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: UpdateSummaries or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateSummaries", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_updates_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_updates_operations.py deleted file mode 100644 index c5274eb896d0..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_updates_operations.py +++ /dev/null @@ -1,588 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._updates_operations import ( - build_delete_request, - build_get_request, - build_list_request, - build_post_request, - build_put_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class UpdatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s - :attr:`updates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _post_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_post_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_post( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Apply Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._post_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterable["_models.Update"]: - """List all Updates. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either Update or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.Update] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("UpdateList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _delete_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, update_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - async def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: _models.Update, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Update: - """Put specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: ~azure.mgmt.azurestackhci.models.Update - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Update or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Update - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Update: - """Put specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Update or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Update - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: Union[_models.Update, IO[bytes]], - **kwargs: Any - ) -> _models.Update: - """Put specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Is either a Update type or a - IO[bytes] type. Required. - :type update_properties: ~azure.mgmt.azurestackhci.models.Update or IO[bytes] - :return: Update or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Update - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Update] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_properties, (IOBase, bytes)): - _content = update_properties - else: - _json = self._serialize.body(update_properties, "Update") - - _request = build_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Update", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: - """Get specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: Update or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Update - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Update] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Update", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py index c9830331dc2e..e42b7ef60e63 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/__init__.py @@ -2,196 +2,340 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import ArcConnectivityProperties -from ._models_py3 import ArcIdentityResponse -from ._models_py3 import ArcSetting -from ._models_py3 import ArcSettingList -from ._models_py3 import ArcSettingsPatch -from ._models_py3 import Cluster -from ._models_py3 import ClusterDesiredProperties -from ._models_py3 import ClusterIdentityResponse -from ._models_py3 import ClusterList -from ._models_py3 import ClusterNode -from ._models_py3 import ClusterPatch -from ._models_py3 import ClusterReportedProperties -from ._models_py3 import DefaultExtensionDetails -from ._models_py3 import DeploymentCluster -from ._models_py3 import DeploymentConfiguration -from ._models_py3 import DeploymentData -from ._models_py3 import DeploymentSecuritySettings -from ._models_py3 import DeploymentSetting -from ._models_py3 import DeploymentSettingAdapterPropertyOverrides -from ._models_py3 import DeploymentSettingHostNetwork -from ._models_py3 import DeploymentSettingIntents -from ._models_py3 import DeploymentSettingListResult -from ._models_py3 import DeploymentSettingStorageAdapterIPInfo -from ._models_py3 import DeploymentSettingStorageNetworks -from ._models_py3 import DeploymentSettingVirtualSwitchConfigurationOverrides -from ._models_py3 import DeploymentStep -from ._models_py3 import DeviceConfiguration -from ._models_py3 import EceActionStatus -from ._models_py3 import EceDeploymentSecrets -from ._models_py3 import EceReportedProperties -from ._models_py3 import EdgeDevice -from ._models_py3 import EdgeDeviceListResult -from ._models_py3 import EdgeDeviceProperties -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import Extension -from ._models_py3 import ExtensionInstanceView -from ._models_py3 import ExtensionInstanceViewStatus -from ._models_py3 import ExtensionList -from ._models_py3 import ExtensionPatch -from ._models_py3 import ExtensionPatchParameters -from ._models_py3 import ExtensionProfile -from ._models_py3 import ExtensionUpgradeParameters -from ._models_py3 import HciEdgeDevice -from ._models_py3 import HciEdgeDeviceAdapterPropertyOverrides -from ._models_py3 import HciEdgeDeviceArcExtension -from ._models_py3 import HciEdgeDeviceHostNetwork -from ._models_py3 import HciEdgeDeviceIntents -from ._models_py3 import HciEdgeDeviceProperties -from ._models_py3 import HciEdgeDeviceStorageAdapterIPInfo -from ._models_py3 import HciEdgeDeviceStorageNetworks -from ._models_py3 import HciEdgeDeviceVirtualSwitchConfigurationOverrides -from ._models_py3 import HciNetworkProfile -from ._models_py3 import HciNicDetail -from ._models_py3 import HciOsProfile -from ._models_py3 import HciReportedProperties -from ._models_py3 import HciValidationFailureDetail -from ._models_py3 import InfrastructureNetwork -from ._models_py3 import IpPools -from ._models_py3 import IsolatedVmAttestationConfiguration -from ._models_py3 import LogCollectionError -from ._models_py3 import LogCollectionProperties -from ._models_py3 import LogCollectionRequest -from ._models_py3 import LogCollectionRequestProperties -from ._models_py3 import LogCollectionSession -from ._models_py3 import NetworkController -from ._models_py3 import NicDetail -from ._models_py3 import Observability -from ._models_py3 import Offer -from ._models_py3 import OfferList -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import OptionalServices -from ._models_py3 import PackageVersionInfo -from ._models_py3 import PasswordCredential -from ._models_py3 import PerNodeExtensionState -from ._models_py3 import PerNodeRemoteSupportSession -from ._models_py3 import PerNodeState -from ._models_py3 import PhysicalNodes -from ._models_py3 import PrecheckResult -from ._models_py3 import PrecheckResultTags -from ._models_py3 import ProxyResource -from ._models_py3 import Publisher -from ._models_py3 import PublisherList -from ._models_py3 import QosPolicyOverrides -from ._models_py3 import RawCertificateData -from ._models_py3 import RemoteSupportNodeSettings -from ._models_py3 import RemoteSupportProperties -from ._models_py3 import RemoteSupportRequest -from ._models_py3 import RemoteSupportRequestProperties -from ._models_py3 import ReportedProperties -from ._models_py3 import Resource -from ._models_py3 import SbeCredentials -from ._models_py3 import SbeDeploymentInfo -from ._models_py3 import SbeDeploymentPackageInfo -from ._models_py3 import SbePartnerInfo -from ._models_py3 import SbePartnerProperties -from ._models_py3 import ScaleUnits -from ._models_py3 import SdnIntegration -from ._models_py3 import SecurityComplianceStatus -from ._models_py3 import SecuritySetting -from ._models_py3 import SecuritySettingListResult -from ._models_py3 import ServiceConfiguration -from ._models_py3 import Sku -from ._models_py3 import SkuList -from ._models_py3 import SkuMappings -from ._models_py3 import SoftwareAssuranceChangeRequest -from ._models_py3 import SoftwareAssuranceChangeRequestProperties -from ._models_py3 import SoftwareAssuranceProperties -from ._models_py3 import Step -from ._models_py3 import Storage -from ._models_py3 import SwitchDetail -from ._models_py3 import SwitchExtension -from ._models_py3 import SystemData -from ._models_py3 import TrackedResource -from ._models_py3 import Update -from ._models_py3 import UpdateList -from ._models_py3 import UpdatePrerequisite -from ._models_py3 import UpdateRun -from ._models_py3 import UpdateRunList -from ._models_py3 import UpdateSummaries -from ._models_py3 import UpdateSummariesList -from ._models_py3 import UploadCertificateRequest -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import ValidateRequest -from ._models_py3 import ValidateResponse +from typing import TYPE_CHECKING -from ._azure_stack_hci_client_enums import AccessLevel -from ._azure_stack_hci_client_enums import ActionType -from ._azure_stack_hci_client_enums import ArcExtensionState -from ._azure_stack_hci_client_enums import ArcSettingAggregateState -from ._azure_stack_hci_client_enums import AvailabilityType -from ._azure_stack_hci_client_enums import ClusterNodeType -from ._azure_stack_hci_client_enums import ComplianceAssignmentType -from ._azure_stack_hci_client_enums import ComplianceStatus -from ._azure_stack_hci_client_enums import ConnectivityStatus -from ._azure_stack_hci_client_enums import CreatedByType -from ._azure_stack_hci_client_enums import DeploymentMode -from ._azure_stack_hci_client_enums import DeviceKind -from ._azure_stack_hci_client_enums import DeviceState -from ._azure_stack_hci_client_enums import DiagnosticLevel -from ._azure_stack_hci_client_enums import EceSecrets -from ._azure_stack_hci_client_enums import ExtensionAggregateState -from ._azure_stack_hci_client_enums import ExtensionManagedBy -from ._azure_stack_hci_client_enums import HealthState -from ._azure_stack_hci_client_enums import ImdsAttestation -from ._azure_stack_hci_client_enums import LogCollectionJobType -from ._azure_stack_hci_client_enums import LogCollectionStatus -from ._azure_stack_hci_client_enums import ManagedServiceIdentityType -from ._azure_stack_hci_client_enums import NodeArcState -from ._azure_stack_hci_client_enums import NodeExtensionState -from ._azure_stack_hci_client_enums import OemActivation -from ._azure_stack_hci_client_enums import OperationType -from ._azure_stack_hci_client_enums import Origin -from ._azure_stack_hci_client_enums import ProvisioningState -from ._azure_stack_hci_client_enums import RebootRequirement -from ._azure_stack_hci_client_enums import RemoteSupportType -from ._azure_stack_hci_client_enums import ServiceName -from ._azure_stack_hci_client_enums import Severity -from ._azure_stack_hci_client_enums import SoftwareAssuranceIntent -from ._azure_stack_hci_client_enums import SoftwareAssuranceStatus -from ._azure_stack_hci_client_enums import State -from ._azure_stack_hci_client_enums import Status -from ._azure_stack_hci_client_enums import StatusLevelTypes -from ._azure_stack_hci_client_enums import UpdateRunPropertiesState -from ._azure_stack_hci_client_enums import UpdateSummariesPropertiesState -from ._azure_stack_hci_client_enums import WindowsServerSubscription +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + ArcConnectivityProperties, + ArcIdentityResponse, + ArcIdentityResponseProperties, + ArcSetting, + ArcSettingProperties, + ArcSettingsPatch, + ArcSettingsPatchProperties, + AssemblyInfo, + AssemblyInfoPayload, + ChangeRingRequest, + ChangeRingRequestProperties, + Cluster, + ClusterDesiredProperties, + ClusterIdentityResponse, + ClusterIdentityResponseProperties, + ClusterNode, + ClusterPatch, + ClusterPatchProperties, + ClusterProperties, + ClusterReportedProperties, + ClusterSdnProperties, + ConfidentialVmProfile, + ConfidentialVmProperties, + ContentPayload, + DefaultExtensionDetails, + DeploymentCluster, + DeploymentConfiguration, + DeploymentData, + DeploymentSecuritySettings, + DeploymentSetting, + DeploymentSettingAdapterPropertyOverrides, + DeploymentSettingHostNetwork, + DeploymentSettingIntents, + DeploymentSettingStorageAdapterIPInfo, + DeploymentSettingStorageNetworks, + DeploymentSettingVirtualSwitchConfigurationOverrides, + DeploymentSettingsProperties, + DeploymentStep, + DeviceConfiguration, + DnsZones, + DownloadOsJobProperties, + DownloadOsProfile, + DownloadRequest, + EceActionStatus, + EceDeploymentSecrets, + EceReportedProperties, + EdgeDevice, + EdgeDeviceJob, + EdgeDeviceProperties, + EdgeMachine, + EdgeMachineCollectLogJobProperties, + EdgeMachineCollectLogJobReportedProperties, + EdgeMachineJob, + EdgeMachineJobProperties, + EdgeMachineNetworkProfile, + EdgeMachineNicDetail, + EdgeMachinePatch, + EdgeMachineProperties, + EdgeMachineRemoteSupportJobProperties, + EdgeMachineRemoteSupportJobReportedProperties, + EdgeMachineRemoteSupportNodeSettings, + EdgeMachineReportedProperties, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Extension, + ExtensionInstanceView, + ExtensionInstanceViewStatus, + ExtensionParameters, + ExtensionPatch, + ExtensionPatchParameters, + ExtensionPatchProperties, + ExtensionProfile, + ExtensionProperties, + ExtensionResource, + ExtensionUpgradeParameters, + HardwareProfile, + HciCollectLogJobProperties, + HciEdgeDevice, + HciEdgeDeviceAdapterPropertyOverrides, + HciEdgeDeviceArcExtension, + HciEdgeDeviceHostNetwork, + HciEdgeDeviceIntents, + HciEdgeDeviceJob, + HciEdgeDeviceJobProperties, + HciEdgeDeviceProperties, + HciEdgeDeviceStorageAdapterIPInfo, + HciEdgeDeviceStorageNetworks, + HciEdgeDeviceVirtualSwitchConfigurationOverrides, + HciHardwareProfile, + HciNetworkProfile, + HciNicDetail, + HciOsProfile, + HciRemoteSupportJobProperties, + HciReportedProperties, + HciStorageProfile, + HciValidationFailureDetail, + IgvmStatusDetail, + InfrastructureNetwork, + IpAddressRange, + IpPools, + IsolatedVmAttestationConfiguration, + KubernetesVersion, + KubernetesVersionProperties, + LocalAvailabilityZones, + LogCollectionError, + LogCollectionJobSession, + LogCollectionProperties, + LogCollectionReportedProperties, + LogCollectionRequest, + LogCollectionRequestProperties, + LogCollectionSession, + ManagedServiceIdentity, + NetworkAdapter, + NetworkConfiguration, + NetworkController, + NicDetail, + Observability, + Offer, + OfferProperties, + OnboardingConfiguration, + Operation, + OperationDetail, + OperationDisplay, + OptionalServices, + OsImage, + OsImageProperties, + OsProfile, + OsProvisionProfile, + OwnershipVoucherDetails, + OwnershipVoucherValidationDetails, + PackageVersionInfo, + PasswordCredential, + PerNodeExtensionState, + PerNodeRemoteSupportSession, + PerNodeState, + PhysicalNodes, + PlatformPayload, + PlatformUpdate, + PlatformUpdateDetails, + PlatformUpdateProperties, + PrecheckResult, + PrecheckResultTags, + ProvisionOsJobProperties, + ProvisionOsReportedProperties, + ProvisioningDetails, + ProvisioningRequest, + ProxyResource, + Publisher, + PublisherProperties, + QosPolicyOverrides, + RawCertificateData, + ReconcileArcSettingsRequest, + ReconcileArcSettingsRequestProperties, + RemoteSupportJobNodeSettings, + RemoteSupportJobReportedProperties, + RemoteSupportNodeSettings, + RemoteSupportProperties, + RemoteSupportRequest, + RemoteSupportRequestProperties, + RemoteSupportSession, + ReportedProperties, + Resource, + SbeCredentials, + SbeDeploymentInfo, + SbeDeploymentPackageInfo, + SbePartnerInfo, + SbePartnerProperties, + ScaleUnits, + SdnIntegration, + SdnProperties, + SecretsLocationDetails, + SecretsLocationsChangeRequest, + SecurityComplianceStatus, + SecurityProperties, + SecuritySetting, + ServiceConfiguration, + SiteDetails, + Sku, + SkuMappings, + SkuProperties, + SoftwareAssuranceChangeRequest, + SoftwareAssuranceChangeRequestProperties, + SoftwareAssuranceProperties, + Step, + Storage, + StorageConfiguration, + StorageProfile, + SwitchDetail, + SwitchExtension, + SystemData, + TargetDeviceConfiguration, + TimeConfiguration, + TrackedResource, + Update, + UpdateContent, + UpdateContentProperties, + UpdatePrerequisite, + UpdateProperties, + UpdateRun, + UpdateRunProperties, + UpdateStateProperties, + UpdateSummaries, + UpdateSummariesProperties, + UploadCertificateRequest, + UserAssignedIdentity, + UserDetails, + ValidateOwnershipVouchersRequest, + ValidateOwnershipVouchersResponse, + ValidateRequest, + ValidateResponse, + ValidatedSolutionRecipe, + ValidatedSolutionRecipeCapabilities, + ValidatedSolutionRecipeCapability, + ValidatedSolutionRecipeComponent, + ValidatedSolutionRecipeComponentMetadata, + ValidatedSolutionRecipeComponentPayload, + ValidatedSolutionRecipeContent, + ValidatedSolutionRecipeInfo, + ValidatedSolutionRecipeProperties, + WebProxyConfiguration, +) + +from ._enums import ( # type: ignore + AccessLevel, + ActionType, + ArcExtensionState, + ArcSettingAggregateState, + AvailabilityType, + ClusterNodeType, + ClusterPattern, + ComplianceAssignmentType, + ComplianceStatus, + ConfidentialVmIntent, + ConfidentialVmStatus, + ConnectivityStatus, + CreatedByType, + DeploymentMode, + DeviceKind, + DeviceLogCollectionStatus, + DeviceState, + DiagnosticLevel, + DnsServerConfig, + EceSecrets, + EdgeDeviceKind, + EdgeMachineConnectivityStatus, + EdgeMachineJobType, + EdgeMachineKind, + EdgeMachineState, + ExtensionAggregateState, + ExtensionManagedBy, + HardwareClass, + HciEdgeDeviceJobType, + HealthState, + IdentityProvider, + IgvmStatus, + ImdsAttestation, + IpAssignmentType, + JobStatus, + LogCollectionJobType, + LogCollectionStatus, + ManagedServiceIdentityType, + NodeArcState, + NodeExtensionState, + OSOperationType, + OemActivation, + OnboardingResourceType, + OperationType, + Origin, + OwnerKeyType, + OwnershipVoucherValidationStatus, + ProvisioningOsType, + ProvisioningState, + RdmaCapability, + RebootRequirement, + RemoteSupportAccessLevel, + RemoteSupportType, + SdnIntegrationIntent, + SdnStatus, + SecretType, + SecretsType, + ServiceName, + Severity, + SoftwareAssuranceIntent, + SoftwareAssuranceStatus, + State, + Status, + StatusLevelTypes, + SupportStatus, + UpdateRunPropertiesState, + UpdateSummariesPropertiesState, + WindowsServerSubscription, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "ArcConnectivityProperties", "ArcIdentityResponse", + "ArcIdentityResponseProperties", "ArcSetting", - "ArcSettingList", + "ArcSettingProperties", "ArcSettingsPatch", + "ArcSettingsPatchProperties", + "AssemblyInfo", + "AssemblyInfoPayload", + "ChangeRingRequest", + "ChangeRingRequestProperties", "Cluster", "ClusterDesiredProperties", "ClusterIdentityResponse", - "ClusterList", + "ClusterIdentityResponseProperties", "ClusterNode", "ClusterPatch", + "ClusterPatchProperties", + "ClusterProperties", "ClusterReportedProperties", + "ClusterSdnProperties", + "ConfidentialVmProfile", + "ConfidentialVmProperties", + "ContentPayload", "DefaultExtensionDetails", "DeploymentCluster", "DeploymentConfiguration", @@ -201,77 +345,134 @@ "DeploymentSettingAdapterPropertyOverrides", "DeploymentSettingHostNetwork", "DeploymentSettingIntents", - "DeploymentSettingListResult", "DeploymentSettingStorageAdapterIPInfo", "DeploymentSettingStorageNetworks", "DeploymentSettingVirtualSwitchConfigurationOverrides", + "DeploymentSettingsProperties", "DeploymentStep", "DeviceConfiguration", + "DnsZones", + "DownloadOsJobProperties", + "DownloadOsProfile", + "DownloadRequest", "EceActionStatus", "EceDeploymentSecrets", "EceReportedProperties", "EdgeDevice", - "EdgeDeviceListResult", + "EdgeDeviceJob", "EdgeDeviceProperties", + "EdgeMachine", + "EdgeMachineCollectLogJobProperties", + "EdgeMachineCollectLogJobReportedProperties", + "EdgeMachineJob", + "EdgeMachineJobProperties", + "EdgeMachineNetworkProfile", + "EdgeMachineNicDetail", + "EdgeMachinePatch", + "EdgeMachineProperties", + "EdgeMachineRemoteSupportJobProperties", + "EdgeMachineRemoteSupportJobReportedProperties", + "EdgeMachineRemoteSupportNodeSettings", + "EdgeMachineReportedProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", "Extension", "ExtensionInstanceView", "ExtensionInstanceViewStatus", - "ExtensionList", + "ExtensionParameters", "ExtensionPatch", "ExtensionPatchParameters", + "ExtensionPatchProperties", "ExtensionProfile", + "ExtensionProperties", + "ExtensionResource", "ExtensionUpgradeParameters", + "HardwareProfile", + "HciCollectLogJobProperties", "HciEdgeDevice", "HciEdgeDeviceAdapterPropertyOverrides", "HciEdgeDeviceArcExtension", "HciEdgeDeviceHostNetwork", "HciEdgeDeviceIntents", + "HciEdgeDeviceJob", + "HciEdgeDeviceJobProperties", "HciEdgeDeviceProperties", "HciEdgeDeviceStorageAdapterIPInfo", "HciEdgeDeviceStorageNetworks", "HciEdgeDeviceVirtualSwitchConfigurationOverrides", + "HciHardwareProfile", "HciNetworkProfile", "HciNicDetail", "HciOsProfile", + "HciRemoteSupportJobProperties", "HciReportedProperties", + "HciStorageProfile", "HciValidationFailureDetail", + "IgvmStatusDetail", "InfrastructureNetwork", + "IpAddressRange", "IpPools", "IsolatedVmAttestationConfiguration", + "KubernetesVersion", + "KubernetesVersionProperties", + "LocalAvailabilityZones", "LogCollectionError", + "LogCollectionJobSession", "LogCollectionProperties", + "LogCollectionReportedProperties", "LogCollectionRequest", "LogCollectionRequestProperties", "LogCollectionSession", + "ManagedServiceIdentity", + "NetworkAdapter", + "NetworkConfiguration", "NetworkController", "NicDetail", "Observability", "Offer", - "OfferList", + "OfferProperties", + "OnboardingConfiguration", "Operation", + "OperationDetail", "OperationDisplay", - "OperationListResult", "OptionalServices", + "OsImage", + "OsImageProperties", + "OsProfile", + "OsProvisionProfile", + "OwnershipVoucherDetails", + "OwnershipVoucherValidationDetails", "PackageVersionInfo", "PasswordCredential", "PerNodeExtensionState", "PerNodeRemoteSupportSession", "PerNodeState", "PhysicalNodes", + "PlatformPayload", + "PlatformUpdate", + "PlatformUpdateDetails", + "PlatformUpdateProperties", "PrecheckResult", "PrecheckResultTags", + "ProvisionOsJobProperties", + "ProvisionOsReportedProperties", + "ProvisioningDetails", + "ProvisioningRequest", "ProxyResource", "Publisher", - "PublisherList", + "PublisherProperties", "QosPolicyOverrides", "RawCertificateData", + "ReconcileArcSettingsRequest", + "ReconcileArcSettingsRequestProperties", + "RemoteSupportJobNodeSettings", + "RemoteSupportJobReportedProperties", "RemoteSupportNodeSettings", "RemoteSupportProperties", "RemoteSupportRequest", "RemoteSupportRequestProperties", + "RemoteSupportSession", "ReportedProperties", "Resource", "SbeCredentials", @@ -281,63 +482,114 @@ "SbePartnerProperties", "ScaleUnits", "SdnIntegration", + "SdnProperties", + "SecretsLocationDetails", + "SecretsLocationsChangeRequest", "SecurityComplianceStatus", + "SecurityProperties", "SecuritySetting", - "SecuritySettingListResult", "ServiceConfiguration", + "SiteDetails", "Sku", - "SkuList", "SkuMappings", + "SkuProperties", "SoftwareAssuranceChangeRequest", "SoftwareAssuranceChangeRequestProperties", "SoftwareAssuranceProperties", "Step", "Storage", + "StorageConfiguration", + "StorageProfile", "SwitchDetail", "SwitchExtension", "SystemData", + "TargetDeviceConfiguration", + "TimeConfiguration", "TrackedResource", "Update", - "UpdateList", + "UpdateContent", + "UpdateContentProperties", "UpdatePrerequisite", + "UpdateProperties", "UpdateRun", - "UpdateRunList", + "UpdateRunProperties", + "UpdateStateProperties", "UpdateSummaries", - "UpdateSummariesList", + "UpdateSummariesProperties", "UploadCertificateRequest", "UserAssignedIdentity", + "UserDetails", + "ValidateOwnershipVouchersRequest", + "ValidateOwnershipVouchersResponse", "ValidateRequest", "ValidateResponse", + "ValidatedSolutionRecipe", + "ValidatedSolutionRecipeCapabilities", + "ValidatedSolutionRecipeCapability", + "ValidatedSolutionRecipeComponent", + "ValidatedSolutionRecipeComponentMetadata", + "ValidatedSolutionRecipeComponentPayload", + "ValidatedSolutionRecipeContent", + "ValidatedSolutionRecipeInfo", + "ValidatedSolutionRecipeProperties", + "WebProxyConfiguration", "AccessLevel", "ActionType", "ArcExtensionState", "ArcSettingAggregateState", "AvailabilityType", "ClusterNodeType", + "ClusterPattern", "ComplianceAssignmentType", "ComplianceStatus", + "ConfidentialVmIntent", + "ConfidentialVmStatus", "ConnectivityStatus", "CreatedByType", "DeploymentMode", "DeviceKind", + "DeviceLogCollectionStatus", "DeviceState", "DiagnosticLevel", + "DnsServerConfig", "EceSecrets", + "EdgeDeviceKind", + "EdgeMachineConnectivityStatus", + "EdgeMachineJobType", + "EdgeMachineKind", + "EdgeMachineState", "ExtensionAggregateState", "ExtensionManagedBy", + "HardwareClass", + "HciEdgeDeviceJobType", "HealthState", + "IdentityProvider", + "IgvmStatus", "ImdsAttestation", + "IpAssignmentType", + "JobStatus", "LogCollectionJobType", "LogCollectionStatus", "ManagedServiceIdentityType", "NodeArcState", "NodeExtensionState", + "OSOperationType", "OemActivation", + "OnboardingResourceType", "OperationType", "Origin", + "OwnerKeyType", + "OwnershipVoucherValidationStatus", + "ProvisioningOsType", "ProvisioningState", + "RdmaCapability", "RebootRequirement", + "RemoteSupportAccessLevel", "RemoteSupportType", + "SdnIntegrationIntent", + "SdnStatus", + "SecretType", + "SecretsType", "ServiceName", "Severity", "SoftwareAssuranceIntent", @@ -345,9 +597,10 @@ "State", "Status", "StatusLevelTypes", + "SupportStatus", "UpdateRunPropertiesState", "UpdateSummariesPropertiesState", "WindowsServerSubscription", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py deleted file mode 100644 index bd5c50533c82..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_azure_stack_hci_client_enums.py +++ /dev/null @@ -1,481 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from azure.core import CaseInsensitiveEnumMeta - - -class AccessLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Remote Support Access Level.""" - - DIAGNOSTICS = "Diagnostics" - DIAGNOSTICS_AND_REPAIR = "DiagnosticsAndRepair" - - -class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" - - INTERNAL = "Internal" - - -class ArcExtensionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Arc extension installation state.""" - - NOT_SPECIFIED = "NotSpecified" - """Arc extension state is not specified.""" - SUCCEEDED = "Succeeded" - """Arc extension state is Succeeded.""" - FAILED = "Failed" - """Arc extension state is Failed.""" - CANCELED = "Canceled" - """Arc extension state is Canceled.""" - ACCEPTED = "Accepted" - """Arc extension state is Accepted when extension installation triggered.""" - CREATING = "Creating" - """Arc extension is in Creating State.""" - UPDATING = "Updating" - """Arc extension is in Updating State.""" - MOVING = "Moving" - """Arc extension is in Moving State.""" - DELETING = "Deleting" - """Arc extension is in Deleting State.""" - DELETED = "Deleted" - """Arc extension is in Deleted State.""" - - -class ArcSettingAggregateState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Aggregate state of Arc agent across the nodes in this HCI cluster.""" - - NOT_SPECIFIED = "NotSpecified" - ERROR = "Error" - SUCCEEDED = "Succeeded" - CANCELED = "Canceled" - FAILED = "Failed" - CONNECTED = "Connected" - DISCONNECTED = "Disconnected" - DELETED = "Deleted" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - MOVING = "Moving" - PARTIALLY_SUCCEEDED = "PartiallySucceeded" - PARTIALLY_CONNECTED = "PartiallyConnected" - IN_PROGRESS = "InProgress" - ACCEPTED = "Accepted" - PROVISIONING = "Provisioning" - DISABLE_IN_PROGRESS = "DisableInProgress" - - -class AvailabilityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the way the update content can be downloaded.""" - - LOCAL = "Local" - ONLINE = "Online" - NOTIFY = "Notify" - - -class ClusterNodeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The node type of all the nodes of the cluster.""" - - FIRST_PARTY = "FirstParty" - THIRD_PARTY = "ThirdParty" - - -class ComplianceAssignmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represents the compliance assignment type of a resource.""" - - AUDIT = "Audit" - """Report on the state of the machine, but don't make changes.""" - APPLY_AND_AUTO_CORRECT = "ApplyAndAutoCorrect" - """Applied to the machine. If it drifts, the local service inside the machine makes a correction - at the next evaluation.""" - - -class ComplianceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Represents the compliance status of a resource.""" - - COMPLIANT = "Compliant" - """The resource is compliant""" - NON_COMPLIANT = "NonCompliant" - """The resource is non-compliant""" - PENDING = "Pending" - """The resource compliance status is pending""" - - -class ConnectivityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall connectivity status for the cluster resource.""" - - NOT_YET_REGISTERED = "NotYetRegistered" - CONNECTED = "Connected" - NOT_CONNECTED_RECENTLY = "NotConnectedRecently" - PARTIALLY_CONNECTED = "PartiallyConnected" - DISCONNECTED = "Disconnected" - NOT_SPECIFIED = "NotSpecified" - - -class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - - -class DeploymentMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The deployment mode of EnterpriseCloudEngine(ECE) action for a cluster.""" - - VALIDATE = "Validate" - """Validate ECE action deployment for a cluster.""" - DEPLOY = "Deploy" - """Deploy ECE action deployment for a cluster.""" - - -class DeviceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Edge device kind.""" - - HCI = "HCI" - """Arc-enabled edge device with HCI OS.""" - - -class DeviceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The edge device state.""" - - NOT_SPECIFIED = "NotSpecified" - """The edge device state is not specified.""" - CONNECTED = "Connected" - """The edge device state is in connected state.""" - DISCONNECTED = "Disconnected" - """The edge device state is in disconnected state.""" - REPAIRING = "Repairing" - """The edge device state is in repairing state.""" - DRAINING = "Draining" - """The edge device state is in draining state.""" - IN_MAINTENANCE = "InMaintenance" - """The edge device state is in maintenance state.""" - RESUMING = "Resuming" - """The edge device state is in resuming state.""" - PROCESSING = "Processing" - """The edge device state is in processing state.""" - - -class DiagnosticLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Desired level of diagnostic data emitted by the cluster.""" - - OFF = "Off" - BASIC = "Basic" - ENHANCED = "Enhanced" - - -class EceSecrets(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Secret names allowed for Enterprise Cloud Engine (ECE) deployment.""" - - AZURE_STACK_LCM_USER_CREDENTIAL = "AzureStackLCMUserCredential" - """AzureStackLCMUserCredential used for LCM operations for AzureStackHCI cluster.""" - DEFAULT_ARB_APPLICATION = "DefaultARBApplication" - """DefaultARBApplication used to manage Azure Arc resource bridge (ARB) for AzureStackHCI cluster.""" - LOCAL_ADMIN_CREDENTIAL = "LocalAdminCredential" - """LocalAdminCredential used for admin operations for AzureStackHCI cluster.""" - WITNESS_STORAGE_KEY = "WitnessStorageKey" - """WitnessStorageKey used for setting up a cloud witness for AzureStackHCI cluster.""" - - -class ExtensionAggregateState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Aggregate state of Arc Extensions across the nodes in this HCI cluster.""" - - NOT_SPECIFIED = "NotSpecified" - ERROR = "Error" - SUCCEEDED = "Succeeded" - CANCELED = "Canceled" - FAILED = "Failed" - CONNECTED = "Connected" - DISCONNECTED = "Disconnected" - DELETED = "Deleted" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - MOVING = "Moving" - PARTIALLY_SUCCEEDED = "PartiallySucceeded" - PARTIALLY_CONNECTED = "PartiallyConnected" - IN_PROGRESS = "InProgress" - ACCEPTED = "Accepted" - PROVISIONING = "Provisioning" - UPGRADE_FAILED_ROLLBACK_SUCCEEDED = "UpgradeFailedRollbackSucceeded" - - -class ExtensionManagedBy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Extension managed by user or Azure.""" - - USER = "User" - AZURE = "Azure" - - -class HealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """HealthState.""" - - UNKNOWN = "Unknown" - SUCCESS = "Success" - FAILURE = "Failure" - WARNING = "Warning" - ERROR = "Error" - IN_PROGRESS = "InProgress" - - -class ImdsAttestation(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """IMDS attestation status of the cluster.""" - - DISABLED = "Disabled" - ENABLED = "Enabled" - - -class LogCollectionJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """LogCollection job type.""" - - ON_DEMAND = "OnDemand" - SCHEDULED = "Scheduled" - - -class LogCollectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """LogCollection status.""" - - NONE = "None" - IN_PROGRESS = "InProgress" - FAILED = "Failed" - SUCCEEDED = "Succeeded" - - -class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" - - -class NodeArcState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of Arc agent in this node.""" - - NOT_SPECIFIED = "NotSpecified" - ERROR = "Error" - SUCCEEDED = "Succeeded" - CANCELED = "Canceled" - FAILED = "Failed" - CONNECTED = "Connected" - DISCONNECTED = "Disconnected" - DELETED = "Deleted" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - MOVING = "Moving" - PARTIALLY_SUCCEEDED = "PartiallySucceeded" - PARTIALLY_CONNECTED = "PartiallyConnected" - IN_PROGRESS = "InProgress" - ACCEPTED = "Accepted" - PROVISIONING = "Provisioning" - DISABLE_IN_PROGRESS = "DisableInProgress" - - -class NodeExtensionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of Arc Extension in this node.""" - - NOT_SPECIFIED = "NotSpecified" - ERROR = "Error" - SUCCEEDED = "Succeeded" - CANCELED = "Canceled" - FAILED = "Failed" - CONNECTED = "Connected" - DISCONNECTED = "Disconnected" - DELETED = "Deleted" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - MOVING = "Moving" - PARTIALLY_SUCCEEDED = "PartiallySucceeded" - PARTIALLY_CONNECTED = "PartiallyConnected" - IN_PROGRESS = "InProgress" - ACCEPTED = "Accepted" - PROVISIONING = "Provisioning" - - -class OemActivation(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """OEM activation status of the cluster.""" - - DISABLED = "Disabled" - ENABLED = "Enabled" - - -class OperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The intended operation for a cluster.""" - - CLUSTER_PROVISIONING = "ClusterProvisioning" - """Cluster provisioning operation.""" - CLUSTER_UPGRADE = "ClusterUpgrade" - """Cluster upgrade operation.""" - - -class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit - logs UX. Default value is "user,system". - """ - - USER = "user" - SYSTEM = "system" - USER_SYSTEM = "user,system" - - -class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of the ArcSetting proxy resource.""" - - NOT_SPECIFIED = "NotSpecified" - ERROR = "Error" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CONNECTED = "Connected" - DISCONNECTED = "Disconnected" - DELETED = "Deleted" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - MOVING = "Moving" - PARTIALLY_SUCCEEDED = "PartiallySucceeded" - PARTIALLY_CONNECTED = "PartiallyConnected" - IN_PROGRESS = "InProgress" - ACCEPTED = "Accepted" - PROVISIONING = "Provisioning" - DISABLE_IN_PROGRESS = "DisableInProgress" - - -class RebootRequirement(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """RebootRequirement.""" - - UNKNOWN = "Unknown" - TRUE = "True" - FALSE = "False" - - -class RemoteSupportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Remote Support Type for cluster.""" - - ENABLE = "Enable" - REVOKE = "Revoke" - - -class ServiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Name of the service.""" - - WAC = "WAC" - - -class Severity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Severity of the result (Critical, Warning, Informational, Hidden). This answers how important - the result is. Critical is the only update-blocking severity. - """ - - CRITICAL = "Critical" - WARNING = "Warning" - INFORMATIONAL = "Informational" - HIDDEN = "Hidden" - - -class SoftwareAssuranceIntent(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Customer Intent for Software Assurance Benefit.""" - - ENABLE = "Enable" - DISABLE = "Disable" - - -class SoftwareAssuranceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the Software Assurance for the cluster.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - -class State(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the update as it relates to this stamp.""" - - HAS_PREREQUISITE = "HasPrerequisite" - OBSOLETE = "Obsolete" - READY = "Ready" - NOT_APPLICABLE_BECAUSE_ANOTHER_UPDATE_IS_IN_PROGRESS = "NotApplicableBecauseAnotherUpdateIsInProgress" - PREPARING = "Preparing" - INSTALLING = "Installing" - INSTALLED = "Installed" - PREPARATION_FAILED = "PreparationFailed" - INSTALLATION_FAILED = "InstallationFailed" - INVALID = "Invalid" - RECALLED = "Recalled" - DOWNLOADING = "Downloading" - DOWNLOAD_FAILED = "DownloadFailed" - HEALTH_CHECKING = "HealthChecking" - HEALTH_CHECK_FAILED = "HealthCheckFailed" - READY_TO_INSTALL = "ReadyToInstall" - SCAN_IN_PROGRESS = "ScanInProgress" - SCAN_FAILED = "ScanFailed" - ADDITIONAL_CONTENT_REQUIRED = "AdditionalContentRequired" - - -class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the cluster agent.""" - - NOT_YET_REGISTERED = "NotYetRegistered" - CONNECTED_RECENTLY = "ConnectedRecently" - NOT_CONNECTED_RECENTLY = "NotConnectedRecently" - DISCONNECTED = "Disconnected" - ERROR = "Error" - NOT_SPECIFIED = "NotSpecified" - VALIDATION_IN_PROGRESS = "ValidationInProgress" - VALIDATION_SUCCESS = "ValidationSuccess" - VALIDATION_FAILED = "ValidationFailed" - DEPLOYMENT_IN_PROGRESS = "DeploymentInProgress" - DEPLOYMENT_FAILED = "DeploymentFailed" - DEPLOYMENT_SUCCESS = "DeploymentSuccess" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - - -class StatusLevelTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The level code.""" - - INFO = "Info" - WARNING = "Warning" - ERROR = "Error" - - -class UpdateRunPropertiesState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """State of the update run.""" - - UNKNOWN = "Unknown" - SUCCEEDED = "Succeeded" - IN_PROGRESS = "InProgress" - FAILED = "Failed" - - -class UpdateSummariesPropertiesState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Overall update state of the stamp.""" - - UNKNOWN = "Unknown" - APPLIED_SUCCESSFULLY = "AppliedSuccessfully" - UPDATE_AVAILABLE = "UpdateAvailable" - UPDATE_IN_PROGRESS = "UpdateInProgress" - UPDATE_FAILED = "UpdateFailed" - NEEDS_ATTENTION = "NeedsAttention" - PREPARATION_IN_PROGRESS = "PreparationInProgress" - PREPARATION_FAILED = "PreparationFailed" - - -class WindowsServerSubscription(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Desired state of Windows Server Subscription.""" - - DISABLED = "Disabled" - ENABLED = "Enabled" diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_enums.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_enums.py new file mode 100644 index 000000000000..e97ab3157d13 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_enums.py @@ -0,0 +1,1029 @@ +# pylint: disable=too-many-lines +# 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 enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class AccessLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Remote Support Access Level.""" + + DIAGNOSTICS = "Diagnostics" + """Allows remote diagnostics operations only.""" + DIAGNOSTICS_AND_REPAIR = "DiagnosticsAndRepair" + """Allows both remote diagnostics and repair operations.""" + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal + only APIs. + """ + + INTERNAL = "Internal" + """Actions are for internal-only APIs.""" + + +class ArcExtensionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Arc extension installation state.""" + + NOT_SPECIFIED = "NotSpecified" + """Arc extension state is not specified.""" + SUCCEEDED = "Succeeded" + """Arc extension state is Succeeded.""" + FAILED = "Failed" + """Arc extension state is Failed.""" + CANCELED = "Canceled" + """Arc extension state is Canceled.""" + ACCEPTED = "Accepted" + """Arc extension state is Accepted when extension installation triggered.""" + CREATING = "Creating" + """Arc extension is in Creating State.""" + UPDATING = "Updating" + """Arc extension is in Updating State.""" + MOVING = "Moving" + """Arc extension is in Moving State.""" + DELETING = "Deleting" + """Arc extension is in Deleting State.""" + DELETED = "Deleted" + """Arc extension is in Deleted State.""" + + +class ArcSettingAggregateState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Aggregate state of Arc agent across the nodes in this HCI cluster.""" + + NOT_SPECIFIED = "NotSpecified" + """The aggregate state is not specified.""" + ERROR = "Error" + """An error occurred in the aggregate state.""" + SUCCEEDED = "Succeeded" + """The operation successfully completed across all nodes.""" + CANCELED = "Canceled" + """The operation was canceled across the nodes.""" + FAILED = "Failed" + """The operation failed on all or most nodes.""" + CONNECTED = "Connected" + """All nodes are connected.""" + DISCONNECTED = "Disconnected" + """All nodes are disconnected.""" + DELETED = "Deleted" + """The Arc agent has been deleted from all nodes.""" + CREATING = "Creating" + """The Arc agent is being created across the nodes.""" + UPDATING = "Updating" + """The Arc agent is being updated across the nodes.""" + DELETING = "Deleting" + """The Arc agent is being deleted across the nodes.""" + MOVING = "Moving" + """The Arc agent is being moved across the nodes.""" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + """The operation succeeded on some nodes.""" + PARTIALLY_CONNECTED = "PartiallyConnected" + """Some nodes are connected, others are not.""" + IN_PROGRESS = "InProgress" + """The operation is currently in progress across the nodes.""" + ACCEPTED = "Accepted" + """The operation has been accepted and is pending execution.""" + PROVISIONING = "Provisioning" + """The Arc agent is being provisioned across the nodes.""" + DISABLE_IN_PROGRESS = "DisableInProgress" + """The Arc agent is being disabled across the nodes.""" + + +class AvailabilityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates how the update content is made available for download. This determines whether the + update is sourced locally, from an online repository, or requires user notification. + """ + + LOCAL = "Local" + """The update content is available locally within the environment.""" + ONLINE = "Online" + """The update content is available from an online source.""" + NOTIFY = "Notify" + """The system will notify the user when update content becomes available.""" + + +class ClusterNodeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies the type of hardware vendor for all nodes in the cluster. Indicates whether the nodes + are provided by Microsoft or a third-party vendor. + """ + + FIRST_PARTY = "FirstParty" + """All nodes in the cluster are provided and managed by Microsoft.""" + THIRD_PARTY = "ThirdParty" + """All nodes in the cluster are provided and managed by a third-party vendor.""" + + +class ClusterPattern(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Supported Storage Pattern for HCI Cluster.""" + + STANDARD = "Standard" + """Standard cluster.""" + RACK_AWARE = "RackAware" + """RackAware cluster.""" + + +class ComplianceAssignmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the compliance assignment type of a resource.""" + + AUDIT = "Audit" + """Report on the state of the machine, but don't make changes.""" + APPLY_AND_AUTO_CORRECT = "ApplyAndAutoCorrect" + """Applied to the machine. If it drifts, the local service inside the machine makes a correction + at the next evaluation.""" + + +class ComplianceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the compliance status of a resource.""" + + COMPLIANT = "Compliant" + """The resource is compliant""" + NON_COMPLIANT = "NonCompliant" + """The resource is non-compliant""" + PENDING = "Pending" + """The resource compliance status is pending""" + + +class ConfidentialVmIntent(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Captures the customer's intent to enable or disable Confidential Virtual Machine (CVM) support + on the cluster, either during initial deployment (Day-0) or at a later stage (Day-N). + """ + + ENABLE = "Enable" + """Indicates that the customer intends to enable CVM support on the cluster.""" + DISABLE = "Disable" + """Indicates that the customer intends to disable CVM support on the cluster.""" + + +class ConfidentialVmStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Captures the current status of Confidential Virtual Machine (CVM) support on the cluster.""" + + ENABLED = "Enabled" + """CVM support is fully enabled on the cluster. All nodes are CVM capable.""" + PARTIALLY_ENABLED = "PartiallyEnabled" + """CVM support is partially enabled. At least one node in the cluster is CVM capable.""" + DISABLED = "Disabled" + """CVM support is disabled. None of the nodes in the cluster are CVM capable.""" + + +class ConnectivityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall connectivity status for the cluster resource. Indicates whether the cluster is + connected to Azure, partially connected, or has not recently communicated. + """ + + NOT_YET_REGISTERED = "NotYetRegistered" + """The cluster has not yet registered with Azure.""" + CONNECTED = "Connected" + """The cluster is fully connected to Azure.""" + NOT_CONNECTED_RECENTLY = "NotConnectedRecently" + """The cluster has not connected to Azure recently.""" + PARTIALLY_CONNECTED = "PartiallyConnected" + """Some components of the cluster are connected, while others are not.""" + DISCONNECTED = "Disconnected" + """The cluster is not connected to Azure.""" + NOT_SPECIFIED = "NotSpecified" + """The connectivity status is not specified.""" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of entity that created the resource.""" + + USER = "User" + """The entity was created by a user.""" + APPLICATION = "Application" + """The entity was created by an application.""" + MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" + KEY = "Key" + """The entity was created by a key.""" + + +class DeploymentMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Deployment mode to trigger job.""" + + VALIDATE = "Validate" + """Validate ECE action deployment for a cluster.""" + DEPLOY = "Deploy" + """Deploy ECE action deployment for a cluster.""" + + +class DeviceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Edge device kind.""" + + HCI = "HCI" + """Arc-enabled edge device with HCI OS.""" + + +class DeviceLogCollectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the status of a log collection operation.""" + + NOT_STARTED = "NotStarted" + """Log collection operation has not been initiated.""" + RUNNING = "Running" + """Indicates that the log collection operation is currently running.""" + FAILED = "Failed" + """Indicates that the log collection operation has failed.""" + SUCCEEDED = "Succeeded" + """Indicates that the log collection operation has completed successfully.""" + CANCELED = "Canceled" + """Indicates that the log collection operation has completed successfully.""" + + +class DeviceState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The edge device state.""" + + NOT_SPECIFIED = "NotSpecified" + """The edge device state is not specified.""" + CONNECTED = "Connected" + """The edge device state is in connected state.""" + DISCONNECTED = "Disconnected" + """The edge device state is in disconnected state.""" + REPAIRING = "Repairing" + """The edge device state is in repairing state.""" + DRAINING = "Draining" + """The edge device state is in draining state.""" + IN_MAINTENANCE = "InMaintenance" + """The edge device state is in maintenance state.""" + RESUMING = "Resuming" + """The edge device state is in resuming state.""" + PROCESSING = "Processing" + """The edge device state is in processing state.""" + + +class DiagnosticLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Desired level of diagnostic data emitted by the cluster.""" + + OFF = "Off" + """No diagnostic data will be emitted.""" + BASIC = "Basic" + """Basic diagnostic data will be emitted, including essential health metrics.""" + ENHANCED = "Enhanced" + """Enhanced diagnostic data will be emitted, including detailed performance and usage metrics.""" + + +class DnsServerConfig(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies how DNS servers are configured for the infrastructure network. Allowed values are + 'UseDnsServer' to use the provided DNS servers, and 'UseForwarder' to use DNS forwarders. + """ + + USE_DNS_SERVER = "UseDnsServer" + """Use the provided DNS servers for the infrastructure network.""" + USE_FORWARDER = "UseForwarder" + """Use DNS forwarders for the infrastructure network.""" + + +class EceSecrets(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Secret names allowed for Enterprise Cloud Engine (ECE) deployment.""" + + AZURE_STACK_LCM_USER_CREDENTIAL = "AzureStackLCMUserCredential" + """AzureStackLCMUserCredential used for LCM operations for AzureStackHCI cluster.""" + DEFAULT_ARB_APPLICATION = "DefaultARBApplication" + """DefaultARBApplication used to manage Azure Arc resource bridge (ARB) for AzureStackHCI cluster.""" + LOCAL_ADMIN_CREDENTIAL = "LocalAdminCredential" + """LocalAdminCredential used for admin operations for AzureStackHCI cluster.""" + WITNESS_STORAGE_KEY = "WitnessStorageKey" + """WitnessStorageKey used for setting up a cloud witness for AzureStackHCI cluster.""" + + +class EdgeDeviceKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Edge device kind.""" + + HCI = "HCI" + """Arc-enabled edge device with HCI OS.""" + + +class EdgeMachineConnectivityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall connectivity status for the machine resource.""" + + NOT_SPECIFIED = "NotSpecified" + """The connectivity status of the machine resource is not specified.""" + DISCONNECTED = "Disconnected" + """The machine resource is disconnected.""" + CONNECTED = "Connected" + """The machine resource is connected.""" + + +class EdgeMachineJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Job Type supported.""" + + COLLECT_LOG = "CollectLog" + """Job to collect logs from the device.""" + REMOTE_SUPPORT = "RemoteSupport" + """Job to provide remote support to the device.""" + PROVISION_OS = "ProvisionOs" + """Job to provision operating system in the device.""" + DOWNLOAD_OS = "DownloadOs" + """Job to download OS packages on to the device""" + + +class EdgeMachineKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Edge Machine Kind.""" + + STANDARD = "Standard" + """EdgeMachine resource created using Zero-touch provisioning.""" + DEDICATED = "Dedicated" + """EdgeMachine resource created for brownfield HCI customers without zero touch provisioning.""" + + +class EdgeMachineState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """OS State.""" + + CREATED = "Created" + """Created when EdgeMachine resource created""" + REGISTERING = "Registering" + """EdgeMachine state during device discovery and registration""" + UNPURPOSED = "Unpurposed" + """EdgeMachine state when machine configured with restricted OS and not provisioned to deploy + workloads""" + TRANSITIONING = "Transitioning" + """EdgeMachine state when transitioning from initial OS to target OS""" + PURPOSED = "Purposed" + """EdgeMachine state when machine configured with target OS to deploy workloads""" + UPDATING = "Updating" + """EdgeMachine state when OS updates are in-progress""" + RESETTING = "Resetting" + """EdgeMachine state when transitioning from target OS to restricted OS""" + FAILED = "Failed" + """EdgeMachine failed state and only option to recover is to re-provisioning machine""" + PREPARING = "Preparing" + """Preparing EdgeMachine""" + + +class ExtensionAggregateState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Aggregate state of Arc Extensions across the nodes in this HCI cluster. This reflects the + overall status of the extension deployment and operation across all nodes. + """ + + NOT_SPECIFIED = "NotSpecified" + """The aggregate state is not specified.""" + ERROR = "Error" + """An error occurred in the aggregate state.""" + SUCCEEDED = "Succeeded" + """The operation succeeded across all nodes.""" + CANCELED = "Canceled" + """The operation was canceled across the nodes.""" + FAILED = "Failed" + """The operation failed on all or most nodes.""" + CONNECTED = "Connected" + """All nodes are connected.""" + DISCONNECTED = "Disconnected" + """All nodes are disconnected.""" + DELETED = "Deleted" + """The extension has been deleted from all nodes.""" + CREATING = "Creating" + """The extension is being created across the nodes.""" + UPDATING = "Updating" + """The extension is being updated across the nodes.""" + DELETING = "Deleting" + """The extension is being deleted across the nodes.""" + MOVING = "Moving" + """The extension is being moved across the nodes.""" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + """The operation succeeded on some nodes.""" + PARTIALLY_CONNECTED = "PartiallyConnected" + """Some nodes are connected, others are not.""" + IN_PROGRESS = "InProgress" + """The operation is currently in progress across the nodes.""" + ACCEPTED = "Accepted" + """The operation has been accepted and is pending execution.""" + PROVISIONING = "Provisioning" + """The extension is currently being provisioned across the nodes.""" + UPGRADE_FAILED_ROLLBACK_SUCCEEDED = "UpgradeFailedRollbackSucceeded" + """Extension upgrade failed, but rollback succeeded across the nodes.""" + + +class ExtensionManagedBy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates whether the extension is managed by the user or by Azure.""" + + USER = "User" + """The extension is managed by the user.""" + AZURE = "Azure" + """The extension is managed by Azure.""" + + +class HardwareClass(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Hardware class of the cluster.""" + + SMALL = "Small" + """The hardware class is small.""" + MEDIUM = "Medium" + """The hardware class is medium. This corresponds to the default""" + LARGE = "Large" + """The hardware class is large.""" + + +class HciEdgeDeviceJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Job Type supported.""" + + COLLECT_LOG = "CollectLog" + """Job to collect logs from the device.""" + REMOTE_SUPPORT = "RemoteSupport" + """Job to provide remote support to the device.""" + + +class HealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall health state for update-specific health checks. Indicates whether the system is + functioning correctly, has warnings or errors, or is undergoing a health evaluation. + """ + + UNKNOWN = "Unknown" + """The health state is not known or cannot be determined.""" + SUCCESS = "Success" + """The health check completed successfully and the system is healthy.""" + FAILURE = "Failure" + """The health check failed, indicating a critical issue.""" + WARNING = "Warning" + """The health check detected a non-critical issue that may require attention.""" + ERROR = "Error" + """An error occurred during the health check process.""" + IN_PROGRESS = "InProgress" + """The health check is currently in progress.""" + + +class IdentityProvider(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Identity Provider for the cluster.""" + + ACTIVE_DIRECTORY = "ActiveDirectory" + """Uses Active Directory as the identity provider, enabling domain-based authentication and + centralized identity management. This is the default option.""" + LOCAL_IDENTITY = "LocalIdentity" + """Uses a local identity system integrated with Azure Key Vault for authentication. Suitable for + AD-less environments where Active Directory is not available or required.""" + + +class IgvmStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the IGVM support status for the device.""" + + UNKNOWN = "Unknown" + """The IGVM status could not be determined due to a query failure or inconsistent system state.""" + ENABLED = "Enabled" + """IGVM support is enabled, indicating that confidential VM features are available on this device.""" + DISABLED = "Disabled" + """IGVM status is disabled, indicating that confidential VM features are not supported on this + device.""" + + +class ImdsAttestation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IMDS attestation status of the cluster.""" + + DISABLED = "Disabled" + """IMDS attestation is disabled for the cluster.""" + ENABLED = "Enabled" + """IMDS attestation is enabled for the cluster.""" + + +class IpAssignmentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IP assignment types.""" + + AUTOMATIC = "Automatic" + """Automatic IP assignment""" + MANUAL = "Manual" + """Manual IP assignment""" + + +class JobStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the various statuses a job can have throughout its lifecycle.""" + + NOT_SPECIFIED = "NotSpecified" + """The job status has not been specified.""" + VALIDATION_IN_PROGRESS = "ValidationInProgress" + """The job is currently undergoing validation.""" + VALIDATION_SUCCESS = "ValidationSuccess" + """The job has successfully passed validation.""" + VALIDATION_FAILED = "ValidationFailed" + """The job has failed validation.""" + DEPLOYMENT_IN_PROGRESS = "DeploymentInProgress" + """The job's deployment is currently in progress.""" + DEPLOYMENT_FAILED = "DeploymentFailed" + """The job's deployment has failed.""" + DEPLOYMENT_SUCCESS = "DeploymentSuccess" + """The job has been successfully deployed.""" + SUCCEEDED = "Succeeded" + """The job has succeeded.""" + FAILED = "Failed" + """The job has failed.""" + CANCELED = "Canceled" + """The job has been canceled.""" + PAUSED = "Paused" + """The job is paused.""" + SCHEDULED = "Scheduled" + """The job is scheduled to run.""" + + +class LogCollectionJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies the type of log collection job. Determines whether the logs are collected immediately + on demand or as part of a scheduled operation. + """ + + ON_DEMAND = "OnDemand" + """Log collection is triggered manually and executed immediately.""" + SCHEDULED = "Scheduled" + """Log collection is scheduled to run at a predefined time or interval.""" + + +class LogCollectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """LogCollection status.""" + + NONE = "None" + """No log collection has been initiated.""" + IN_PROGRESS = "InProgress" + """Log collection is currently in progress.""" + FAILED = "Failed" + """Log collection has failed.""" + SUCCEEDED = "Succeeded" + """Log collection completed successfully.""" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + """No managed identity.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """System assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """System and user assigned managed identity.""" + + +class NodeArcState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of the Arc agent in this node. Indicates the current lifecycle status of the agent, such + as whether it's being provisioned, connected, updated, or has encountered an error. + """ + + NOT_SPECIFIED = "NotSpecified" + """The state is not specified.""" + ERROR = "Error" + """An error occurred during the agent's lifecycle.""" + SUCCEEDED = "Succeeded" + """The operation completed successfully.""" + CANCELED = "Canceled" + """The operation was canceled before completion.""" + FAILED = "Failed" + """The operation failed.""" + CONNECTED = "Connected" + """The Arc agent is connected on this node.""" + DISCONNECTED = "Disconnected" + """The Arc agent is disconnected on this node.""" + DELETED = "Deleted" + """The Arc agent has been deleted from this node.""" + CREATING = "Creating" + """The Arc agent is being created on this node.""" + UPDATING = "Updating" + """The Arc agent is being updated on this node.""" + DELETING = "Deleting" + """The Arc agent is being deleted from this node.""" + MOVING = "Moving" + """The Arc agent is being moved on this node.""" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + """The operation partially succeeded.""" + PARTIALLY_CONNECTED = "PartiallyConnected" + """The Arc agent is partially connected on this node.""" + IN_PROGRESS = "InProgress" + """The operation is currently in progress.""" + ACCEPTED = "Accepted" + """The operation has been accepted and is pending execution.""" + PROVISIONING = "Provisioning" + """The Arc agent is currently being provisioned on this node.""" + DISABLE_IN_PROGRESS = "DisableInProgress" + """The Arc agent is in the process of being disabled on this node.""" + + +class NodeExtensionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """State of Arc Extension in this node. Reflects the current lifecycle status of the extension on + the individual node, such as whether it's being created, updated, deleted, or has encountered + an error. + """ + + NOT_SPECIFIED = "NotSpecified" + """The state is not specified.""" + ERROR = "Error" + """An error occurred during the extension lifecycle.""" + SUCCEEDED = "Succeeded" + """The extension operation completed successfully.""" + CANCELED = "Canceled" + """The extension operation was canceled.""" + FAILED = "Failed" + """The extension operation failed.""" + CONNECTED = "Connected" + """The extension is connected on the node.""" + DISCONNECTED = "Disconnected" + """The extension is disconnected on the node.""" + DELETED = "Deleted" + """The extension has been deleted from the node.""" + CREATING = "Creating" + """The extension is being created on the node.""" + UPDATING = "Updating" + """The extension is being updated on the node.""" + DELETING = "Deleting" + """The extension is being deleted from the node.""" + MOVING = "Moving" + """The extension is being moved on the node.""" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + """The extension operation partially succeeded.""" + PARTIALLY_CONNECTED = "PartiallyConnected" + """The extension is partially connected on the node.""" + IN_PROGRESS = "InProgress" + """The extension operation is currently in progress.""" + ACCEPTED = "Accepted" + """The extension operation has been accepted and is pending execution.""" + PROVISIONING = "Provisioning" + """The extension is currently being provisioned on the node.""" + + +class OemActivation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """OEM activation status of the cluster.""" + + DISABLED = "Disabled" + """OEM activation is disabled for the cluster.""" + ENABLED = "Enabled" + """OEM activation is enabled for the cluster.""" + + +class OnboardingResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Onboarding resource type.""" + + HYBRID_COMPUTE_MACHINE = "HybridComputeMachine" + """Hybrid Compute Machine.""" + + +class OperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended operation for a cluster.""" + + CLUSTER_PROVISIONING = "ClusterProvisioning" + """Cluster provisioning operation.""" + CLUSTER_UPGRADE = "ClusterUpgrade" + """Cluster upgrade operation.""" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system". + """ + + USER = "user" + """Indicates the operation is initiated by a user.""" + SYSTEM = "system" + """Indicates the operation is initiated by a system.""" + USER_SYSTEM = "user,system" + """Indicates the operation is initiated by a user or system.""" + + +class OSOperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """OS Provision Operation type.""" + + PROVISION = "Provision" + """OS Provisioning operation""" + UPDATE = "Update" + """OS Update operation""" + RE_IMAGE = "ReImage" + """OS ReImage operation""" + + +class OwnerKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of owner key in the voucher.""" + + MICROSOFT_MANAGED = "MicrosoftManaged" + """Owner is Microsoft managed key""" + + +class OwnershipVoucherValidationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Ownership Voucher validation Status.""" + + VALID = "Valid" + """Voucher evaluated as valid.""" + INVALID = "Invalid" + """Voucher evaluated as invalid.""" + + +class ProvisioningOsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the provisioning operating system type.""" + + AZURE_LINUX = "AzureLinux" + """AzureLinux OS.""" + HCI = "HCI" + """HCI OS.""" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the ArcSetting proxy resource.""" + + NOT_SPECIFIED = "NotSpecified" + """The provisioning state is not specified.""" + ERROR = "Error" + """An error occurred during provisioning.""" + SUCCEEDED = "Succeeded" + """Provisioning completed successfully.""" + FAILED = "Failed" + """Provisioning failed.""" + CANCELED = "Canceled" + """Provisioning was canceled.""" + CONNECTED = "Connected" + """The resource is connected.""" + DISCONNECTED = "Disconnected" + """The resource is disconnected.""" + DELETED = "Deleted" + """The resource has been deleted.""" + CREATING = "Creating" + """The resource is being created.""" + UPDATING = "Updating" + """The resource is being updated.""" + DELETING = "Deleting" + """The resource is being deleted.""" + MOVING = "Moving" + """The resource is being moved.""" + PARTIALLY_SUCCEEDED = "PartiallySucceeded" + """Provisioning partially succeeded.""" + PARTIALLY_CONNECTED = "PartiallyConnected" + """The resource is partially connected.""" + IN_PROGRESS = "InProgress" + """Provisioning is in progress.""" + ACCEPTED = "Accepted" + """Provisioning request has been accepted.""" + PROVISIONING = "Provisioning" + """The resource is currently provisioning.""" + DISABLE_IN_PROGRESS = "DisableInProgress" + """The resource is being disabled.""" + + +class RdmaCapability(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes the RDMA capability of the network adapter.""" + + ENABLED = "Enabled" + """Network Adapter on the device is RDMA Capable""" + DISABLED = "Disabled" + """Network Adapter on the device is RDMA Capable""" + + +class RebootRequirement(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates whether a reboot is required after the update or operation. Helps determine if a + system restart is necessary to complete the process. + """ + + UNKNOWN = "Unknown" + """It is not known whether a reboot is required.""" + TRUE = "True" + """A reboot is required to complete the operation.""" + FALSE = "False" + """No reboot is required after the operation.""" + + +class RemoteSupportAccessLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the level of remote support access granted.""" + + NONE = "None" + """No remote support access is granted.""" + DIAGNOSTICS = "Diagnostics" + """Access is limited to diagnostics information only.""" + DIAGNOSTICS_AND_REPAIR = "DiagnosticsAndRepair" + """Access includes diagnostics information and the ability to perform repairs.""" + + +class RemoteSupportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Remote Support Type for cluster.""" + + ENABLE = "Enable" + """Enable remote support for the cluster.""" + REVOKE = "Revoke" + """Revoke previously enabled remote support for the cluster.""" + + +class SdnIntegrationIntent(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates whether Software Defined Networking (SDN) integration should be enabled or disabled + for this deployment. + """ + + ENABLE = "Enable" + """Enable SDN integration for the deployment.""" + DISABLE = "Disable" + """Disable SDN integration for the deployment.""" + + +class SdnStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the current Software Defined Networking (SDN) status of the resource, which may be an + individual device or a cluster. + """ + + UNKNOWN = "Unknown" + """The SDN status could not be determined due to a failure in querying the SDN API service. This + may occur if the query script fails or if the system is in an inconsistent state. The domain + name will be null in this case.""" + DISABLED = "Disabled" + """SDN is not enabled on the resource. The domain name will be null. This is the default state + when SDN has not been configured.""" + ENABLED = "Enabled" + """SDN is successfully enabled on the resource. The domain name will be populated in the format + ``-nc.``. Customers may need to manage DNS settings to ensure proper + resolution.""" + + +class SecretsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of secrets to store.""" + + BACKUP_SECRETS = "BackupSecrets" + """Backup secrets type""" + + +class SecretType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of secret used for authentication.""" + + KEY_VAULT = "KeyVault" + """Key Vault based authentication""" + SSH_PUB_KEY = "SshPubKey" + """SSH Public Key based authentication""" + + +class ServiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies the name of the service associated with the update or operation. This helps identify + which system component or tool is involved. + """ + + WAC = "WAC" + """Windows Admin Center (WAC) is the service associated with this operation.""" + + +class Severity(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the importance or impact level of the result. Determines whether the result is + informational, a warning, or a critical issue that may block updates. + """ + + CRITICAL = "Critical" + """A critical issue that blocks updates and requires immediate attention.""" + WARNING = "Warning" + """A warning that may indicate a potential issue but does not block updates.""" + INFORMATIONAL = "Informational" + """General information that does not indicate any issue.""" + HIDDEN = "Hidden" + """The result is hidden and not shown in the output.""" + + +class SoftwareAssuranceIntent(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Customer Intent for Software Assurance Benefit.""" + + ENABLE = "Enable" + """Customer intends to enable the Software Assurance benefit.""" + DISABLE = "Disable" + """Customer intends to disable the Software Assurance benefit.""" + + +class SoftwareAssuranceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the Software Assurance for the cluster.""" + + ENABLED = "Enabled" + """Software Assurance is enabled for the cluster.""" + DISABLED = "Disabled" + """Software Assurance is disabled for the cluster.""" + + +class State(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the current state of the update as it relates to this stamp. This includes phases + such as preparation, installation, scanning, and error handling, providing insight into the + update's progress and any issues encountered. + """ + + HAS_PREREQUISITE = "HasPrerequisite" + """The update has prerequisites that must be fulfilled before it can proceed.""" + OBSOLETE = "Obsolete" + """The update is obsolete and no longer applicable.""" + READY = "Ready" + """The update is ready to be installed.""" + NOT_APPLICABLE_BECAUSE_ANOTHER_UPDATE_IS_IN_PROGRESS = "NotApplicableBecauseAnotherUpdateIsInProgress" + """The update cannot be applied because another update is currently in progress.""" + PREPARING = "Preparing" + """The update is currently in the preparation phase.""" + INSTALLING = "Installing" + """The update is currently being installed.""" + INSTALLED = "Installed" + """The update has been successfully installed.""" + PREPARATION_FAILED = "PreparationFailed" + """The update preparation phase failed.""" + INSTALLATION_FAILED = "InstallationFailed" + """The update installation failed.""" + INVALID = "Invalid" + """The update is invalid and cannot be applied.""" + RECALLED = "Recalled" + """The update has been recalled and should not be applied.""" + DOWNLOADING = "Downloading" + """The update is currently being downloaded.""" + DOWNLOAD_FAILED = "DownloadFailed" + """The update download failed.""" + HEALTH_CHECKING = "HealthChecking" + """A health check is being performed before applying the update.""" + HEALTH_CHECK_FAILED = "HealthCheckFailed" + """The health check failed, preventing the update from proceeding.""" + READY_TO_INSTALL = "ReadyToInstall" + """The update is ready to be installed after successful preparation and checks.""" + SCAN_IN_PROGRESS = "ScanInProgress" + """The system is scanning for updates.""" + SCAN_FAILED = "ScanFailed" + """The scan for updates failed.""" + ADDITIONAL_CONTENT_REQUIRED = "AdditionalContentRequired" + """Additional content is required to proceed with the update.""" + + +class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the cluster agent. Indicates the current connectivity, validation, and deployment + state of the agent within the cluster. + """ + + NOT_YET_REGISTERED = "NotYetRegistered" + """The cluster agent has not yet registered with Azure.""" + CONNECTED_RECENTLY = "ConnectedRecently" + """The cluster agent has connected to Azure recently.""" + NOT_CONNECTED_RECENTLY = "NotConnectedRecently" + """The cluster agent has not connected to Azure recently.""" + DISCONNECTED = "Disconnected" + """The cluster agent is currently disconnected from Azure.""" + ERROR = "Error" + """An error occurred in the cluster agent's operation.""" + NOT_SPECIFIED = "NotSpecified" + """The status of the cluster agent is not specified.""" + VALIDATION_IN_PROGRESS = "ValidationInProgress" + """Validation of the cluster agent is currently in progress.""" + VALIDATION_SUCCESS = "ValidationSuccess" + """Validation of the cluster agent completed successfully.""" + VALIDATION_FAILED = "ValidationFailed" + """Validation of the cluster agent failed.""" + DEPLOYMENT_IN_PROGRESS = "DeploymentInProgress" + """Deployment of the cluster agent is currently in progress.""" + DEPLOYMENT_FAILED = "DeploymentFailed" + """Deployment of the cluster agent failed.""" + DEPLOYMENT_SUCCESS = "DeploymentSuccess" + """Deployment of the cluster agent completed successfully.""" + + +class StatusLevelTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The level code. Indicates the severity or importance of the status message.""" + + INFO = "Info" + """Informational message indicating normal operation.""" + WARNING = "Warning" + """Warning message indicating a potential issue or non-critical problem.""" + ERROR = "Error" + """Error message indicating a failure or critical issue.""" + + +class SupportStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates whether the cluster is under support.""" + + IN_SUPPORT = "InSupport" + """The cluster is under support.""" + OUT_OF_SUPPORT = "OutOfSupport" + """The cluster is out of support.""" + NOT_SPECIFIED = "NotSpecified" + """The support status is not specified.""" + + +class UpdateRunPropertiesState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the current state of the update run. Indicates whether the update is in progress, + has completed successfully, failed, or is in an unknown state. + """ + + UNKNOWN = "Unknown" + """The state of the update run is not known.""" + SUCCEEDED = "Succeeded" + """The update run completed successfully.""" + IN_PROGRESS = "InProgress" + """The update run is currently in progress.""" + FAILED = "Failed" + """The update run failed to complete successfully.""" + + +class UpdateSummariesPropertiesState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Overall update state of the stamp. Indicates the current status of update deployment across the + stamp, including preparation, application, and any issues encountered. + """ + + UNKNOWN = "Unknown" + """The update state is not known.""" + APPLIED_SUCCESSFULLY = "AppliedSuccessfully" + """Updates have been successfully applied to the stamp.""" + UPDATE_AVAILABLE = "UpdateAvailable" + """Updates are available but have not yet been applied.""" + UPDATE_IN_PROGRESS = "UpdateInProgress" + """Updates are currently being applied to the stamp.""" + UPDATE_FAILED = "UpdateFailed" + """The update process failed.""" + NEEDS_ATTENTION = "NeedsAttention" + """The update process requires user intervention or has encountered issues needing attention.""" + PREPARATION_IN_PROGRESS = "PreparationInProgress" + """Preparation for the update is currently in progress.""" + PREPARATION_FAILED = "PreparationFailed" + """Preparation for the update failed.""" + + +class WindowsServerSubscription(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Desired state of Windows Server Subscription.""" + + DISABLED = "Disabled" + """Windows Server Subscription is disabled.""" + ENABLED = "Enabled" + """Windows Server Subscription is enabled.""" diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py new file mode 100644 index 000000000000..d813b88cfa21 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models.py @@ -0,0 +1,10444 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_discriminator, rest_field +from ._enums import DeviceKind, EdgeDeviceKind, EdgeMachineJobType, HciEdgeDeviceJobType + +if TYPE_CHECKING: + from .. import models as _models + + +class ArcConnectivityProperties(_Model): + """Connectivity related configuration required by arc server. + + :ivar enabled: True indicates ARC connectivity is enabled. + :vartype enabled: bool + :ivar service_configurations: Service configurations associated with the connectivity resource. + They are only processed by the server if 'enabled' property is set to 'true'. + :vartype service_configurations: list[~azure.mgmt.azurestackhci.models.ServiceConfiguration] + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """True indicates ARC connectivity is enabled.""" + service_configurations: Optional[list["_models.ServiceConfiguration"]] = rest_field( + name="serviceConfigurations", visibility=["read", "create", "update", "delete", "query"] + ) + """Service configurations associated with the connectivity resource. They are only processed by + the server if 'enabled' property is set to 'true'.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + service_configurations: Optional[list["_models.ServiceConfiguration"]] = 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 ArcIdentityResponse(_Model): + """ArcIdentity details. + + :ivar properties: ArcIdentity properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.ArcIdentityResponseProperties + """ + + properties: Optional["_models.ArcIdentityResponseProperties"] = rest_field(visibility=["read"]) + """ArcIdentity properties.""" + + __flattened_items = [ + "arc_application_client_id", + "arc_application_tenant_id", + "arc_service_principal_object_id", + "arc_application_object_id", + ] + + +class ArcIdentityResponseProperties(_Model): + """ArcIdentityResponseProperties. + + :ivar arc_application_client_id: + :vartype arc_application_client_id: str + :ivar arc_application_tenant_id: + :vartype arc_application_tenant_id: str + :ivar arc_service_principal_object_id: + :vartype arc_service_principal_object_id: str + :ivar arc_application_object_id: + :vartype arc_application_object_id: str + """ + + arc_application_client_id: Optional[str] = rest_field( + name="arcApplicationClientId", visibility=["read", "create", "update", "delete", "query"] + ) + arc_application_tenant_id: Optional[str] = rest_field( + name="arcApplicationTenantId", visibility=["read", "create", "update", "delete", "query"] + ) + arc_service_principal_object_id: Optional[str] = rest_field( + name="arcServicePrincipalObjectId", visibility=["read", "create", "update", "delete", "query"] + ) + arc_application_object_id: Optional[str] = rest_field( + name="arcApplicationObjectId", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + arc_application_client_id: Optional[str] = None, + arc_application_tenant_id: Optional[str] = None, + arc_service_principal_object_id: Optional[str] = None, + arc_application_object_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 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.azurestackhci.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 ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + """ + + +class ArcSetting(ProxyResource): + """ArcSetting details. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: ArcSetting properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.ArcSettingProperties + """ + + properties: Optional["_models.ArcSettingProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """ArcSetting properties.""" + + __flattened_items = [ + "provisioning_state", + "arc_instance_resource_group", + "arc_application_client_id", + "arc_application_tenant_id", + "arc_service_principal_object_id", + "arc_application_object_id", + "aggregate_state", + "per_node_details", + "connectivity_properties", + "default_extensions", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ArcSettingProperties"] = 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 ArcSettingProperties(_Model): + """ArcSetting properties. + + :ivar provisioning_state: Provisioning state of the ArcSetting proxy resource. Known values + are: "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar arc_instance_resource_group: The resource group that hosts the Arc agents, ie. Hybrid + Compute Machine resources. + :vartype arc_instance_resource_group: str + :ivar arc_application_client_id: App id of arc AAD identity. + :vartype arc_application_client_id: str + :ivar arc_application_tenant_id: Tenant id of arc AAD identity. + :vartype arc_application_tenant_id: str + :ivar arc_service_principal_object_id: Object id of arc AAD service principal. + :vartype arc_service_principal_object_id: str + :ivar arc_application_object_id: Object id of arc AAD identity. + :vartype arc_application_object_id: str + :ivar aggregate_state: Aggregate state of Arc agent across the nodes in this HCI cluster. Known + values are: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", "Connected", + "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". + :vartype aggregate_state: str or ~azure.mgmt.azurestackhci.models.ArcSettingAggregateState + :ivar per_node_details: State of Arc agent in each of the nodes. + :vartype per_node_details: list[~azure.mgmt.azurestackhci.models.PerNodeState] + :ivar connectivity_properties: contains connectivity related configuration for ARC resources. + :vartype connectivity_properties: ~azure.mgmt.azurestackhci.models.ArcConnectivityProperties + :ivar default_extensions: Properties for each of the default extensions category. + :vartype default_extensions: list[~azure.mgmt.azurestackhci.models.DefaultExtensionDetails] + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the ArcSetting proxy resource. Known values are: \"NotSpecified\", + \"Error\", \"Succeeded\", \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", + \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", + \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", and + \"DisableInProgress\".""" + arc_instance_resource_group: Optional[str] = rest_field( + name="arcInstanceResourceGroup", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource group that hosts the Arc agents, ie. Hybrid Compute Machine resources.""" + arc_application_client_id: Optional[str] = rest_field( + name="arcApplicationClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """App id of arc AAD identity.""" + arc_application_tenant_id: Optional[str] = rest_field( + name="arcApplicationTenantId", visibility=["read", "create", "update", "delete", "query"] + ) + """Tenant id of arc AAD identity.""" + arc_service_principal_object_id: Optional[str] = rest_field( + name="arcServicePrincipalObjectId", visibility=["read", "create", "update", "delete", "query"] + ) + """Object id of arc AAD service principal.""" + arc_application_object_id: Optional[str] = rest_field( + name="arcApplicationObjectId", visibility=["read", "create", "update", "delete", "query"] + ) + """Object id of arc AAD identity.""" + aggregate_state: Optional[Union[str, "_models.ArcSettingAggregateState"]] = rest_field( + name="aggregateState", visibility=["read"] + ) + """Aggregate state of Arc agent across the nodes in this HCI cluster. Known values are: + \"NotSpecified\", \"Error\", \"Succeeded\", \"Canceled\", \"Failed\", \"Connected\", + \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", \"Moving\", + \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", + and \"DisableInProgress\".""" + per_node_details: Optional[list["_models.PerNodeState"]] = rest_field(name="perNodeDetails", visibility=["read"]) + """State of Arc agent in each of the nodes.""" + connectivity_properties: Optional["_models.ArcConnectivityProperties"] = rest_field( + name="connectivityProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """contains connectivity related configuration for ARC resources.""" + default_extensions: Optional[list["_models.DefaultExtensionDetails"]] = rest_field( + name="defaultExtensions", visibility=["read"] + ) + """Properties for each of the default extensions category.""" + + @overload + def __init__( + self, + *, + arc_instance_resource_group: Optional[str] = None, + arc_application_client_id: Optional[str] = None, + arc_application_tenant_id: Optional[str] = None, + arc_service_principal_object_id: Optional[str] = None, + arc_application_object_id: Optional[str] = None, + connectivity_properties: Optional["_models.ArcConnectivityProperties"] = 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 ArcSettingsPatch(_Model): + """ArcSetting details to update. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: ArcSettings properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.ArcSettingsPatchProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.ArcSettingsPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """ArcSettings properties.""" + + __flattened_items = ["connectivity_properties"] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ArcSettingsPatchProperties"] = 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 ArcSettingsPatchProperties(_Model): + """ArcSettings properties. + + :ivar connectivity_properties: contains connectivity related configuration for ARC resources. + :vartype connectivity_properties: ~azure.mgmt.azurestackhci.models.ArcConnectivityProperties + """ + + connectivity_properties: Optional["_models.ArcConnectivityProperties"] = rest_field( + name="connectivityProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """contains connectivity related configuration for ARC resources.""" + + @overload + def __init__( + self, + *, + connectivity_properties: Optional["_models.ArcConnectivityProperties"] = 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 AssemblyInfo(_Model): + """Assembly Package details for Validated Solution Recipe for AzureStackHCI Cluster. + + :ivar package_version: Assembly Package version for Validated Solution Recipe for AzureStackHCI + Cluster. + :vartype package_version: str + :ivar payload: Payload properties for Validated Solution Recipe for AzureStackHCI Cluster. + :vartype payload: list[~azure.mgmt.azurestackhci.models.AssemblyInfoPayload] + """ + + package_version: Optional[str] = rest_field(name="packageVersion", visibility=["read"]) + """Assembly Package version for Validated Solution Recipe for AzureStackHCI Cluster.""" + payload: Optional[list["_models.AssemblyInfoPayload"]] = rest_field(visibility=["read"]) + """Payload properties for Validated Solution Recipe for AzureStackHCI Cluster.""" + + +class AssemblyInfoPayload(_Model): + """Payload properties for Validated Solution Recipe for AzureStackHCI Cluster. + + :ivar identifier: assembly identifier for Validated Solution Recipe for AzureStackHCI Cluster. + :vartype identifier: str + :ivar hash: Hash of assembly package for Validated Solution Recipe for AzureStackHCI Cluster. + :vartype hash: str + :ivar file_name: File name of assembly package for Validated Solution Recipe for AzureStackHCI + Cluster. + :vartype file_name: str + :ivar url: Url of assembly package for Validated Solution Recipe for AzureStackHCI Cluster. + :vartype url: str + """ + + identifier: Optional[str] = rest_field(visibility=["read"]) + """assembly identifier for Validated Solution Recipe for AzureStackHCI Cluster.""" + hash: Optional[str] = rest_field(visibility=["read"]) + """Hash of assembly package for Validated Solution Recipe for AzureStackHCI Cluster.""" + file_name: Optional[str] = rest_field(name="fileName", visibility=["read"]) + """File name of assembly package for Validated Solution Recipe for AzureStackHCI Cluster.""" + url: Optional[str] = rest_field(visibility=["read"]) + """Url of assembly package for Validated Solution Recipe for AzureStackHCI Cluster.""" + + +class ChangeRingRequest(_Model): + """ChangeRingRequest. + + :ivar properties: + :vartype properties: ~azure.mgmt.azurestackhci.models.ChangeRingRequestProperties + """ + + properties: Optional["_models.ChangeRingRequestProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + properties: Optional["_models.ChangeRingRequestProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ChangeRingRequestProperties(_Model): + """ChangeRingRequestProperties. + + :ivar target_ring: The target ring for the cluster. + :vartype target_ring: str + """ + + target_ring: Optional[str] = rest_field( + name="targetRing", visibility=["read", "create", "update", "delete", "query"] + ) + """The target ring for the cluster.""" + + @overload + def __init__( + self, + *, + target_ring: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class 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.azurestackhci.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + 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 Cluster(TrackedResource): + """Cluster details. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Cluster properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.ClusterProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.azurestackhci.models.ManagedServiceIdentity + :ivar kind: This property identifies the purpose of the Cluster deployment. For example, a + valid value is AzureLocal. + :vartype kind: str + """ + + properties: Optional["_models.ClusterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Cluster properties.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + kind: Optional[str] = rest_field(visibility=["read", "create"]) + """This property identifies the purpose of the Cluster deployment. For example, a valid value is + AzureLocal.""" + + __flattened_items = [ + "provisioning_state", + "status", + "connectivity_status", + "support_status", + "cloud_id", + "ring", + "cloud_management_endpoint", + "aad_client_id", + "aad_tenant_id", + "aad_application_object_id", + "aad_service_principal_object_id", + "software_assurance_properties", + "is_management_cluster", + "log_collection_properties", + "remote_support_properties", + "desired_properties", + "reported_properties", + "isolated_vm_attestation_configuration", + "trial_days_remaining", + "billing_model", + "registration_timestamp", + "last_sync_timestamp", + "last_billing_timestamp", + "service_endpoint", + "resource_provider_object_id", + "secrets_locations", + "cluster_pattern", + "confidential_vm_properties", + "sdn_properties", + "local_availability_zones", + "identity_provider", + "principal_id", + "tenant_id", + "type", + "user_assigned_identities", + ] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ClusterProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + kind: 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: + _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 ClusterDesiredProperties(_Model): + """Desired properties of the cluster. + + :ivar windows_server_subscription: Desired state of Windows Server Subscription. Known values + are: "Disabled" and "Enabled". + :vartype windows_server_subscription: str or + ~azure.mgmt.azurestackhci.models.WindowsServerSubscription + :ivar diagnostic_level: Desired level of diagnostic data emitted by the cluster. Known values + are: "Off", "Basic", and "Enhanced". + :vartype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel + """ + + windows_server_subscription: Optional[Union[str, "_models.WindowsServerSubscription"]] = rest_field( + name="windowsServerSubscription", visibility=["read", "create", "update", "delete", "query"] + ) + """Desired state of Windows Server Subscription. Known values are: \"Disabled\" and \"Enabled\".""" + diagnostic_level: Optional[Union[str, "_models.DiagnosticLevel"]] = rest_field( + name="diagnosticLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """Desired level of diagnostic data emitted by the cluster. Known values are: \"Off\", \"Basic\", + and \"Enhanced\".""" + + @overload + def __init__( + self, + *, + windows_server_subscription: Optional[Union[str, "_models.WindowsServerSubscription"]] = None, + diagnostic_level: Optional[Union[str, "_models.DiagnosticLevel"]] = 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 ClusterIdentityResponse(_Model): + """Cluster Identity details. + + :ivar properties: Cluster identity properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.ClusterIdentityResponseProperties + """ + + properties: Optional["_models.ClusterIdentityResponseProperties"] = rest_field(visibility=["read"]) + """Cluster identity properties.""" + + __flattened_items = [ + "aad_client_id", + "aad_tenant_id", + "aad_service_principal_object_id", + "aad_application_object_id", + ] + + +class ClusterIdentityResponseProperties(_Model): + """ClusterIdentityResponseProperties. + + :ivar aad_client_id: + :vartype aad_client_id: str + :ivar aad_tenant_id: + :vartype aad_tenant_id: str + :ivar aad_service_principal_object_id: + :vartype aad_service_principal_object_id: str + :ivar aad_application_object_id: + :vartype aad_application_object_id: str + """ + + aad_client_id: Optional[str] = rest_field( + name="aadClientId", visibility=["read", "create", "update", "delete", "query"] + ) + aad_tenant_id: Optional[str] = rest_field( + name="aadTenantId", visibility=["read", "create", "update", "delete", "query"] + ) + aad_service_principal_object_id: Optional[str] = rest_field( + name="aadServicePrincipalObjectId", visibility=["read", "create", "update", "delete", "query"] + ) + aad_application_object_id: Optional[str] = rest_field( + name="aadApplicationObjectId", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + aad_client_id: Optional[str] = None, + aad_tenant_id: Optional[str] = None, + aad_service_principal_object_id: Optional[str] = None, + aad_application_object_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 ClusterNode(_Model): + """Cluster node details. + + :ivar name: Name of the cluster node. + :vartype name: str + :ivar id: Id of the node in the cluster. + :vartype id: float + :ivar windows_server_subscription: State of Windows Server Subscription. Known values are: + "Disabled" and "Enabled". + :vartype windows_server_subscription: str or + ~azure.mgmt.azurestackhci.models.WindowsServerSubscription + :ivar node_type: Type of the cluster node hardware. Known values are: "FirstParty" and + "ThirdParty". + :vartype node_type: str or ~azure.mgmt.azurestackhci.models.ClusterNodeType + :ivar ehc_resource_id: Edge Hardware Center Resource Id. + :vartype ehc_resource_id: str + :ivar manufacturer: Manufacturer of the cluster node hardware. + :vartype manufacturer: str + :ivar model: Model name of the cluster node hardware. + :vartype model: str + :ivar os_name: Operating system running on the cluster node. + :vartype os_name: str + :ivar os_version: Version of the operating system running on the cluster node. + :vartype os_version: str + :ivar os_display_version: Display version of the operating system running on the cluster node. + :vartype os_display_version: str + :ivar serial_number: Immutable id of the cluster node. + :vartype serial_number: str + :ivar core_count: Number of physical cores on the cluster node. + :vartype core_count: float + :ivar memory_in_gi_b: Total available memory on the cluster node (in GiB). + :vartype memory_in_gi_b: float + :ivar last_licensing_timestamp: Most recent licensing timestamp. + :vartype last_licensing_timestamp: ~datetime.datetime + :ivar oem_activation: OEM activation status of the node. Known values are: "Disabled" and + "Enabled". + :vartype oem_activation: str or ~azure.mgmt.azurestackhci.models.OemActivation + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the cluster node.""" + id: Optional[float] = rest_field(visibility=["read"]) + """Id of the node in the cluster.""" + windows_server_subscription: Optional[Union[str, "_models.WindowsServerSubscription"]] = rest_field( + name="windowsServerSubscription", visibility=["read"] + ) + """State of Windows Server Subscription. Known values are: \"Disabled\" and \"Enabled\".""" + node_type: Optional[Union[str, "_models.ClusterNodeType"]] = rest_field(name="nodeType", visibility=["read"]) + """Type of the cluster node hardware. Known values are: \"FirstParty\" and \"ThirdParty\".""" + ehc_resource_id: Optional[str] = rest_field(name="ehcResourceId", visibility=["read"]) + """Edge Hardware Center Resource Id.""" + manufacturer: Optional[str] = rest_field(visibility=["read"]) + """Manufacturer of the cluster node hardware.""" + model: Optional[str] = rest_field(visibility=["read"]) + """Model name of the cluster node hardware.""" + os_name: Optional[str] = rest_field(name="osName", visibility=["read"]) + """Operating system running on the cluster node.""" + os_version: Optional[str] = rest_field(name="osVersion", visibility=["read"]) + """Version of the operating system running on the cluster node.""" + os_display_version: Optional[str] = rest_field(name="osDisplayVersion", visibility=["read"]) + """Display version of the operating system running on the cluster node.""" + serial_number: Optional[str] = rest_field(name="serialNumber", visibility=["read"]) + """Immutable id of the cluster node.""" + core_count: Optional[float] = rest_field(name="coreCount", visibility=["read"]) + """Number of physical cores on the cluster node.""" + memory_in_gi_b: Optional[float] = rest_field(name="memoryInGiB", visibility=["read"]) + """Total available memory on the cluster node (in GiB).""" + last_licensing_timestamp: Optional[datetime.datetime] = rest_field( + name="lastLicensingTimestamp", visibility=["read"], format="rfc3339" + ) + """Most recent licensing timestamp.""" + oem_activation: Optional[Union[str, "_models.OemActivation"]] = rest_field( + name="oemActivation", visibility=["read"] + ) + """OEM activation status of the node. Known values are: \"Disabled\" and \"Enabled\".""" + + +class ClusterPatch(_Model): + """Cluster details to update. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: Identity of Cluster resource. + :vartype identity: ~azure.mgmt.azurestackhci.models.ManagedServiceIdentity + :ivar properties: Cluster properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.ClusterPatchProperties + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Identity of Cluster resource.""" + properties: Optional["_models.ClusterPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Cluster properties.""" + + __flattened_items = [ + "principal_id", + "tenant_id", + "type", + "user_assigned_identities", + "cloud_management_endpoint", + "aad_client_id", + "aad_tenant_id", + "desired_properties", + ] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + properties: Optional["_models.ClusterPatchProperties"] = 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.identity is None: + return None + return getattr(self.identity, 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.identity is None: + self.identity = self._attr_to_rest_field["identity"]._class_type() + setattr(self.identity, key, value) + else: + super().__setattr__(key, value) + + +class ClusterPatchProperties(_Model): + """Cluster properties. + + :ivar cloud_management_endpoint: Endpoint configured for management from the Azure portal. + :vartype cloud_management_endpoint: str + :ivar aad_client_id: App id of cluster AAD identity. + :vartype aad_client_id: str + :ivar aad_tenant_id: Tenant id of cluster AAD identity. + :vartype aad_tenant_id: str + :ivar desired_properties: Desired properties of the cluster. + :vartype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties + """ + + cloud_management_endpoint: Optional[str] = rest_field( + name="cloudManagementEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Endpoint configured for management from the Azure portal.""" + aad_client_id: Optional[str] = rest_field( + name="aadClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """App id of cluster AAD identity.""" + aad_tenant_id: Optional[str] = rest_field( + name="aadTenantId", visibility=["read", "create", "update", "delete", "query"] + ) + """Tenant id of cluster AAD identity.""" + desired_properties: Optional["_models.ClusterDesiredProperties"] = rest_field( + name="desiredProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Desired properties of the cluster.""" + + @overload + def __init__( + self, + *, + cloud_management_endpoint: Optional[str] = None, + aad_client_id: Optional[str] = None, + aad_tenant_id: Optional[str] = None, + desired_properties: Optional["_models.ClusterDesiredProperties"] = 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 ClusterProperties(_Model): + """Cluster properties. + + :ivar provisioning_state: Provisioning state. Indicates the current lifecycle status of the + resource, including creation, update, deletion, connectivity, and error states. Known values + are: "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar status: Status of the cluster agent. Indicates the current connectivity, validation, and + deployment state of the agent within the cluster. Known values are: "NotYetRegistered", + "ConnectedRecently", "NotConnectedRecently", "Disconnected", "Error", "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", and "DeploymentSuccess". + :vartype status: str or ~azure.mgmt.azurestackhci.models.Status + :ivar connectivity_status: Overall connectivity status for the cluster resource. Indicates + whether the cluster is connected to Azure, partially connected, or has not recently + communicated. Known values are: "NotYetRegistered", "Connected", "NotConnectedRecently", + "PartiallyConnected", "Disconnected", and "NotSpecified". + :vartype connectivity_status: str or ~azure.mgmt.azurestackhci.models.ConnectivityStatus + :ivar support_status: Indicates whether the cluster is under support. Known values are: + "InSupport", "OutOfSupport", and "NotSpecified". + :vartype support_status: str or ~azure.mgmt.azurestackhci.models.SupportStatus + :ivar cloud_id: Unique, immutable resource id. + :vartype cloud_id: str + :ivar ring: The ring to which this cluster belongs to. + :vartype ring: str + :ivar cloud_management_endpoint: Endpoint configured for management from the Azure portal. + :vartype cloud_management_endpoint: str + :ivar aad_client_id: App id of cluster AAD identity. + :vartype aad_client_id: str + :ivar aad_tenant_id: Tenant id of cluster AAD identity. + :vartype aad_tenant_id: str + :ivar aad_application_object_id: Object id of cluster AAD identity. + :vartype aad_application_object_id: str + :ivar aad_service_principal_object_id: Id of cluster identity service principal. + :vartype aad_service_principal_object_id: str + :ivar software_assurance_properties: Software Assurance properties of the cluster. + :vartype software_assurance_properties: + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceProperties + :ivar is_management_cluster: Is Management Cluster, when true indicates that the cluster is + used for managing other clusters. + :vartype is_management_cluster: bool + :ivar log_collection_properties: Log Collection properties of the cluster. + :vartype log_collection_properties: ~azure.mgmt.azurestackhci.models.LogCollectionProperties + :ivar remote_support_properties: RemoteSupport properties of the cluster. + :vartype remote_support_properties: ~azure.mgmt.azurestackhci.models.RemoteSupportProperties + :ivar desired_properties: Desired properties of the cluster. + :vartype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties + :ivar reported_properties: Properties reported by cluster agent. + :vartype reported_properties: ~azure.mgmt.azurestackhci.models.ClusterReportedProperties + :ivar isolated_vm_attestation_configuration: Attestation configurations for isolated VM (e.g. + TVM, CVM) of the cluster. + :vartype isolated_vm_attestation_configuration: + ~azure.mgmt.azurestackhci.models.IsolatedVmAttestationConfiguration + :ivar trial_days_remaining: Number of days remaining in the trial period. + :vartype trial_days_remaining: float + :ivar billing_model: Type of billing applied to the resource. + :vartype billing_model: str + :ivar registration_timestamp: First cluster sync timestamp. + :vartype registration_timestamp: ~datetime.datetime + :ivar last_sync_timestamp: Most recent cluster sync timestamp. + :vartype last_sync_timestamp: ~datetime.datetime + :ivar last_billing_timestamp: Most recent billing meter timestamp. + :vartype last_billing_timestamp: ~datetime.datetime + :ivar service_endpoint: Region specific DataPath Endpoint of the cluster. + :vartype service_endpoint: str + :ivar resource_provider_object_id: Object id of RP Service Principal. + :vartype resource_provider_object_id: str + :ivar secrets_locations: List of secret locations. + :vartype secrets_locations: list[~azure.mgmt.azurestackhci.models.SecretsLocationDetails] + :ivar cluster_pattern: Supported Storage Type for HCI Cluster. Known values are: "Standard" and + "RackAware". + :vartype cluster_pattern: str or ~azure.mgmt.azurestackhci.models.ClusterPattern + :ivar confidential_vm_properties: Represents the Confidential Virtual Machine (CVM) support + intent and current status for the cluster resource. + :vartype confidential_vm_properties: ~azure.mgmt.azurestackhci.models.ConfidentialVmProperties + :ivar sdn_properties: Software Defined Networking Properties of the cluster. + :vartype sdn_properties: ~azure.mgmt.azurestackhci.models.ClusterSdnProperties + :ivar local_availability_zones: Local Availability Zone information for HCI cluster. + :vartype local_availability_zones: + list[~azure.mgmt.azurestackhci.models.LocalAvailabilityZones] + :ivar identity_provider: Identity Provider for the cluster. Known values are: "ActiveDirectory" + and "LocalIdentity". + :vartype identity_provider: str or ~azure.mgmt.azurestackhci.models.IdentityProvider + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state. Indicates the current lifecycle status of the resource, including creation, + update, deletion, connectivity, and error states. Known values are: \"NotSpecified\", + \"Error\", \"Succeeded\", \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", + \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", + \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", and + \"DisableInProgress\".""" + status: Optional[Union[str, "_models.Status"]] = rest_field(visibility=["read"]) + """Status of the cluster agent. Indicates the current connectivity, validation, and deployment + state of the agent within the cluster. Known values are: \"NotYetRegistered\", + \"ConnectedRecently\", \"NotConnectedRecently\", \"Disconnected\", \"Error\", \"NotSpecified\", + \"ValidationInProgress\", \"ValidationSuccess\", \"ValidationFailed\", + \"DeploymentInProgress\", \"DeploymentFailed\", and \"DeploymentSuccess\".""" + connectivity_status: Optional[Union[str, "_models.ConnectivityStatus"]] = rest_field( + name="connectivityStatus", visibility=["read"] + ) + """Overall connectivity status for the cluster resource. Indicates whether the cluster is + connected to Azure, partially connected, or has not recently communicated. Known values are: + \"NotYetRegistered\", \"Connected\", \"NotConnectedRecently\", \"PartiallyConnected\", + \"Disconnected\", and \"NotSpecified\".""" + support_status: Optional[Union[str, "_models.SupportStatus"]] = rest_field( + name="supportStatus", visibility=["read"] + ) + """Indicates whether the cluster is under support. Known values are: \"InSupport\", + \"OutOfSupport\", and \"NotSpecified\".""" + cloud_id: Optional[str] = rest_field(name="cloudId", visibility=["read"]) + """Unique, immutable resource id.""" + ring: Optional[str] = rest_field(visibility=["read"]) + """The ring to which this cluster belongs to.""" + cloud_management_endpoint: Optional[str] = rest_field( + name="cloudManagementEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Endpoint configured for management from the Azure portal.""" + aad_client_id: Optional[str] = rest_field( + name="aadClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """App id of cluster AAD identity.""" + aad_tenant_id: Optional[str] = rest_field( + name="aadTenantId", visibility=["read", "create", "update", "delete", "query"] + ) + """Tenant id of cluster AAD identity.""" + aad_application_object_id: Optional[str] = rest_field( + name="aadApplicationObjectId", visibility=["read", "create", "update", "delete", "query"] + ) + """Object id of cluster AAD identity.""" + aad_service_principal_object_id: Optional[str] = rest_field( + name="aadServicePrincipalObjectId", visibility=["read", "create", "update", "delete", "query"] + ) + """Id of cluster identity service principal.""" + software_assurance_properties: Optional["_models.SoftwareAssuranceProperties"] = rest_field( + name="softwareAssuranceProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Software Assurance properties of the cluster.""" + is_management_cluster: Optional[bool] = rest_field(name="isManagementCluster", visibility=["read"]) + """Is Management Cluster, when true indicates that the cluster is used for managing other + clusters.""" + log_collection_properties: Optional["_models.LogCollectionProperties"] = rest_field( + name="logCollectionProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Log Collection properties of the cluster.""" + remote_support_properties: Optional["_models.RemoteSupportProperties"] = rest_field( + name="remoteSupportProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """RemoteSupport properties of the cluster.""" + desired_properties: Optional["_models.ClusterDesiredProperties"] = rest_field( + name="desiredProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Desired properties of the cluster.""" + reported_properties: Optional["_models.ClusterReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read"] + ) + """Properties reported by cluster agent.""" + isolated_vm_attestation_configuration: Optional["_models.IsolatedVmAttestationConfiguration"] = rest_field( + name="isolatedVmAttestationConfiguration", visibility=["read"] + ) + """Attestation configurations for isolated VM (e.g. TVM, CVM) of the cluster.""" + trial_days_remaining: Optional[float] = rest_field(name="trialDaysRemaining", visibility=["read"]) + """Number of days remaining in the trial period.""" + billing_model: Optional[str] = rest_field(name="billingModel", visibility=["read"]) + """Type of billing applied to the resource.""" + registration_timestamp: Optional[datetime.datetime] = rest_field( + name="registrationTimestamp", visibility=["read"], format="rfc3339" + ) + """First cluster sync timestamp.""" + last_sync_timestamp: Optional[datetime.datetime] = rest_field( + name="lastSyncTimestamp", visibility=["read"], format="rfc3339" + ) + """Most recent cluster sync timestamp.""" + last_billing_timestamp: Optional[datetime.datetime] = rest_field( + name="lastBillingTimestamp", visibility=["read"], format="rfc3339" + ) + """Most recent billing meter timestamp.""" + service_endpoint: Optional[str] = rest_field(name="serviceEndpoint", visibility=["read"]) + """Region specific DataPath Endpoint of the cluster.""" + resource_provider_object_id: Optional[str] = rest_field(name="resourceProviderObjectId", visibility=["read"]) + """Object id of RP Service Principal.""" + secrets_locations: Optional[list["_models.SecretsLocationDetails"]] = rest_field( + name="secretsLocations", visibility=["read", "create", "update", "delete", "query"] + ) + """List of secret locations.""" + cluster_pattern: Optional[Union[str, "_models.ClusterPattern"]] = rest_field( + name="clusterPattern", visibility=["read"] + ) + """Supported Storage Type for HCI Cluster. Known values are: \"Standard\" and \"RackAware\".""" + confidential_vm_properties: Optional["_models.ConfidentialVmProperties"] = rest_field( + name="confidentialVmProperties", visibility=["read"] + ) + """Represents the Confidential Virtual Machine (CVM) support intent and current status for the + cluster resource.""" + sdn_properties: Optional["_models.ClusterSdnProperties"] = rest_field(name="sdnProperties", visibility=["read"]) + """Software Defined Networking Properties of the cluster.""" + local_availability_zones: Optional[list["_models.LocalAvailabilityZones"]] = rest_field( + name="localAvailabilityZones", visibility=["read", "create", "update", "delete", "query"] + ) + """Local Availability Zone information for HCI cluster.""" + identity_provider: Optional[Union[str, "_models.IdentityProvider"]] = rest_field( + name="identityProvider", visibility=["read"] + ) + """Identity Provider for the cluster. Known values are: \"ActiveDirectory\" and \"LocalIdentity\".""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + cloud_management_endpoint: Optional[str] = None, + aad_client_id: Optional[str] = None, + aad_tenant_id: Optional[str] = None, + aad_application_object_id: Optional[str] = None, + aad_service_principal_object_id: Optional[str] = None, + software_assurance_properties: Optional["_models.SoftwareAssuranceProperties"] = None, + log_collection_properties: Optional["_models.LogCollectionProperties"] = None, + remote_support_properties: Optional["_models.RemoteSupportProperties"] = None, + desired_properties: Optional["_models.ClusterDesiredProperties"] = None, + secrets_locations: Optional[list["_models.SecretsLocationDetails"]] = None, + local_availability_zones: Optional[list["_models.LocalAvailabilityZones"]] = 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 ClusterReportedProperties(_Model): + """Properties reported by cluster agent. + + :ivar cluster_name: Name of the on-prem cluster connected to this resource. + :vartype cluster_name: str + :ivar cluster_id: Unique id generated by the on-prem cluster. + :vartype cluster_id: str + :ivar cluster_version: Version of the cluster software. + :vartype cluster_version: str + :ivar nodes: List of nodes reported by the cluster. + :vartype nodes: list[~azure.mgmt.azurestackhci.models.ClusterNode] + :ivar last_updated: Last time the cluster reported the data. + :vartype last_updated: ~datetime.datetime + :ivar msi_expiration_time_stamp: Specifies the expiration timestamp of the cluster's Managed + Service Identity (MSI). The value is expressed in Coordinated Universal Time (UTC). + :vartype msi_expiration_time_stamp: ~datetime.datetime + :ivar imds_attestation: IMDS attestation status of the cluster. Known values are: "Disabled" + and "Enabled". + :vartype imds_attestation: str or ~azure.mgmt.azurestackhci.models.ImdsAttestation + :ivar diagnostic_level: Level of diagnostic data emitted by the cluster. Known values are: + "Off", "Basic", and "Enhanced". + :vartype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel + :ivar supported_capabilities: Capabilities supported by the cluster. + :vartype supported_capabilities: list[str] + :ivar cluster_type: Specifies the type of hardware vendor for all nodes in the cluster. + Indicates whether the nodes are provided by Microsoft or a third-party vendor. Known values + are: "FirstParty" and "ThirdParty". + :vartype cluster_type: str or ~azure.mgmt.azurestackhci.models.ClusterNodeType + :ivar manufacturer: The manufacturer of all the nodes of the cluster. + :vartype manufacturer: str + :ivar oem_activation: OEM activation status of the cluster. Known values are: "Disabled" and + "Enabled". + :vartype oem_activation: str or ~azure.mgmt.azurestackhci.models.OemActivation + :ivar hardware_class: Hardware class of the cluster. Known values are: "Small", "Medium", and + "Large". + :vartype hardware_class: str or ~azure.mgmt.azurestackhci.models.HardwareClass + """ + + cluster_name: Optional[str] = rest_field(name="clusterName", visibility=["read"]) + """Name of the on-prem cluster connected to this resource.""" + cluster_id: Optional[str] = rest_field(name="clusterId", visibility=["read"]) + """Unique id generated by the on-prem cluster.""" + cluster_version: Optional[str] = rest_field(name="clusterVersion", visibility=["read"]) + """Version of the cluster software.""" + nodes: Optional[list["_models.ClusterNode"]] = rest_field(visibility=["read"]) + """List of nodes reported by the cluster.""" + last_updated: Optional[datetime.datetime] = rest_field(name="lastUpdated", visibility=["read"], format="rfc3339") + """Last time the cluster reported the data.""" + msi_expiration_time_stamp: Optional[datetime.datetime] = rest_field( + name="msiExpirationTimeStamp", visibility=["read"], format="rfc3339" + ) + """Specifies the expiration timestamp of the cluster's Managed Service Identity (MSI). The value + is expressed in Coordinated Universal Time (UTC).""" + imds_attestation: Optional[Union[str, "_models.ImdsAttestation"]] = rest_field( + name="imdsAttestation", visibility=["read"] + ) + """IMDS attestation status of the cluster. Known values are: \"Disabled\" and \"Enabled\".""" + diagnostic_level: Optional[Union[str, "_models.DiagnosticLevel"]] = rest_field( + name="diagnosticLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """Level of diagnostic data emitted by the cluster. Known values are: \"Off\", \"Basic\", and + \"Enhanced\".""" + supported_capabilities: Optional[list[str]] = rest_field(name="supportedCapabilities", visibility=["read"]) + """Capabilities supported by the cluster.""" + cluster_type: Optional[Union[str, "_models.ClusterNodeType"]] = rest_field(name="clusterType", visibility=["read"]) + """Specifies the type of hardware vendor for all nodes in the cluster. Indicates whether the nodes + are provided by Microsoft or a third-party vendor. Known values are: \"FirstParty\" and + \"ThirdParty\".""" + manufacturer: Optional[str] = rest_field(visibility=["read"]) + """The manufacturer of all the nodes of the cluster.""" + oem_activation: Optional[Union[str, "_models.OemActivation"]] = rest_field( + name="oemActivation", visibility=["read"] + ) + """OEM activation status of the cluster. Known values are: \"Disabled\" and \"Enabled\".""" + hardware_class: Optional[Union[str, "_models.HardwareClass"]] = rest_field( + name="hardwareClass", visibility=["read"] + ) + """Hardware class of the cluster. Known values are: \"Small\", \"Medium\", and \"Large\".""" + + @overload + def __init__( + self, + *, + diagnostic_level: Optional[Union[str, "_models.DiagnosticLevel"]] = 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 SdnProperties(_Model): + """Represents the Software Defined Networking (SDN) configuration state. + + :ivar sdn_status: Indicates the current Software Defined Networking (SDN) status of the + resource, which may be an individual device or a cluster. Known values are: "Unknown", + "Disabled", and "Enabled". + :vartype sdn_status: str or ~azure.mgmt.azurestackhci.models.SdnStatus + :ivar sdn_domain_name: The fully qualified domain name (FQDN) associated with the SDN + deployment. This value is propagated from the Device Management Extension to the cluster + resource. It is typically in the format ``-nc.`` when SDN is enabled. May be + null or absent in unsupported or disabled states. + :vartype sdn_domain_name: str + :ivar sdn_api_address: Represents the API address for the SDN deployment. + :vartype sdn_api_address: str + """ + + sdn_status: Optional[Union[str, "_models.SdnStatus"]] = rest_field(name="sdnStatus", visibility=["read"]) + """Indicates the current Software Defined Networking (SDN) status of the resource, which may be an + individual device or a cluster. Known values are: \"Unknown\", \"Disabled\", and \"Enabled\".""" + sdn_domain_name: Optional[str] = rest_field(name="sdnDomainName", visibility=["read"]) + """The fully qualified domain name (FQDN) associated with the SDN deployment. This value is + propagated from the Device Management Extension to the cluster resource. It is typically in the + format ``-nc.`` when SDN is enabled. May be null or absent in unsupported or + disabled states.""" + sdn_api_address: Optional[str] = rest_field(name="sdnApiAddress", visibility=["read"]) + """Represents the API address for the SDN deployment.""" + + +class ClusterSdnProperties(SdnProperties): + """Represents the Software Defined Networking (SDN) configuration state of the Azure Stack HCI + cluster. + + :ivar sdn_status: Indicates the current Software Defined Networking (SDN) status of the + resource, which may be an individual device or a cluster. Known values are: "Unknown", + "Disabled", and "Enabled". + :vartype sdn_status: str or ~azure.mgmt.azurestackhci.models.SdnStatus + :ivar sdn_domain_name: The fully qualified domain name (FQDN) associated with the SDN + deployment. This value is propagated from the Device Management Extension to the cluster + resource. It is typically in the format ``-nc.`` when SDN is enabled. May be + null or absent in unsupported or disabled states. + :vartype sdn_domain_name: str + :ivar sdn_api_address: Represents the API address for the SDN deployment. + :vartype sdn_api_address: str + :ivar sdn_integration_intent: Indicates whether Software Defined Networking (SDN) integration + should be enabled or disabled for this deployment. Known values are: "Enable" and "Disable". + :vartype sdn_integration_intent: str or ~azure.mgmt.azurestackhci.models.SdnIntegrationIntent + """ + + sdn_integration_intent: Optional[Union[str, "_models.SdnIntegrationIntent"]] = rest_field( + name="sdnIntegrationIntent", visibility=["read"] + ) + """Indicates whether Software Defined Networking (SDN) integration should be enabled or disabled + for this deployment. Known values are: \"Enable\" and \"Disable\".""" + + +class ConfidentialVmProfile(_Model): + """Represents the Confidential Virtual Machine (CVM) configuration status for an edge device. It + includes the current IGVM support state and detailed component-level status information. + + :ivar igvm_status: Indicates whether Independent Guest Virtual Machine (IGVM) support is + available on the device. This will be 'Enabled' if the device supports CVMs, 'Disabled' if not, + and 'Unknown' if the status cannot be determined. Known values are: "Unknown", "Enabled", and + "Disabled". + :vartype igvm_status: str or ~azure.mgmt.azurestackhci.models.IgvmStatus + :ivar status_details: Provides detailed status entries for IGVM-related components, including + deployment status, compatibility checks, and error diagnostics. + :vartype status_details: list[~azure.mgmt.azurestackhci.models.IgvmStatusDetail] + """ + + igvm_status: Optional[Union[str, "_models.IgvmStatus"]] = rest_field(name="igvmStatus", visibility=["read"]) + """Indicates whether Independent Guest Virtual Machine (IGVM) support is available on the device. + This will be 'Enabled' if the device supports CVMs, 'Disabled' if not, and 'Unknown' if the + status cannot be determined. Known values are: \"Unknown\", \"Enabled\", and \"Disabled\".""" + status_details: Optional[list["_models.IgvmStatusDetail"]] = rest_field( + name="statusDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Provides detailed status entries for IGVM-related components, including deployment status, + compatibility checks, and error diagnostics.""" + + @overload + def __init__( + self, + *, + status_details: Optional[list["_models.IgvmStatusDetail"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ConfidentialVmProperties(_Model): + """Represents the Confidential Virtual Machine (CVM) support intent and current status for the + cluster resource. + + :ivar confidential_vm_intent: Captures the customer's intent to enable or disable CVM support + on the cluster, either during initial deployment (Day-0) or at a later stage (Day-N). Known + values are: "Enable" and "Disable". + :vartype confidential_vm_intent: str or ~azure.mgmt.azurestackhci.models.ConfidentialVmIntent + :ivar confidential_vm_status: Captures the current status of CVM support on the cluster. Known + values are: "Enabled", "PartiallyEnabled", and "Disabled". + :vartype confidential_vm_status: str or ~azure.mgmt.azurestackhci.models.ConfidentialVmStatus + :ivar confidential_vm_status_summary: Additional context about CVM support on the cluster, such + as reasons for partial enablement or hardware constraints. + :vartype confidential_vm_status_summary: str + """ + + confidential_vm_intent: Optional[Union[str, "_models.ConfidentialVmIntent"]] = rest_field( + name="confidentialVmIntent", visibility=["read"] + ) + """Captures the customer's intent to enable or disable CVM support on the cluster, either during + initial deployment (Day-0) or at a later stage (Day-N). Known values are: \"Enable\" and + \"Disable\".""" + confidential_vm_status: Optional[Union[str, "_models.ConfidentialVmStatus"]] = rest_field( + name="confidentialVmStatus", visibility=["read"] + ) + """Captures the current status of CVM support on the cluster. Known values are: \"Enabled\", + \"PartiallyEnabled\", and \"Disabled\".""" + confidential_vm_status_summary: Optional[str] = rest_field(name="confidentialVmStatusSummary", visibility=["read"]) + """Additional context about CVM support on the cluster, such as reasons for partial enablement or + hardware constraints.""" + + +class ContentPayload(_Model): + """Represents details of a specific update content payload. + + :ivar url: Represents url of a update payload. + :vartype url: str + :ivar hash: Represents hash of a update payload. + :vartype hash: str + :ivar hash_algorithm: Represents hash algorithm of a update payload. + :vartype hash_algorithm: str + :ivar identifier: Represents identifier of a update payload. + :vartype identifier: str + :ivar package_size_in_bytes: Represents size in bytes of a update payload. + :vartype package_size_in_bytes: str + :ivar group: Represents the group of a update payload. + :vartype group: str + :ivar file_name: Represents the file name of a update payload. + :vartype file_name: str + """ + + url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents url of a update payload.""" + hash: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents hash of a update payload.""" + hash_algorithm: Optional[str] = rest_field( + name="hashAlgorithm", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents hash algorithm of a update payload.""" + identifier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents identifier of a update payload.""" + package_size_in_bytes: Optional[str] = rest_field( + name="packageSizeInBytes", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents size in bytes of a update payload.""" + group: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the group of a update payload.""" + file_name: Optional[str] = rest_field(name="fileName", visibility=["read", "create", "update", "delete", "query"]) + """Represents the file name of a update payload.""" + + @overload + def __init__( + self, + *, + url: Optional[str] = None, + hash: Optional[str] = None, + hash_algorithm: Optional[str] = None, + identifier: Optional[str] = None, + package_size_in_bytes: Optional[str] = None, + group: Optional[str] = None, + file_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DefaultExtensionDetails(_Model): + """Properties for a particular default extension category. + + :ivar category: Default extension category. + :vartype category: str + :ivar consent_time: Consent time for extension category. + :vartype consent_time: ~datetime.datetime + """ + + category: Optional[str] = rest_field(visibility=["read"]) + """Default extension category.""" + consent_time: Optional[datetime.datetime] = rest_field(name="consentTime", visibility=["read"], format="rfc3339") + """Consent time for extension category.""" + + +class DeploymentCluster(_Model): + """AzureStackHCI Cluster deployment properties. + + :ivar name: The cluster name provided when preparing Active Directory. + :vartype name: str + :ivar witness_type: Use a cloud witness if you have internet access and if you use an Azure + Storage account to provide a vote on cluster quorum. A cloud witness uses Azure Blob Storage to + read or write a blob file and then uses it to arbitrate in split-brain resolution. Only allowed + values are 'Cloud', 'FileShare'. + :vartype witness_type: str + :ivar witness_path: Specify the fileshare path for the local witness for your Azure Stack HCI + cluster. + :vartype witness_path: str + :ivar cloud_account_name: Specify the Azure Storage account name for cloud witness for your + Azure Stack HCI cluster. + :vartype cloud_account_name: str + :ivar azure_service_endpoint: For Azure blob service endpoint type, select either Default or + Custom domain. If you selected **Custom domain, enter the domain for the blob service in this + format core.windows.net. + :vartype azure_service_endpoint: str + :ivar hardware_class: Hardware class of the cluster. Known values are: "Small", "Medium", and + "Large". + :vartype hardware_class: str or ~azure.mgmt.azurestackhci.models.HardwareClass + :ivar cluster_pattern: Cluster Pattern supported. Known values are: "Standard" and "RackAware". + :vartype cluster_pattern: str or ~azure.mgmt.azurestackhci.models.ClusterPattern + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The cluster name provided when preparing Active Directory.""" + witness_type: Optional[str] = rest_field( + name="witnessType", visibility=["read", "create", "update", "delete", "query"] + ) + """Use a cloud witness if you have internet access and if you use an Azure Storage account to + provide a vote on cluster quorum. A cloud witness uses Azure Blob Storage to read or write a + blob file and then uses it to arbitrate in split-brain resolution. Only allowed values are + 'Cloud', 'FileShare'.""" + witness_path: Optional[str] = rest_field( + name="witnessPath", visibility=["read", "create", "update", "delete", "query"] + ) + """Specify the fileshare path for the local witness for your Azure Stack HCI cluster.""" + cloud_account_name: Optional[str] = rest_field( + name="cloudAccountName", visibility=["read", "create", "update", "delete", "query"] + ) + """Specify the Azure Storage account name for cloud witness for your Azure Stack HCI cluster.""" + azure_service_endpoint: Optional[str] = rest_field( + name="azureServiceEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """For Azure blob service endpoint type, select either Default or Custom domain. If you selected + **Custom domain, enter the domain for the blob service in this format core.windows.net.""" + hardware_class: Optional[Union[str, "_models.HardwareClass"]] = rest_field( + name="hardwareClass", visibility=["read"] + ) + """Hardware class of the cluster. Known values are: \"Small\", \"Medium\", and \"Large\".""" + cluster_pattern: Optional[Union[str, "_models.ClusterPattern"]] = rest_field( + name="clusterPattern", visibility=["read", "create", "update", "delete", "query"] + ) + """Cluster Pattern supported. Known values are: \"Standard\" and \"RackAware\".""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + witness_type: Optional[str] = None, + witness_path: Optional[str] = None, + cloud_account_name: Optional[str] = None, + azure_service_endpoint: Optional[str] = None, + cluster_pattern: Optional[Union[str, "_models.ClusterPattern"]] = 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 DeploymentConfiguration(_Model): + """Deployment Configuration. + + :ivar version: deployment template version. + :vartype version: str + :ivar scale_units: Scale units will contains list of deployment data. Required. + :vartype scale_units: list[~azure.mgmt.azurestackhci.models.ScaleUnits] + """ + + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """deployment template version.""" + scale_units: list["_models.ScaleUnits"] = rest_field( + name="scaleUnits", visibility=["read", "create", "update", "delete", "query"] + ) + """Scale units will contains list of deployment data. Required.""" + + @overload + def __init__( + self, + *, + scale_units: list["_models.ScaleUnits"], + 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 DeploymentData(_Model): + """The Deployment data of AzureStackHCI Cluster. + + :ivar security_settings: SecuritySettings to deploy AzureStackHCI Cluster. + :vartype security_settings: ~azure.mgmt.azurestackhci.models.DeploymentSecuritySettings + :ivar observability: Observability config to deploy AzureStackHCI Cluster. + :vartype observability: ~azure.mgmt.azurestackhci.models.Observability + :ivar cluster: Observability config to deploy AzureStackHCI Cluster. + :vartype cluster: ~azure.mgmt.azurestackhci.models.DeploymentCluster + :ivar identity_provider: Identity Provider for the cluster. Known values are: "ActiveDirectory" + and "LocalIdentity". + :vartype identity_provider: str or ~azure.mgmt.azurestackhci.models.IdentityProvider + :ivar storage: Storage config to deploy AzureStackHCI Cluster. + :vartype storage: ~azure.mgmt.azurestackhci.models.Storage + :ivar naming_prefix: naming prefix to deploy cluster. + :vartype naming_prefix: str + :ivar domain_fqdn: FQDN to deploy cluster. + :vartype domain_fqdn: str + :ivar infrastructure_network: InfrastructureNetwork config to deploy AzureStackHCI Cluster. + :vartype infrastructure_network: list[~azure.mgmt.azurestackhci.models.InfrastructureNetwork] + :ivar physical_nodes: list of physical nodes config to deploy AzureStackHCI Cluster. + :vartype physical_nodes: list[~azure.mgmt.azurestackhci.models.PhysicalNodes] + :ivar host_network: HostNetwork config to deploy AzureStackHCI Cluster. + :vartype host_network: ~azure.mgmt.azurestackhci.models.DeploymentSettingHostNetwork + :ivar sdn_integration: SDN Integration config to deploy AzureStackHCI Cluster. + :vartype sdn_integration: ~azure.mgmt.azurestackhci.models.SdnIntegration + :ivar is_management_cluster: Is Management Cluster, when true indicates that the cluster is + used for managing other clusters. + :vartype is_management_cluster: bool + :ivar adou_path: The path to the Active Directory Organizational Unit container object prepared + for the deployment. + :vartype adou_path: str + :ivar secrets_location: Azure key vault endpoint. This property is deprecated from + 2023-12-01-preview. Please use secrets property instead. + :vartype secrets_location: str + :ivar secrets: secrets used for cloud deployment. + :vartype secrets: list[~azure.mgmt.azurestackhci.models.EceDeploymentSecrets] + :ivar optional_services: OptionalServices config to deploy AzureStackHCI Cluster. + :vartype optional_services: ~azure.mgmt.azurestackhci.models.OptionalServices + :ivar local_availability_zones: Local Availability Zone information for HCI cluster. + :vartype local_availability_zones: + list[~azure.mgmt.azurestackhci.models.LocalAvailabilityZones] + :ivar assembly_info: Assembly Package details for Validated Solution Recipe for AzureStackHCI + Cluster. + :vartype assembly_info: ~azure.mgmt.azurestackhci.models.AssemblyInfo + """ + + security_settings: Optional["_models.DeploymentSecuritySettings"] = rest_field( + name="securitySettings", visibility=["read", "create", "update", "delete", "query"] + ) + """SecuritySettings to deploy AzureStackHCI Cluster.""" + observability: Optional["_models.Observability"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Observability config to deploy AzureStackHCI Cluster.""" + cluster: Optional["_models.DeploymentCluster"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Observability config to deploy AzureStackHCI Cluster.""" + identity_provider: Optional[Union[str, "_models.IdentityProvider"]] = rest_field( + name="identityProvider", visibility=["read", "create", "update", "delete", "query"] + ) + """Identity Provider for the cluster. Known values are: \"ActiveDirectory\" and \"LocalIdentity\".""" + storage: Optional["_models.Storage"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Storage config to deploy AzureStackHCI Cluster.""" + naming_prefix: Optional[str] = rest_field( + name="namingPrefix", visibility=["read", "create", "update", "delete", "query"] + ) + """naming prefix to deploy cluster.""" + domain_fqdn: Optional[str] = rest_field( + name="domainFqdn", visibility=["read", "create", "update", "delete", "query"] + ) + """FQDN to deploy cluster.""" + infrastructure_network: Optional[list["_models.InfrastructureNetwork"]] = rest_field( + name="infrastructureNetwork", visibility=["read", "create", "update", "delete", "query"] + ) + """InfrastructureNetwork config to deploy AzureStackHCI Cluster.""" + physical_nodes: Optional[list["_models.PhysicalNodes"]] = rest_field( + name="physicalNodes", visibility=["read", "create", "update", "delete", "query"] + ) + """list of physical nodes config to deploy AzureStackHCI Cluster.""" + host_network: Optional["_models.DeploymentSettingHostNetwork"] = rest_field( + name="hostNetwork", visibility=["read", "create", "update", "delete", "query"] + ) + """HostNetwork config to deploy AzureStackHCI Cluster.""" + sdn_integration: Optional["_models.SdnIntegration"] = rest_field( + name="sdnIntegration", visibility=["read", "create", "update", "delete", "query"] + ) + """SDN Integration config to deploy AzureStackHCI Cluster.""" + is_management_cluster: Optional[bool] = rest_field( + name="isManagementCluster", visibility=["read", "create", "update", "delete", "query"] + ) + """Is Management Cluster, when true indicates that the cluster is used for managing other + clusters.""" + adou_path: Optional[str] = rest_field(name="adouPath", visibility=["read", "create", "update", "delete", "query"]) + """The path to the Active Directory Organizational Unit container object prepared for the + deployment.""" + secrets_location: Optional[str] = rest_field( + name="secretsLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure key vault endpoint. This property is deprecated from 2023-12-01-preview. Please use + secrets property instead.""" + secrets: Optional[list["_models.EceDeploymentSecrets"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """secrets used for cloud deployment.""" + optional_services: Optional["_models.OptionalServices"] = rest_field( + name="optionalServices", visibility=["read", "create", "update", "delete", "query"] + ) + """OptionalServices config to deploy AzureStackHCI Cluster.""" + local_availability_zones: Optional[list["_models.LocalAvailabilityZones"]] = rest_field( + name="localAvailabilityZones", visibility=["read", "create", "update", "delete", "query"] + ) + """Local Availability Zone information for HCI cluster.""" + assembly_info: Optional["_models.AssemblyInfo"] = rest_field( + name="assemblyInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """Assembly Package details for Validated Solution Recipe for AzureStackHCI Cluster.""" + + @overload + def __init__( + self, + *, + security_settings: Optional["_models.DeploymentSecuritySettings"] = None, + observability: Optional["_models.Observability"] = None, + cluster: Optional["_models.DeploymentCluster"] = None, + identity_provider: Optional[Union[str, "_models.IdentityProvider"]] = None, + storage: Optional["_models.Storage"] = None, + naming_prefix: Optional[str] = None, + domain_fqdn: Optional[str] = None, + infrastructure_network: Optional[list["_models.InfrastructureNetwork"]] = None, + physical_nodes: Optional[list["_models.PhysicalNodes"]] = None, + host_network: Optional["_models.DeploymentSettingHostNetwork"] = None, + sdn_integration: Optional["_models.SdnIntegration"] = None, + is_management_cluster: Optional[bool] = None, + adou_path: Optional[str] = None, + secrets_location: Optional[str] = None, + secrets: Optional[list["_models.EceDeploymentSecrets"]] = None, + optional_services: Optional["_models.OptionalServices"] = None, + local_availability_zones: Optional[list["_models.LocalAvailabilityZones"]] = None, + assembly_info: Optional["_models.AssemblyInfo"] = 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 DeploymentSecuritySettings(_Model): + """The SecuritySettings of AzureStackHCI Cluster. + + :ivar hvci_protection: By default, Hypervisor-protected Code Integrity is enabled on your Azure + HCI cluster. + :vartype hvci_protection: bool + :ivar drtm_protection: By default, Secure Boot is enabled on your Azure HCI cluster. This + setting is hardware dependent. + :vartype drtm_protection: bool + :ivar drift_control_enforced: When set to true, the security baseline is re-applied regularly. + :vartype drift_control_enforced: bool + :ivar credential_guard_enforced: When set to true, Credential Guard is enabled. + :vartype credential_guard_enforced: bool + :ivar smb_signing_enforced: When set to true, the SMB default instance requires sign in for the + client and server services. + :vartype smb_signing_enforced: bool + :ivar smb_cluster_encryption: When set to true, cluster east-west traffic is encrypted. + :vartype smb_cluster_encryption: bool + :ivar side_channel_mitigation_enforced: When set to true, all the side channel mitigations are + enabled. + :vartype side_channel_mitigation_enforced: bool + :ivar bitlocker_boot_volume: When set to true, BitLocker XTS_AES 256-bit encryption is enabled + for all data-at-rest on the OS volume of your Azure Stack HCI cluster. This setting is + TPM-hardware dependent. + :vartype bitlocker_boot_volume: bool + :ivar bitlocker_data_volumes: When set to true, BitLocker XTS-AES 256-bit encryption is enabled + for all data-at-rest on your Azure Stack HCI cluster shared volumes. + :vartype bitlocker_data_volumes: bool + :ivar wdac_enforced: WDAC is enabled by default and limits the applications and the code that + you can run on your Azure Stack HCI cluster. + :vartype wdac_enforced: bool + """ + + hvci_protection: Optional[bool] = rest_field( + name="hvciProtection", visibility=["read", "create", "update", "delete", "query"] + ) + """By default, Hypervisor-protected Code Integrity is enabled on your Azure HCI cluster.""" + drtm_protection: Optional[bool] = rest_field( + name="drtmProtection", visibility=["read", "create", "update", "delete", "query"] + ) + """By default, Secure Boot is enabled on your Azure HCI cluster. This setting is hardware + dependent.""" + drift_control_enforced: Optional[bool] = rest_field( + name="driftControlEnforced", visibility=["read", "create", "update", "delete", "query"] + ) + """When set to true, the security baseline is re-applied regularly.""" + credential_guard_enforced: Optional[bool] = rest_field( + name="credentialGuardEnforced", visibility=["read", "create", "update", "delete", "query"] + ) + """When set to true, Credential Guard is enabled.""" + smb_signing_enforced: Optional[bool] = rest_field( + name="smbSigningEnforced", visibility=["read", "create", "update", "delete", "query"] + ) + """When set to true, the SMB default instance requires sign in for the client and server services.""" + smb_cluster_encryption: Optional[bool] = rest_field( + name="smbClusterEncryption", visibility=["read", "create", "update", "delete", "query"] + ) + """When set to true, cluster east-west traffic is encrypted.""" + side_channel_mitigation_enforced: Optional[bool] = rest_field( + name="sideChannelMitigationEnforced", visibility=["read", "create", "update", "delete", "query"] + ) + """When set to true, all the side channel mitigations are enabled.""" + bitlocker_boot_volume: Optional[bool] = rest_field( + name="bitlockerBootVolume", visibility=["read", "create", "update", "delete", "query"] + ) + """When set to true, BitLocker XTS_AES 256-bit encryption is enabled for all data-at-rest on the + OS volume of your Azure Stack HCI cluster. This setting is TPM-hardware dependent.""" + bitlocker_data_volumes: Optional[bool] = rest_field( + name="bitlockerDataVolumes", visibility=["read", "create", "update", "delete", "query"] + ) + """When set to true, BitLocker XTS-AES 256-bit encryption is enabled for all data-at-rest on your + Azure Stack HCI cluster shared volumes.""" + wdac_enforced: Optional[bool] = rest_field( + name="wdacEnforced", visibility=["read", "create", "update", "delete", "query"] + ) + """WDAC is enabled by default and limits the applications and the code that you can run on your + Azure Stack HCI cluster.""" + + @overload + def __init__( + self, + *, + hvci_protection: Optional[bool] = None, + drtm_protection: Optional[bool] = None, + drift_control_enforced: Optional[bool] = None, + credential_guard_enforced: Optional[bool] = None, + smb_signing_enforced: Optional[bool] = None, + smb_cluster_encryption: Optional[bool] = None, + side_channel_mitigation_enforced: Optional[bool] = None, + bitlocker_boot_volume: Optional[bool] = None, + bitlocker_data_volumes: Optional[bool] = None, + wdac_enforced: Optional[bool] = 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 DeploymentSetting(ProxyResource): + """Edge device resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.azurestackhci.models.DeploymentSettingsProperties + """ + + properties: Optional["_models.DeploymentSettingsProperties"] = rest_field(visibility=["read", "create"]) + """The resource-specific properties for this resource.""" + + __flattened_items = [ + "provisioning_state", + "arc_node_resource_ids", + "deployment_mode", + "operation_type", + "deployment_configuration", + "reported_properties", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DeploymentSettingsProperties"] = 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 DeploymentSettingAdapterPropertyOverrides(_Model): # pylint: disable=name-too-long + """The AdapterPropertyOverrides of a cluster. + + :ivar jumbo_packet: This parameter should only be modified based on your OEM guidance. Do not + modify this parameter without OEM validation. + :vartype jumbo_packet: str + :ivar network_direct: This parameter should only be modified based on your OEM guidance. Do not + modify this parameter without OEM validation. + :vartype network_direct: str + :ivar network_direct_technology: This parameter should only be modified based on your OEM + guidance. Do not modify this parameter without OEM validation. Expected values are 'iWARP', + 'RoCEv2', 'RoCE'. + :vartype network_direct_technology: str + """ + + jumbo_packet: Optional[str] = rest_field( + name="jumboPacket", visibility=["read", "create", "update", "delete", "query"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + network_direct: Optional[str] = rest_field( + name="networkDirect", visibility=["read", "create", "update", "delete", "query"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + network_direct_technology: Optional[str] = rest_field( + name="networkDirectTechnology", visibility=["read", "create", "update", "delete", "query"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation. Expected values are 'iWARP', 'RoCEv2', 'RoCE'.""" + + @overload + def __init__( + self, + *, + jumbo_packet: Optional[str] = None, + network_direct: Optional[str] = None, + network_direct_technology: 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 DeploymentSettingHostNetwork(_Model): + """The HostNetwork of a cluster. + + :ivar intents: The network intents assigned to the network reference pattern used for the + deployment. Each intent will define its own name, traffic type, adapter names, and overrides as + recommended by your OEM. + :vartype intents: list[~azure.mgmt.azurestackhci.models.DeploymentSettingIntents] + :ivar storage_networks: List of StorageNetworks config to deploy AzureStackHCI Cluster. + :vartype storage_networks: + list[~azure.mgmt.azurestackhci.models.DeploymentSettingStorageNetworks] + :ivar storage_connectivity_switchless: Defines how the storage adapters between nodes are + connected either switch or switch less.. + :vartype storage_connectivity_switchless: bool + :ivar enable_storage_auto_ip: Optional parameter required only for 3 Nodes Switchless + deployments. This allows users to specify IPs and Mask for Storage NICs when Network ATC is not + assigning the IPs for storage automatically. + :vartype enable_storage_auto_ip: bool + """ + + intents: Optional[list["_models.DeploymentSettingIntents"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The network intents assigned to the network reference pattern used for the deployment. Each + intent will define its own name, traffic type, adapter names, and overrides as recommended by + your OEM.""" + storage_networks: Optional[list["_models.DeploymentSettingStorageNetworks"]] = rest_field( + name="storageNetworks", visibility=["read", "create", "update", "delete", "query"] + ) + """List of StorageNetworks config to deploy AzureStackHCI Cluster.""" + storage_connectivity_switchless: Optional[bool] = rest_field( + name="storageConnectivitySwitchless", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines how the storage adapters between nodes are connected either switch or switch less..""" + enable_storage_auto_ip: Optional[bool] = rest_field( + name="enableStorageAutoIp", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional parameter required only for 3 Nodes Switchless deployments. This allows users to + specify IPs and Mask for Storage NICs when Network ATC is not assigning the IPs for storage + automatically.""" + + @overload + def __init__( + self, + *, + intents: Optional[list["_models.DeploymentSettingIntents"]] = None, + storage_networks: Optional[list["_models.DeploymentSettingStorageNetworks"]] = None, + storage_connectivity_switchless: Optional[bool] = None, + enable_storage_auto_ip: Optional[bool] = 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 DeploymentSettingIntents(_Model): + """The Intents of a cluster. + + :ivar name: Name of the network intent you wish to create. + :vartype name: str + :ivar traffic_type: List of network traffic types. Only allowed values are 'Compute', + 'Storage', 'Management'. + :vartype traffic_type: list[str] + :ivar adapter: Array of network interfaces used for the network intent. + :vartype adapter: list[str] + :ivar override_virtual_switch_configuration: This parameter should only be modified based on + your OEM guidance. Do not modify this parameter without OEM validation. + :vartype override_virtual_switch_configuration: bool + :ivar virtual_switch_configuration_overrides: Set virtualSwitch ConfigurationOverrides for + cluster. + :vartype virtual_switch_configuration_overrides: + ~azure.mgmt.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides + :ivar override_qos_policy: This parameter should only be modified based on your OEM guidance. + Do not modify this parameter without OEM validation. + :vartype override_qos_policy: bool + :ivar qos_policy_overrides: Set QoS PolicyOverrides for cluster. + :vartype qos_policy_overrides: ~azure.mgmt.azurestackhci.models.QosPolicyOverrides + :ivar override_adapter_property: This parameter should only be modified based on your OEM + guidance. Do not modify this parameter without OEM validation. + :vartype override_adapter_property: bool + :ivar adapter_property_overrides: Set Adapter PropertyOverrides for cluster. + :vartype adapter_property_overrides: + ~azure.mgmt.azurestackhci.models.DeploymentSettingAdapterPropertyOverrides + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the network intent you wish to create.""" + traffic_type: Optional[list[str]] = rest_field( + name="trafficType", visibility=["read", "create", "update", "delete", "query"] + ) + """List of network traffic types. Only allowed values are 'Compute', 'Storage', 'Management'.""" + adapter: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Array of network interfaces used for the network intent.""" + override_virtual_switch_configuration: Optional[bool] = rest_field( + name="overrideVirtualSwitchConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + virtual_switch_configuration_overrides: Optional["_models.DeploymentSettingVirtualSwitchConfigurationOverrides"] = ( + rest_field( + name="virtualSwitchConfigurationOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + ) + """Set virtualSwitch ConfigurationOverrides for cluster.""" + override_qos_policy: Optional[bool] = rest_field( + name="overrideQosPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + qos_policy_overrides: Optional["_models.QosPolicyOverrides"] = rest_field( + name="qosPolicyOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """Set QoS PolicyOverrides for cluster.""" + override_adapter_property: Optional[bool] = rest_field( + name="overrideAdapterProperty", visibility=["read", "create", "update", "delete", "query"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + adapter_property_overrides: Optional["_models.DeploymentSettingAdapterPropertyOverrides"] = rest_field( + name="adapterPropertyOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """Set Adapter PropertyOverrides for cluster.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + traffic_type: Optional[list[str]] = None, + adapter: Optional[list[str]] = None, + override_virtual_switch_configuration: Optional[bool] = None, + virtual_switch_configuration_overrides: Optional[ + "_models.DeploymentSettingVirtualSwitchConfigurationOverrides" + ] = None, + override_qos_policy: Optional[bool] = None, + qos_policy_overrides: Optional["_models.QosPolicyOverrides"] = None, + override_adapter_property: Optional[bool] = None, + adapter_property_overrides: Optional["_models.DeploymentSettingAdapterPropertyOverrides"] = 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 DeploymentSettingsProperties(_Model): + """DeploymentSetting properties. + + :ivar provisioning_state: DeploymentSetting provisioning state. Known values are: + "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar arc_node_resource_ids: Azure resource ids of Arc machines to be part of cluster. + Required. + :vartype arc_node_resource_ids: list[str] + :ivar deployment_mode: The deployment mode for cluster deployment. Required. Known values are: + "Validate" and "Deploy". + :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode + :ivar operation_type: The intended operation for a cluster. Known values are: + "ClusterProvisioning" and "ClusterUpgrade". + :vartype operation_type: str or ~azure.mgmt.azurestackhci.models.OperationType + :ivar deployment_configuration: Scale units will contains list of deployment data. Required. + :vartype deployment_configuration: ~azure.mgmt.azurestackhci.models.DeploymentConfiguration + :ivar reported_properties: Deployment Status reported from cluster. + :vartype reported_properties: ~azure.mgmt.azurestackhci.models.EceReportedProperties + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """DeploymentSetting provisioning state. Known values are: \"NotSpecified\", \"Error\", + \"Succeeded\", \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", + \"Creating\", \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", + \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", and + \"DisableInProgress\".""" + arc_node_resource_ids: list[str] = rest_field( + name="arcNodeResourceIds", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure resource ids of Arc machines to be part of cluster. Required.""" + deployment_mode: Union[str, "_models.DeploymentMode"] = rest_field( + name="deploymentMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The deployment mode for cluster deployment. Required. Known values are: \"Validate\" and + \"Deploy\".""" + operation_type: Optional[Union[str, "_models.OperationType"]] = rest_field( + name="operationType", visibility=["read", "create", "update", "delete", "query"] + ) + """The intended operation for a cluster. Known values are: \"ClusterProvisioning\" and + \"ClusterUpgrade\".""" + deployment_configuration: "_models.DeploymentConfiguration" = rest_field( + name="deploymentConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Scale units will contains list of deployment data. Required.""" + reported_properties: Optional["_models.EceReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read"] + ) + """Deployment Status reported from cluster.""" + + @overload + def __init__( + self, + *, + arc_node_resource_ids: list[str], + deployment_mode: Union[str, "_models.DeploymentMode"], + deployment_configuration: "_models.DeploymentConfiguration", + operation_type: Optional[Union[str, "_models.OperationType"]] = 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 DeploymentSettingStorageAdapterIPInfo(_Model): + """The StorageAdapter physical nodes of a cluster. + + :ivar physical_node: storage adapter physical node name. + :vartype physical_node: str + :ivar ipv4_address: The IPv4 address assigned to each storage adapter physical node on your + Azure Stack HCI cluster. + :vartype ipv4_address: str + :ivar subnet_mask: The SubnetMask address assigned to each storage adapter physical node on + your Azure Stack HCI cluster. + :vartype subnet_mask: str + """ + + physical_node: Optional[str] = rest_field( + name="physicalNode", visibility=["read", "create", "update", "delete", "query"] + ) + """storage adapter physical node name.""" + ipv4_address: Optional[str] = rest_field( + name="ipv4Address", visibility=["read", "create", "update", "delete", "query"] + ) + """The IPv4 address assigned to each storage adapter physical node on your Azure Stack HCI + cluster.""" + subnet_mask: Optional[str] = rest_field( + name="subnetMask", visibility=["read", "create", "update", "delete", "query"] + ) + """The SubnetMask address assigned to each storage adapter physical node on your Azure Stack HCI + cluster.""" + + @overload + def __init__( + self, + *, + physical_node: Optional[str] = None, + ipv4_address: Optional[str] = None, + subnet_mask: 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 DeploymentSettingStorageNetworks(_Model): + """The StorageNetworks of a cluster. + + :ivar name: Name of the storage network. + :vartype name: str + :ivar network_adapter_name: Name of the storage network adapter. + :vartype network_adapter_name: str + :ivar vlan_id: ID specified for the VLAN storage network. This setting is applied to the + network interfaces that route the storage and VM migration traffic. + :vartype vlan_id: str + :ivar storage_adapter_ip_info: List of Storage adapter physical nodes config to deploy + AzureStackHCI Cluster. + :vartype storage_adapter_ip_info: + list[~azure.mgmt.azurestackhci.models.DeploymentSettingStorageAdapterIPInfo] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the storage network.""" + network_adapter_name: Optional[str] = rest_field( + name="networkAdapterName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the storage network adapter.""" + vlan_id: Optional[str] = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """ID specified for the VLAN storage network. This setting is applied to the network interfaces + that route the storage and VM migration traffic.""" + storage_adapter_ip_info: Optional[list["_models.DeploymentSettingStorageAdapterIPInfo"]] = rest_field( + name="storageAdapterIPInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """List of Storage adapter physical nodes config to deploy AzureStackHCI Cluster.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + network_adapter_name: Optional[str] = None, + vlan_id: Optional[str] = None, + storage_adapter_ip_info: Optional[list["_models.DeploymentSettingStorageAdapterIPInfo"]] = 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 DeploymentSettingVirtualSwitchConfigurationOverrides(_Model): # pylint: disable=name-too-long + """The VirtualSwitchConfigurationOverrides of a cluster. + + :ivar enable_iov: Enable IoV for Virtual Switch. + :vartype enable_iov: str + :ivar load_balancing_algorithm: Load Balancing Algorithm for Virtual Switch. + :vartype load_balancing_algorithm: str + """ + + enable_iov: Optional[str] = rest_field(name="enableIov", visibility=["read", "create", "update", "delete", "query"]) + """Enable IoV for Virtual Switch.""" + load_balancing_algorithm: Optional[str] = rest_field( + name="loadBalancingAlgorithm", visibility=["read", "create", "update", "delete", "query"] + ) + """Load Balancing Algorithm for Virtual Switch.""" + + @overload + def __init__( + self, + *, + enable_iov: Optional[str] = None, + load_balancing_algorithm: 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 DeploymentStep(_Model): + """The Step of AzureStackHCI Cluster. + + :ivar name: Name of step. + :vartype name: str + :ivar description: Description of step. + :vartype description: str + :ivar full_step_index: FullStepIndex of step. + :vartype full_step_index: str + :ivar start_time_utc: Start time of step. + :vartype start_time_utc: str + :ivar end_time_utc: End time of step. + :vartype end_time_utc: str + :ivar status: Status of step. Allowed values are 'Error', 'Success', 'InProgress'. + :vartype status: str + :ivar steps: List of nested steps of AzureStackHCI Cluster Deployment. + :vartype steps: list[~azure.mgmt.azurestackhci.models.DeploymentStep] + :ivar exception: List of exceptions in AzureStackHCI Cluster Deployment. + :vartype exception: list[str] + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Name of step.""" + description: Optional[str] = rest_field(visibility=["read"]) + """Description of step.""" + full_step_index: Optional[str] = rest_field(name="fullStepIndex", visibility=["read"]) + """FullStepIndex of step.""" + start_time_utc: Optional[str] = rest_field(name="startTimeUtc", visibility=["read"]) + """Start time of step.""" + end_time_utc: Optional[str] = rest_field(name="endTimeUtc", visibility=["read"]) + """End time of step.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Status of step. Allowed values are 'Error', 'Success', 'InProgress'.""" + steps: Optional[list["_models.DeploymentStep"]] = rest_field(visibility=["read"]) + """List of nested steps of AzureStackHCI Cluster Deployment.""" + exception: Optional[list[str]] = rest_field(visibility=["read"]) + """List of exceptions in AzureStackHCI Cluster Deployment.""" + + +class DeviceConfiguration(_Model): + """The device Configuration for edge device. + + :ivar nic_details: NIC Details of device. + :vartype nic_details: list[~azure.mgmt.azurestackhci.models.NicDetail] + :ivar device_metadata: Device metadata details. + :vartype device_metadata: str + """ + + nic_details: Optional[list["_models.NicDetail"]] = rest_field( + name="nicDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """NIC Details of device.""" + device_metadata: Optional[str] = rest_field( + name="deviceMetadata", visibility=["read", "create", "update", "delete", "query"] + ) + """Device metadata details.""" + + @overload + def __init__( + self, + *, + nic_details: Optional[list["_models.NicDetail"]] = None, + device_metadata: 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 DnsZones(_Model): + """Details of the DNS Zones to be configured. + + :ivar dns_zone_name: Name of the DNS Zone to be configured. + :vartype dns_zone_name: str + :ivar dns_forwarder: Forwarder details of the DNS Zone to be configured. + :vartype dns_forwarder: list[str] + """ + + dns_zone_name: Optional[str] = rest_field( + name="dnsZoneName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the DNS Zone to be configured.""" + dns_forwarder: Optional[list[str]] = rest_field( + name="dnsForwarder", visibility=["read", "create", "update", "delete", "query"] + ) + """Forwarder details of the DNS Zone to be configured.""" + + @overload + def __init__( + self, + *, + dns_zone_name: Optional[str] = None, + dns_forwarder: 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 EdgeMachineJobProperties(_Model): + """EdgeMachine Job properties. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + EdgeMachineCollectLogJobProperties, DownloadOsJobProperties, ProvisionOsJobProperties, + EdgeMachineRemoteSupportJobProperties + + :ivar job_type: Job Type to support polymorphic resource. Required. Known values are: + "CollectLog", "RemoteSupport", "ProvisionOs", and "DownloadOs". + :vartype job_type: str or ~azure.mgmt.azurestackhci.models.EdgeMachineJobType + :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and + "Deploy". + :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode + :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar job_id: Unique, immutable job id. + :vartype job_id: str + :ivar start_time_utc: The UTC date and time at which the job started. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The UTC date and time at which the job completed. + :vartype end_time_utc: ~datetime.datetime + :ivar status: Status of Edge device job. Known values are: "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and + "Scheduled". + :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus + :ivar error: error details. + :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + """ + + __mapping__: dict[str, _Model] = {} + job_type: str = rest_discriminator(name="jobType", visibility=["read", "create"]) + """Job Type to support polymorphic resource. Required. Known values are: \"CollectLog\", + \"RemoteSupport\", \"ProvisionOs\", and \"DownloadOs\".""" + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = rest_field( + name="deploymentMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Deployment mode to trigger job. Known values are: \"Validate\" and \"Deploy\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Job provisioning state. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", + \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", + \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", + \"InProgress\", \"Accepted\", \"Provisioning\", and \"DisableInProgress\".""" + job_id: Optional[str] = rest_field(name="jobId", visibility=["read"]) + """Unique, immutable job id.""" + start_time_utc: Optional[datetime.datetime] = rest_field(name="startTimeUtc", visibility=["read"], format="rfc3339") + """The UTC date and time at which the job started.""" + end_time_utc: Optional[datetime.datetime] = rest_field(name="endTimeUtc", visibility=["read"], format="rfc3339") + """The UTC date and time at which the job completed.""" + status: Optional[Union[str, "_models.JobStatus"]] = rest_field(visibility=["read"]) + """Status of Edge device job. Known values are: \"NotSpecified\", \"ValidationInProgress\", + \"ValidationSuccess\", \"ValidationFailed\", \"DeploymentInProgress\", \"DeploymentFailed\", + \"DeploymentSuccess\", \"Succeeded\", \"Failed\", \"Canceled\", \"Paused\", and \"Scheduled\".""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read"]) + """error details.""" + + @overload + def __init__( + self, + *, + job_type: str, + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DownloadOsJobProperties(EdgeMachineJobProperties, discriminator="DownloadOs"): + """Represents the properties of Download Os job. + + :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and + "Deploy". + :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode + :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar job_id: Unique, immutable job id. + :vartype job_id: str + :ivar start_time_utc: The UTC date and time at which the job started. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The UTC date and time at which the job completed. + :vartype end_time_utc: ~datetime.datetime + :ivar status: Status of Edge device job. Known values are: "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and + "Scheduled". + :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus + :ivar error: error details. + :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + :ivar job_type: Job Type to support polymorphic resource. Required. Job to download OS packages + on to the device + :vartype job_type: str or ~azure.mgmt.azurestackhci.models.DOWNLOAD_OS + :ivar download_request: Download OS request. Required. + :vartype download_request: ~azure.mgmt.azurestackhci.models.DownloadRequest + :ivar reported_properties: Reported Properties for Download Os job. + :vartype reported_properties: ~azure.mgmt.azurestackhci.models.ProvisionOsReportedProperties + """ + + job_type: Literal[EdgeMachineJobType.DOWNLOAD_OS] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Job Type to support polymorphic resource. Required. Job to download OS packages on to the + device""" + download_request: "_models.DownloadRequest" = rest_field( + name="downloadRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """Download OS request. Required.""" + reported_properties: Optional["_models.ProvisionOsReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Reported Properties for Download Os job.""" + + @overload + def __init__( + self, + *, + download_request: "_models.DownloadRequest", + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + reported_properties: Optional["_models.ProvisionOsReportedProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_type = EdgeMachineJobType.DOWNLOAD_OS # type: ignore + + +class DownloadOsProfile(_Model): + """Operating system profile. + + :ivar os_name: Name of the operating system. + :vartype os_name: str + :ivar os_type: Type of the operating system. + :vartype os_type: str + :ivar os_version: Version of the operating system. + :vartype os_version: str + :ivar os_image_location: Location of the operating system image. + :vartype os_image_location: str + :ivar vsr_version: Validated Solution Recipe version to be used for the job. + :vartype vsr_version: str + :ivar image_hash: Hash of the OS package downloaded. + :vartype image_hash: str + :ivar gpg_pub_key: GPG Public Key used for package verification. + :vartype gpg_pub_key: str + """ + + os_name: Optional[str] = rest_field(name="osName", visibility=["read", "create", "update", "delete", "query"]) + """Name of the operating system.""" + os_type: Optional[str] = rest_field(name="osType", visibility=["read", "create", "update", "delete", "query"]) + """Type of the operating system.""" + os_version: Optional[str] = rest_field(name="osVersion", visibility=["read", "create", "update", "delete", "query"]) + """Version of the operating system.""" + os_image_location: Optional[str] = rest_field( + name="osImageLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Location of the operating system image.""" + vsr_version: Optional[str] = rest_field( + name="vsrVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Validated Solution Recipe version to be used for the job.""" + image_hash: Optional[str] = rest_field(name="imageHash", visibility=["read", "create", "update", "delete", "query"]) + """Hash of the OS package downloaded.""" + gpg_pub_key: Optional[str] = rest_field( + name="gpgPubKey", visibility=["read", "create", "update", "delete", "query"] + ) + """GPG Public Key used for package verification.""" + + @overload + def __init__( + self, + *, + os_name: Optional[str] = None, + os_type: Optional[str] = None, + os_version: Optional[str] = None, + os_image_location: Optional[str] = None, + vsr_version: Optional[str] = None, + image_hash: Optional[str] = None, + gpg_pub_key: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DownloadRequest(_Model): + """Download Request properties. + + :ivar target: Target operating system to support polymorphic resource. Required. Known values + are: "AzureLinux" and "HCI". + :vartype target: str or ~azure.mgmt.azurestackhci.models.ProvisioningOsType + :ivar os_profile: Operating system profile. Required. + :vartype os_profile: ~azure.mgmt.azurestackhci.models.DownloadOsProfile + """ + + target: Union[str, "_models.ProvisioningOsType"] = rest_field(visibility=["read", "create"]) + """Target operating system to support polymorphic resource. Required. Known values are: + \"AzureLinux\" and \"HCI\".""" + os_profile: "_models.DownloadOsProfile" = rest_field( + name="osProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Operating system profile. Required.""" + + @overload + def __init__( + self, + *, + target: Union[str, "_models.ProvisioningOsType"], + os_profile: "_models.DownloadOsProfile", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EceActionStatus(_Model): + """The ECE action plan deployment status for AzureStackHCI Cluster. + + :ivar status: Status of ECE action AzureStackHCI Cluster Deployment. + :vartype status: str + :ivar steps: List of steps of AzureStackHCI Cluster Deployment. + :vartype steps: list[~azure.mgmt.azurestackhci.models.DeploymentStep] + """ + + status: Optional[str] = rest_field(visibility=["read"]) + """Status of ECE action AzureStackHCI Cluster Deployment.""" + steps: Optional[list["_models.DeploymentStep"]] = rest_field(visibility=["read"]) + """List of steps of AzureStackHCI Cluster Deployment.""" + + +class EceDeploymentSecrets(_Model): + """Protected parameters list stored in keyvault. + + :ivar secret_name: Secret name stored in keyvault. + :vartype secret_name: str + :ivar ece_secret_name: Secret name expected for Enterprise Cloud Engine (ECE) deployment. Known + values are: "AzureStackLCMUserCredential", "DefaultARBApplication", "LocalAdminCredential", and + "WitnessStorageKey". + :vartype ece_secret_name: str or ~azure.mgmt.azurestackhci.models.EceSecrets + :ivar secret_location: Secret URI stored in keyvault. + :vartype secret_location: str + """ + + secret_name: Optional[str] = rest_field( + name="secretName", visibility=["read", "create", "update", "delete", "query"] + ) + """Secret name stored in keyvault.""" + ece_secret_name: Optional[Union[str, "_models.EceSecrets"]] = rest_field( + name="eceSecretName", visibility=["read", "create", "update", "delete", "query"] + ) + """Secret name expected for Enterprise Cloud Engine (ECE) deployment. Known values are: + \"AzureStackLCMUserCredential\", \"DefaultARBApplication\", \"LocalAdminCredential\", and + \"WitnessStorageKey\".""" + secret_location: Optional[str] = rest_field( + name="secretLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Secret URI stored in keyvault.""" + + @overload + def __init__( + self, + *, + secret_name: Optional[str] = None, + ece_secret_name: Optional[Union[str, "_models.EceSecrets"]] = None, + secret_location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EceReportedProperties(_Model): + """The DeploymentStatus of AzureStackHCI Cluster. + + :ivar validation_status: validation status of AzureStackHCI Cluster Deployment. + :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar deployment_status: Deployment status of AzureStackHCI Cluster Deployment. + :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + """ + + validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) + """validation status of AzureStackHCI Cluster Deployment.""" + deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) + """Deployment status of AzureStackHCI Cluster Deployment.""" + + +class ExtensionResource(Resource): + """The base extension resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + """ + + +class EdgeDevice(ExtensionResource): + """Edge device resource. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + HciEdgeDevice + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. Required. "HCI" + :vartype kind: str or ~azure.mgmt.azurestackhci.models.DeviceKind + """ + + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create"]) + """Metadata used by portal/tooling/etc to render different UX experiences for resources of the + same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource + provider must validate and persist this value. Required. \"HCI\"""" + + @overload + def __init__( + self, + *, + kind: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EdgeDeviceJob(ExtensionResource): + """EdgeDevice Jobs resource. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + HciEdgeDeviceJob + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar kind: Metadata used by portal/tooling/etc to render different UX experiences for + resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, + the resource provider must validate and persist this value. Required. "HCI" + :vartype kind: str or ~azure.mgmt.azurestackhci.models.EdgeDeviceKind + """ + + __mapping__: dict[str, _Model] = {} + kind: str = rest_discriminator(name="kind", visibility=["read", "create"]) + """Metadata used by portal/tooling/etc to render different UX experiences for resources of the + same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource + provider must validate and persist this value. Required. \"HCI\"""" + + @overload + def __init__( + self, + *, + kind: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EdgeDeviceProperties(_Model): + """Edge Device properties. + + :ivar device_configuration: Device Configuration. + :vartype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration + :ivar provisioning_state: Provisioning state of edgeDevice resource. Known values are: + "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + """ + + device_configuration: Optional["_models.DeviceConfiguration"] = rest_field( + name="deviceConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Device Configuration.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of edgeDevice resource. Known values are: \"NotSpecified\", \"Error\", + \"Succeeded\", \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", + \"Creating\", \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", + \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", and + \"DisableInProgress\".""" + + @overload + def __init__( + self, + *, + device_configuration: Optional["_models.DeviceConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EdgeMachine(TrackedResource): + """EdgeMachine details. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.azurestackhci.models.EdgeMachineProperties + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.azurestackhci.models.ManagedServiceIdentity + """ + + properties: Optional["_models.EdgeMachineProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.EdgeMachineProperties"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EdgeMachineCollectLogJobProperties(EdgeMachineJobProperties, discriminator="CollectLog"): + """Properties for pausing a server in the cluster. + + :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and + "Deploy". + :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode + :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar job_id: Unique, immutable job id. + :vartype job_id: str + :ivar start_time_utc: The UTC date and time at which the job started. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The UTC date and time at which the job completed. + :vartype end_time_utc: ~datetime.datetime + :ivar status: Status of Edge device job. Known values are: "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and + "Scheduled". + :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus + :ivar error: error details. + :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + :ivar job_type: ClusterJob Type to support polymorphic resource. Required. Job to collect logs + from the device. + :vartype job_type: str or ~azure.mgmt.azurestackhci.models.COLLECT_LOG + :ivar from_date: From date for log collection. Required. + :vartype from_date: ~datetime.datetime + :ivar to_date: To date for log collection. Required. + :vartype to_date: ~datetime.datetime + :ivar last_log_generated: To date for log collection. + :vartype last_log_generated: ~datetime.datetime + :ivar reported_properties: log collection job reported properties. + :vartype reported_properties: + ~azure.mgmt.azurestackhci.models.EdgeMachineCollectLogJobReportedProperties + """ + + job_type: Literal[EdgeMachineJobType.COLLECT_LOG] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """ClusterJob Type to support polymorphic resource. Required. Job to collect logs from the device.""" + from_date: datetime.datetime = rest_field( + name="fromDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """From date for log collection. Required.""" + to_date: datetime.datetime = rest_field( + name="toDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """To date for log collection. Required.""" + last_log_generated: Optional[datetime.datetime] = rest_field( + name="lastLogGenerated", visibility=["read"], format="rfc3339" + ) + """To date for log collection.""" + reported_properties: Optional["_models.EdgeMachineCollectLogJobReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read"] + ) + """log collection job reported properties.""" + + @overload + def __init__( + self, + *, + from_date: datetime.datetime, + to_date: datetime.datetime, + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_type = EdgeMachineJobType.COLLECT_LOG # type: ignore + + +class EdgeMachineCollectLogJobReportedProperties(_Model): # pylint: disable=name-too-long + """Represents the reported properties of a log collection job. + + :ivar percent_complete: The percentage of the job that is complete. + :vartype percent_complete: int + :ivar validation_status: Validation status of job. + :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar deployment_status: Deployment status of job. + :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar log_collection_session_details: Details of the log collection session. + :vartype log_collection_session_details: + list[~azure.mgmt.azurestackhci.models.LogCollectionJobSession] + """ + + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the job that is complete.""" + validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) + """Validation status of job.""" + deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) + """Deployment status of job.""" + log_collection_session_details: Optional[list["_models.LogCollectionJobSession"]] = rest_field( + name="logCollectionSessionDetails", visibility=["read"] + ) + """Details of the log collection session.""" + + +class EdgeMachineJob(ProxyResource): + """Cluster Jobs resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.azurestackhci.models.EdgeMachineJobProperties + """ + + properties: Optional["_models.EdgeMachineJobProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.EdgeMachineJobProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EdgeMachineNetworkProfile(_Model): + """NetworkProfile of edge machine. + + :ivar nic_details: List of Network Interface Card (NIC) Details of edge machine. + :vartype nic_details: list[~azure.mgmt.azurestackhci.models.EdgeMachineNicDetail] + :ivar switch_details: List of switch Details of edge machine. + :vartype switch_details: list[~azure.mgmt.azurestackhci.models.SwitchDetail] + """ + + nic_details: Optional[list["_models.EdgeMachineNicDetail"]] = rest_field(name="nicDetails", visibility=["read"]) + """List of Network Interface Card (NIC) Details of edge machine.""" + switch_details: Optional[list["_models.SwitchDetail"]] = rest_field(name="switchDetails", visibility=["read"]) + """List of switch Details of edge machine.""" + + +class EdgeMachineNicDetail(_Model): + """Network Interface Card (NIC) Details of edge machine. + + :ivar adapter_name: Adapter Name of NIC. + :vartype adapter_name: str + :ivar interface_description: Interface Description of NIC. + :vartype interface_description: str + :ivar component_id: Component Id of NIC. + :vartype component_id: str + :ivar driver_version: Driver Version of NIC. + :vartype driver_version: str + :ivar ip4_address: Subnet Mask of NIC. + :vartype ip4_address: str + :ivar subnet_mask: Subnet Mask of NIC. + :vartype subnet_mask: str + :ivar default_gateway: Default Gateway of NIC. + :vartype default_gateway: str + :ivar dns_servers: DNS Servers for NIC. + :vartype dns_servers: list[str] + :ivar default_isolation_id: Default Isolation of Management NIC. + :vartype default_isolation_id: str + :ivar mac_address: MAC address information of NIC. + :vartype mac_address: str + :ivar slot: The slot attached to the NIC. + :vartype slot: str + :ivar switch_name: The switch attached to the NIC, if any. + :vartype switch_name: str + :ivar nic_type: The type of NIC, physical, virtual, management. + :vartype nic_type: str + :ivar vlan_id: The VLAN ID of the physical NIC. + :vartype vlan_id: str + :ivar nic_status: The status of NIC, up, disconnected. + :vartype nic_status: str + :ivar rdma_capability: Describes the RDMA capability of the network adapter. Known values are: + "Enabled" and "Disabled". + :vartype rdma_capability: str or ~azure.mgmt.azurestackhci.models.RdmaCapability + """ + + adapter_name: Optional[str] = rest_field(name="adapterName", visibility=["read"]) + """Adapter Name of NIC.""" + interface_description: Optional[str] = rest_field(name="interfaceDescription", visibility=["read"]) + """Interface Description of NIC.""" + component_id: Optional[str] = rest_field(name="componentId", visibility=["read"]) + """Component Id of NIC.""" + driver_version: Optional[str] = rest_field(name="driverVersion", visibility=["read"]) + """Driver Version of NIC.""" + ip4_address: Optional[str] = rest_field(name="ip4Address", visibility=["read"]) + """Subnet Mask of NIC.""" + subnet_mask: Optional[str] = rest_field(name="subnetMask", visibility=["read"]) + """Subnet Mask of NIC.""" + default_gateway: Optional[str] = rest_field(name="defaultGateway", visibility=["read"]) + """Default Gateway of NIC.""" + dns_servers: Optional[list[str]] = rest_field(name="dnsServers", visibility=["read"]) + """DNS Servers for NIC.""" + default_isolation_id: Optional[str] = rest_field(name="defaultIsolationId", visibility=["read"]) + """Default Isolation of Management NIC.""" + mac_address: Optional[str] = rest_field(name="macAddress", visibility=["read"]) + """MAC address information of NIC.""" + slot: Optional[str] = rest_field(visibility=["read"]) + """The slot attached to the NIC.""" + switch_name: Optional[str] = rest_field(name="switchName", visibility=["read"]) + """The switch attached to the NIC, if any.""" + nic_type: Optional[str] = rest_field(name="nicType", visibility=["read"]) + """The type of NIC, physical, virtual, management.""" + vlan_id: Optional[str] = rest_field(name="vlanId", visibility=["read"]) + """The VLAN ID of the physical NIC.""" + nic_status: Optional[str] = rest_field(name="nicStatus", visibility=["read"]) + """The status of NIC, up, disconnected.""" + rdma_capability: Optional[Union[str, "_models.RdmaCapability"]] = rest_field( + name="rdmaCapability", visibility=["read"] + ) + """Describes the RDMA capability of the network adapter. Known values are: \"Enabled\" and + \"Disabled\".""" + + +class EdgeMachinePatch(_Model): + """Model for patching edge machine. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: ~azure.mgmt.azurestackhci.models.ManagedServiceIdentity + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The managed service identities assigned to this resource.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EdgeMachineProperties(_Model): + """Properties for edge machine. + + :ivar edge_machine_kind: Edge Machine type. Known values are: "Standard" and "Dedicated". + :vartype edge_machine_kind: str or ~azure.mgmt.azurestackhci.models.EdgeMachineKind + :ivar provisioning_state: The provisioning state of a resource. Known values are: + "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar cloud_id: Unique, immutable resource id. + :vartype cloud_id: str + :ivar arc_machine_resource_group_id: Optional property to create arc machine in custom resource + group. + :vartype arc_machine_resource_group_id: str + :ivar arc_machine_resource_id: Arc machine instance resource id. + :vartype arc_machine_resource_id: str + :ivar arc_gateway_resource_id: Link to Arc Gateway ARM resource Id. + :vartype arc_gateway_resource_id: str + :ivar site_details: Service fetches common configuration from site. + :vartype site_details: ~azure.mgmt.azurestackhci.models.SiteDetails + :ivar ownership_voucher_details: Ownership voucher details for provisioned machine. + :vartype ownership_voucher_details: ~azure.mgmt.azurestackhci.models.OwnershipVoucherDetails + :ivar provisioning_details: Details for device provisioning. + :vartype provisioning_details: ~azure.mgmt.azurestackhci.models.ProvisioningDetails + :ivar device_pool_resource_id: A machine can only be assigned to single device pool. + :vartype device_pool_resource_id: str + :ivar machine_state: OS configuration status details. Known values are: "Created", + "Registering", "Unpurposed", "Transitioning", "Purposed", "Updating", "Resetting", "Failed", + and "Preparing". + :vartype machine_state: str or ~azure.mgmt.azurestackhci.models.EdgeMachineState + :ivar connectivity_status: machine connectivity status. Known values are: "NotSpecified", + "Disconnected", and "Connected". + :vartype connectivity_status: str or + ~azure.mgmt.azurestackhci.models.EdgeMachineConnectivityStatus + :ivar claimed_by: Tracks the ID of the consuming resource, setting the machine as in-use. + :vartype claimed_by: str + :ivar reported_properties: Reported properties for edge machine. + :vartype reported_properties: ~azure.mgmt.azurestackhci.models.EdgeMachineReportedProperties + :ivar operation_details: operation status details for edge machine. + :vartype operation_details: list[~azure.mgmt.azurestackhci.models.OperationDetail] + :ivar last_sync_timestamp: Last time data updated to service. + :vartype last_sync_timestamp: ~datetime.datetime + """ + + edge_machine_kind: Optional[Union[str, "_models.EdgeMachineKind"]] = rest_field( + name="edgeMachineKind", visibility=["read", "create"] + ) + """Edge Machine type. Known values are: \"Standard\" and \"Dedicated\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The provisioning state of a resource. Known values are: \"NotSpecified\", \"Error\", + \"Succeeded\", \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", + \"Creating\", \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", + \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", and + \"DisableInProgress\".""" + cloud_id: Optional[str] = rest_field(name="cloudId", visibility=["read"]) + """Unique, immutable resource id.""" + arc_machine_resource_group_id: Optional[str] = rest_field( + name="arcMachineResourceGroupId", visibility=["read", "create"] + ) + """Optional property to create arc machine in custom resource group.""" + arc_machine_resource_id: Optional[str] = rest_field( + name="arcMachineResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Arc machine instance resource id.""" + arc_gateway_resource_id: Optional[str] = rest_field(name="arcGatewayResourceId", visibility=["read", "create"]) + """Link to Arc Gateway ARM resource Id.""" + site_details: Optional["_models.SiteDetails"] = rest_field(name="siteDetails", visibility=["read", "create"]) + """Service fetches common configuration from site.""" + ownership_voucher_details: Optional["_models.OwnershipVoucherDetails"] = rest_field( + name="ownershipVoucherDetails", visibility=["read", "create"] + ) + """Ownership voucher details for provisioned machine.""" + provisioning_details: Optional["_models.ProvisioningDetails"] = rest_field( + name="provisioningDetails", visibility=["read", "create"] + ) + """Details for device provisioning.""" + device_pool_resource_id: Optional[str] = rest_field(name="devicePoolResourceId", visibility=["read"]) + """A machine can only be assigned to single device pool.""" + machine_state: Optional[Union[str, "_models.EdgeMachineState"]] = rest_field( + name="machineState", visibility=["read"] + ) + """OS configuration status details. Known values are: \"Created\", \"Registering\", + \"Unpurposed\", \"Transitioning\", \"Purposed\", \"Updating\", \"Resetting\", \"Failed\", and + \"Preparing\".""" + connectivity_status: Optional[Union[str, "_models.EdgeMachineConnectivityStatus"]] = rest_field( + name="connectivityStatus", visibility=["read"] + ) + """machine connectivity status. Known values are: \"NotSpecified\", \"Disconnected\", and + \"Connected\".""" + claimed_by: Optional[str] = rest_field(name="claimedBy", visibility=["read"]) + """Tracks the ID of the consuming resource, setting the machine as in-use.""" + reported_properties: Optional["_models.EdgeMachineReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read"] + ) + """Reported properties for edge machine.""" + operation_details: Optional[list["_models.OperationDetail"]] = rest_field( + name="operationDetails", visibility=["read"] + ) + """operation status details for edge machine.""" + last_sync_timestamp: Optional[datetime.datetime] = rest_field( + name="lastSyncTimestamp", visibility=["read"], format="rfc3339" + ) + """Last time data updated to service.""" + + @overload + def __init__( + self, + *, + edge_machine_kind: Optional[Union[str, "_models.EdgeMachineKind"]] = None, + arc_machine_resource_group_id: Optional[str] = None, + arc_machine_resource_id: Optional[str] = None, + arc_gateway_resource_id: Optional[str] = None, + site_details: Optional["_models.SiteDetails"] = None, + ownership_voucher_details: Optional["_models.OwnershipVoucherDetails"] = None, + provisioning_details: Optional["_models.ProvisioningDetails"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EdgeMachineRemoteSupportJobProperties(EdgeMachineJobProperties, discriminator="RemoteSupport"): + """Properties for adding a server in the cluster. + + :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and + "Deploy". + :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode + :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar job_id: Unique, immutable job id. + :vartype job_id: str + :ivar start_time_utc: The UTC date and time at which the job started. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The UTC date and time at which the job completed. + :vartype end_time_utc: ~datetime.datetime + :ivar status: Status of Edge device job. Known values are: "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and + "Scheduled". + :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus + :ivar error: error details. + :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + :ivar job_type: Job Type to support polymorphic resource. Required. Job to provide remote + support to the device. + :vartype job_type: str or ~azure.mgmt.azurestackhci.models.REMOTE_SUPPORT + :ivar access_level: Remote support access level. Required. Known values are: "None", + "Diagnostics", and "DiagnosticsAndRepair". + :vartype access_level: str or ~azure.mgmt.azurestackhci.models.RemoteSupportAccessLevel + :ivar expiration_timestamp: Remote support expiration timestamp. Required. + :vartype expiration_timestamp: ~datetime.datetime + :ivar type: Remote support type. Required. Known values are: "Enable" and "Revoke". + :vartype type: str or ~azure.mgmt.azurestackhci.models.RemoteSupportType + :ivar reported_properties: log collection job reported properties. + :vartype reported_properties: + ~azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportJobReportedProperties + """ + + job_type: Literal[EdgeMachineJobType.REMOTE_SUPPORT] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Job Type to support polymorphic resource. Required. Job to provide remote support to the + device.""" + access_level: Union[str, "_models.RemoteSupportAccessLevel"] = rest_field( + name="accessLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """Remote support access level. Required. Known values are: \"None\", \"Diagnostics\", and + \"DiagnosticsAndRepair\".""" + expiration_timestamp: datetime.datetime = rest_field( + name="expirationTimestamp", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Remote support expiration timestamp. Required.""" + type: Union[str, "_models.RemoteSupportType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Remote support type. Required. Known values are: \"Enable\" and \"Revoke\".""" + reported_properties: Optional["_models.EdgeMachineRemoteSupportJobReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read"] + ) + """log collection job reported properties.""" + + @overload + def __init__( + self, + *, + access_level: Union[str, "_models.RemoteSupportAccessLevel"], + expiration_timestamp: datetime.datetime, + type: Union[str, "_models.RemoteSupportType"], + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_type = EdgeMachineJobType.REMOTE_SUPPORT # type: ignore + + +class EdgeMachineRemoteSupportJobReportedProperties(_Model): # pylint: disable=name-too-long + """Represents the reported properties of a remote support job. + + :ivar percent_complete: The percentage of the job that is complete. + :vartype percent_complete: int + :ivar validation_status: Validation status of job. + :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar deployment_status: Deployment status of job. + :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar node_settings: Optional settings for configuring the node for remote support. + :vartype node_settings: ~azure.mgmt.azurestackhci.models.EdgeMachineRemoteSupportNodeSettings + :ivar session_details: Details of the remote support session. + :vartype session_details: list[~azure.mgmt.azurestackhci.models.RemoteSupportSession] + """ + + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the job that is complete.""" + validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) + """Validation status of job.""" + deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) + """Deployment status of job.""" + node_settings: Optional["_models.EdgeMachineRemoteSupportNodeSettings"] = rest_field( + name="nodeSettings", visibility=["read"] + ) + """Optional settings for configuring the node for remote support.""" + session_details: Optional[list["_models.RemoteSupportSession"]] = rest_field( + name="sessionDetails", visibility=["read"] + ) + """Details of the remote support session.""" + + +class EdgeMachineRemoteSupportNodeSettings(_Model): + """Represents the settings of a remote support node. + + :ivar state: The state of the remote support node. + :vartype state: str + :ivar created_at: The timestamp when the node settings were created, in UTC. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the node settings were last updated, in UTC. + :vartype updated_at: ~datetime.datetime + :ivar connection_status: The current connection status of the remote support session. + :vartype connection_status: str + :ivar connection_error_message: The error message, if any, from the last connection attempt. + :vartype connection_error_message: str + """ + + state: Optional[str] = rest_field(visibility=["read"]) + """The state of the remote support node.""" + created_at: Optional[datetime.datetime] = rest_field(name="createdAt", visibility=["read"], format="rfc3339") + """The timestamp when the node settings were created, in UTC.""" + updated_at: Optional[datetime.datetime] = rest_field(name="updatedAt", visibility=["read"], format="rfc3339") + """The timestamp when the node settings were last updated, in UTC.""" + connection_status: Optional[str] = rest_field(name="connectionStatus", visibility=["read"]) + """The current connection status of the remote support session.""" + connection_error_message: Optional[str] = rest_field(name="connectionErrorMessage", visibility=["read"]) + """The error message, if any, from the last connection attempt.""" + + +class EdgeMachineReportedProperties(_Model): + """Reported properties for edge machine. + + :ivar last_updated: Last time data reported. + :vartype last_updated: ~datetime.datetime + :ivar network_profile: Network details for edge machine. + :vartype network_profile: ~azure.mgmt.azurestackhci.models.EdgeMachineNetworkProfile + :ivar os_profile: OS Properties for edge machine. + :vartype os_profile: ~azure.mgmt.azurestackhci.models.OsProfile + :ivar hardware_profile: Hardware related information for edge machine. + :vartype hardware_profile: ~azure.mgmt.azurestackhci.models.HardwareProfile + :ivar storage_profile: Storage related information for edge machine. + :vartype storage_profile: ~azure.mgmt.azurestackhci.models.StorageProfile + :ivar sbe_deployment_package_info: Solution builder extension (SBE) deployment package + information. + :vartype sbe_deployment_package_info: ~azure.mgmt.azurestackhci.models.SbeDeploymentPackageInfo + :ivar extension_profile: Extension details for edge machine. + :vartype extension_profile: ~azure.mgmt.azurestackhci.models.ExtensionProfile + """ + + last_updated: Optional[datetime.datetime] = rest_field(name="lastUpdated", visibility=["read"], format="rfc3339") + """Last time data reported.""" + network_profile: Optional["_models.EdgeMachineNetworkProfile"] = rest_field( + name="networkProfile", visibility=["read"] + ) + """Network details for edge machine.""" + os_profile: Optional["_models.OsProfile"] = rest_field(name="osProfile", visibility=["read"]) + """OS Properties for edge machine.""" + hardware_profile: Optional["_models.HardwareProfile"] = rest_field(name="hardwareProfile", visibility=["read"]) + """Hardware related information for edge machine.""" + storage_profile: Optional["_models.StorageProfile"] = rest_field(name="storageProfile", visibility=["read"]) + """Storage related information for edge machine.""" + sbe_deployment_package_info: Optional["_models.SbeDeploymentPackageInfo"] = rest_field( + name="sbeDeploymentPackageInfo", visibility=["read"] + ) + """Solution builder extension (SBE) deployment package information.""" + extension_profile: Optional["_models.ExtensionProfile"] = rest_field(name="extensionProfile", visibility=["read"]) + """Extension details for edge machine.""" + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.azurestackhci.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.azurestackhci.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = 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 Extension(ProxyResource): + """Details of a particular extension in HCI Cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: Describes Machine Extension Properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.ExtensionProperties + """ + + properties: Optional["_models.ExtensionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Describes Machine Extension Properties.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.ExtensionProperties"] = 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 ExtensionInstanceView(_Model): + """Describes the Extension Instance View. + + :ivar name: The extension name. + :vartype name: str + :ivar type: Specifies the type of the extension; an example is "MicrosoftMonitoringAgent". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :ivar status: Instance view status. + :vartype status: ~azure.mgmt.azurestackhci.models.ExtensionInstanceViewStatus + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The extension name.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifies the type of the extension; an example is \"MicrosoftMonitoringAgent\".""" + type_handler_version: Optional[str] = rest_field( + name="typeHandlerVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the version of the script handler.""" + status: Optional["_models.ExtensionInstanceViewStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Instance view status.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + status: Optional["_models.ExtensionInstanceViewStatus"] = 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 ExtensionInstanceViewStatus(_Model): + """Instance view status. + + :ivar code: The status code. + :vartype code: str + :ivar level: The level code. Indicates the severity or importance of the status message. Known + values are: "Info", "Warning", and "Error". + :vartype level: str or ~azure.mgmt.azurestackhci.models.StatusLevelTypes + :ivar display_status: The short localizable label for the status. + :vartype display_status: str + :ivar message: The detailed status message, including for alerts and error messages. + :vartype message: str + :ivar time: The time of the status. + :vartype time: ~datetime.datetime + """ + + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The status code.""" + level: Optional[Union[str, "_models.StatusLevelTypes"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The level code. Indicates the severity or importance of the status message. Known values are: + \"Info\", \"Warning\", and \"Error\".""" + display_status: Optional[str] = rest_field( + name="displayStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The short localizable label for the status.""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The detailed status message, including for alerts and error messages.""" + time: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time of the status.""" + + @overload + def __init__( + self, + *, + code: Optional[str] = None, + level: Optional[Union[str, "_models.StatusLevelTypes"]] = None, + display_status: Optional[str] = None, + message: Optional[str] = None, + time: Optional[datetime.datetime] = 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 ExtensionParameters(_Model): + """Describes the properties of a Machine Extension. This object mirrors the definition in + HybridCompute. + + :ivar force_update_tag: How the extension handler should be forced to update even if the + extension configuration has not changed. + :vartype force_update_tag: str + :ivar publisher: The name of the extension handler publisher. + :vartype publisher: str + :ivar type: Specifies the type of the extension; an example is "CustomScriptExtension". + :vartype type: str + :ivar type_handler_version: Specifies the version of the script handler. Latest version would + be used if not specified. + :vartype type_handler_version: str + :ivar auto_upgrade_minor_version: Indicates whether the extension should use a newer minor + version if one is available at deployment time. Once deployed, however, the extension will not + upgrade minor versions unless redeployed, even with this property set to true. + :vartype auto_upgrade_minor_version: bool + :ivar settings: Json formatted public settings for the extension. + :vartype settings: any + :ivar protected_settings: Protected settings (may contain secrets). + :vartype protected_settings: any + :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :vartype enable_automatic_upgrade: bool + """ + + force_update_tag: Optional[str] = rest_field( + name="forceUpdateTag", visibility=["read", "create", "update", "delete", "query"] + ) + """How the extension handler should be forced to update even if the extension configuration has + not changed.""" + publisher: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the extension handler publisher.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifies the type of the extension; an example is \"CustomScriptExtension\".""" + type_handler_version: Optional[str] = rest_field( + name="typeHandlerVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the version of the script handler. Latest version would be used if not specified.""" + auto_upgrade_minor_version: Optional[bool] = rest_field( + name="autoUpgradeMinorVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether the extension should use a newer minor version if one is available at + deployment time. Once deployed, however, the extension will not upgrade minor versions unless + redeployed, even with this property set to true.""" + settings: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Json formatted public settings for the extension.""" + protected_settings: Optional[Any] = rest_field( + name="protectedSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """Protected settings (may contain secrets).""" + enable_automatic_upgrade: Optional[bool] = rest_field( + name="enableAutomaticUpgrade", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether the extension should be automatically upgraded by the platform if there is a + newer version available.""" + + @overload + def __init__( + self, + *, + force_update_tag: Optional[str] = None, + publisher: Optional[str] = None, + type: Optional[str] = None, + type_handler_version: Optional[str] = None, + auto_upgrade_minor_version: Optional[bool] = None, + settings: Optional[Any] = None, + protected_settings: Optional[Any] = None, + enable_automatic_upgrade: Optional[bool] = 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 ExtensionPatch(_Model): + """Extension Details to update. + + :ivar properties: Describes Machine Extension Properties that can be updated. + :vartype properties: ~azure.mgmt.azurestackhci.models.ExtensionPatchProperties + """ + + properties: Optional["_models.ExtensionPatchProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Describes Machine Extension Properties that can be updated.""" + + __flattened_items = ["extension_parameters"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ExtensionPatchProperties"] = 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 ExtensionPatchParameters(_Model): + """Describes the properties of a Machine Extension that can be updated. + + :ivar type_handler_version: Specifies the version of the script handler. Latest version would + be used if not specified. + :vartype type_handler_version: str + :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically + upgraded by the platform if there is a newer version available. + :vartype enable_automatic_upgrade: bool + :ivar settings: Json formatted public settings for the extension. + :vartype settings: any + :ivar protected_settings: Protected settings (may contain secrets). + :vartype protected_settings: any + """ + + type_handler_version: Optional[str] = rest_field( + name="typeHandlerVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the version of the script handler. Latest version would be used if not specified.""" + enable_automatic_upgrade: Optional[bool] = rest_field( + name="enableAutomaticUpgrade", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether the extension should be automatically upgraded by the platform if there is a + newer version available.""" + settings: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Json formatted public settings for the extension.""" + protected_settings: Optional[Any] = rest_field( + name="protectedSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """Protected settings (may contain secrets).""" + + @overload + def __init__( + self, + *, + type_handler_version: Optional[str] = None, + enable_automatic_upgrade: Optional[bool] = None, + settings: Optional[Any] = None, + protected_settings: Optional[Any] = 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 ExtensionPatchProperties(_Model): + """Describes Machine Extension Properties that can be updated. + + :ivar extension_parameters: Describes the properties of a Machine Extension that can be + updated. + :vartype extension_parameters: ~azure.mgmt.azurestackhci.models.ExtensionPatchParameters + """ + + extension_parameters: Optional["_models.ExtensionPatchParameters"] = rest_field( + name="extensionParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """Describes the properties of a Machine Extension that can be updated.""" + + @overload + def __init__( + self, + *, + extension_parameters: Optional["_models.ExtensionPatchParameters"] = 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 ExtensionProfile(_Model): + """Extensions details for edge device. + + :ivar extensions: List of Arc extensions installed on edge device. + :vartype extensions: list[~azure.mgmt.azurestackhci.models.HciEdgeDeviceArcExtension] + """ + + extensions: Optional[list["_models.HciEdgeDeviceArcExtension"]] = rest_field(visibility=["read"]) + """List of Arc extensions installed on edge device.""" + + +class ExtensionProperties(_Model): + """Status of Arc Extension for a particular node in HCI Cluster. + + :ivar provisioning_state: Provisioning state of the Extension proxy resource. Indicates the + current lifecycle status of the resource, such as whether it's being created, updated, deleted, + or has encountered an error. Known values are: "NotSpecified", "Error", "Succeeded", "Failed", + "Canceled", "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", + "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", "Accepted", "Provisioning", + and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar extension_parameters: Parameters specific to this extension type. + :vartype extension_parameters: ~azure.mgmt.azurestackhci.models.ExtensionParameters + :ivar aggregate_state: Aggregate state of Arc Extensions across the nodes in this HCI cluster. + This reflects the overall status of the extension deployment and operation across all nodes. + Known values are: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", "Connected", + "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and + "UpgradeFailedRollbackSucceeded". + :vartype aggregate_state: str or ~azure.mgmt.azurestackhci.models.ExtensionAggregateState + :ivar per_node_extension_details: State of Arc Extension in each of the nodes. + :vartype per_node_extension_details: + list[~azure.mgmt.azurestackhci.models.PerNodeExtensionState] + :ivar managed_by: Indicates if the extension is managed by Azure or the user. This determines + who controls the deployment and lifecycle of the extension. Known values are: "User" and + "Azure". + :vartype managed_by: str or ~azure.mgmt.azurestackhci.models.ExtensionManagedBy + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the Extension proxy resource. Indicates the current lifecycle status of + the resource, such as whether it's being created, updated, deleted, or has encountered an + error. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", \"Failed\", \"Canceled\", + \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", + \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", \"Accepted\", + \"Provisioning\", and \"DisableInProgress\".""" + extension_parameters: Optional["_models.ExtensionParameters"] = rest_field( + name="extensionParameters", visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters specific to this extension type.""" + aggregate_state: Optional[Union[str, "_models.ExtensionAggregateState"]] = rest_field( + name="aggregateState", visibility=["read"] + ) + """Aggregate state of Arc Extensions across the nodes in this HCI cluster. This reflects the + overall status of the extension deployment and operation across all nodes. Known values are: + \"NotSpecified\", \"Error\", \"Succeeded\", \"Canceled\", \"Failed\", \"Connected\", + \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", \"Moving\", + \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", \"Accepted\", \"Provisioning\", + and \"UpgradeFailedRollbackSucceeded\".""" + per_node_extension_details: Optional[list["_models.PerNodeExtensionState"]] = rest_field( + name="perNodeExtensionDetails", visibility=["read"] + ) + """State of Arc Extension in each of the nodes.""" + managed_by: Optional[Union[str, "_models.ExtensionManagedBy"]] = rest_field(name="managedBy", visibility=["read"]) + """Indicates if the extension is managed by Azure or the user. This determines who controls the + deployment and lifecycle of the extension. Known values are: \"User\" and \"Azure\".""" + + __flattened_items = [ + "force_update_tag", + "publisher", + "type", + "type_handler_version", + "auto_upgrade_minor_version", + "settings", + "protected_settings", + "enable_automatic_upgrade", + ] + + @overload + def __init__( + self, + *, + extension_parameters: Optional["_models.ExtensionParameters"] = 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.extension_parameters is None: + return None + return getattr(self.extension_parameters, 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.extension_parameters is None: + self.extension_parameters = self._attr_to_rest_field["extension_parameters"]._class_type() + setattr(self.extension_parameters, key, value) + else: + super().__setattr__(key, value) + + +class ExtensionUpgradeParameters(_Model): + """Describes the parameters for Extension upgrade. + + :ivar target_version: Extension Upgrade Target Version. + :vartype target_version: str + """ + + target_version: Optional[str] = rest_field( + name="targetVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Extension Upgrade Target Version.""" + + @overload + def __init__( + self, + *, + target_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 HardwareProfile(_Model): + """Hardware profile for the machine. + + :ivar cpu_cores: Number of cpu cores in the machine. + :vartype cpu_cores: int + :ivar cpu_sockets: Number of cpu sockets in the machine. + :vartype cpu_sockets: int + :ivar memory_capacity_in_gb: Memory capacity of the machine. + :vartype memory_capacity_in_gb: int + :ivar model: Model info of the machine. + :vartype model: str + :ivar manufacturer: manufacturer info of the machine. + :vartype manufacturer: str + :ivar serial_number: Serial number of the machine. + :vartype serial_number: str + :ivar processor_type: Process type of the machine. + :vartype processor_type: str + """ + + cpu_cores: Optional[int] = rest_field(name="cpuCores", visibility=["read"]) + """Number of cpu cores in the machine.""" + cpu_sockets: Optional[int] = rest_field(name="cpuSockets", visibility=["read"]) + """Number of cpu sockets in the machine.""" + memory_capacity_in_gb: Optional[int] = rest_field(name="memoryCapacityInGb", visibility=["read"]) + """Memory capacity of the machine.""" + model: Optional[str] = rest_field(visibility=["read"]) + """Model info of the machine.""" + manufacturer: Optional[str] = rest_field(visibility=["read"]) + """manufacturer info of the machine.""" + serial_number: Optional[str] = rest_field(name="serialNumber", visibility=["read"]) + """Serial number of the machine.""" + processor_type: Optional[str] = rest_field(name="processorType", visibility=["read"]) + """Process type of the machine.""" + + +class HciEdgeDeviceJobProperties(_Model): + """HCI Edge device job properties. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + HciCollectLogJobProperties, HciRemoteSupportJobProperties + + :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and + "Deploy". + :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode + :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar job_id: Unique, immutable job id. + :vartype job_id: str + :ivar start_time_utc: The UTC date and time at which the job started. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The UTC date and time at which the job completed. + :vartype end_time_utc: ~datetime.datetime + :ivar status: Status of Edge device job. Known values are: "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and + "Scheduled". + :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus + :ivar job_type: Job Type to support polymorphic resource. Required. Known values are: + "CollectLog" and "RemoteSupport". + :vartype job_type: str or ~azure.mgmt.azurestackhci.models.HciEdgeDeviceJobType + """ + + __mapping__: dict[str, _Model] = {} + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = rest_field( + name="deploymentMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Deployment mode to trigger job. Known values are: \"Validate\" and \"Deploy\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Job provisioning state. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", + \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", + \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", + \"InProgress\", \"Accepted\", \"Provisioning\", and \"DisableInProgress\".""" + job_id: Optional[str] = rest_field(name="jobId", visibility=["read"]) + """Unique, immutable job id.""" + start_time_utc: Optional[datetime.datetime] = rest_field(name="startTimeUtc", visibility=["read"], format="rfc3339") + """The UTC date and time at which the job started.""" + end_time_utc: Optional[datetime.datetime] = rest_field(name="endTimeUtc", visibility=["read"], format="rfc3339") + """The UTC date and time at which the job completed.""" + status: Optional[Union[str, "_models.JobStatus"]] = rest_field(visibility=["read"]) + """Status of Edge device job. Known values are: \"NotSpecified\", \"ValidationInProgress\", + \"ValidationSuccess\", \"ValidationFailed\", \"DeploymentInProgress\", \"DeploymentFailed\", + \"DeploymentSuccess\", \"Succeeded\", \"Failed\", \"Canceled\", \"Paused\", and \"Scheduled\".""" + job_type: str = rest_discriminator(name="jobType", visibility=["read", "create"]) + """Job Type to support polymorphic resource. Required. Known values are: \"CollectLog\" and + \"RemoteSupport\".""" + + @overload + def __init__( + self, + *, + job_type: str, + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HciCollectLogJobProperties(HciEdgeDeviceJobProperties, discriminator="CollectLog"): + """Represents the properties of an HCI Collect Log job. + + :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and + "Deploy". + :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode + :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar job_id: Unique, immutable job id. + :vartype job_id: str + :ivar start_time_utc: The UTC date and time at which the job started. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The UTC date and time at which the job completed. + :vartype end_time_utc: ~datetime.datetime + :ivar status: Status of Edge device job. Known values are: "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and + "Scheduled". + :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus + :ivar from_date: From date for log collection. Required. + :vartype from_date: ~datetime.datetime + :ivar to_date: To date for log collection. Required. + :vartype to_date: ~datetime.datetime + :ivar last_log_generated: To date for log collection. + :vartype last_log_generated: ~datetime.datetime + :ivar reported_properties: log collection job reported properties. + :vartype reported_properties: ~azure.mgmt.azurestackhci.models.LogCollectionReportedProperties + :ivar job_type: Job Type to support polymorphic resource. Required. Job to collect logs from + the device. + :vartype job_type: str or ~azure.mgmt.azurestackhci.models.COLLECT_LOG + """ + + from_date: datetime.datetime = rest_field( + name="fromDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """From date for log collection. Required.""" + to_date: datetime.datetime = rest_field( + name="toDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """To date for log collection. Required.""" + last_log_generated: Optional[datetime.datetime] = rest_field( + name="lastLogGenerated", visibility=["read"], format="rfc3339" + ) + """To date for log collection.""" + reported_properties: Optional["_models.LogCollectionReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read"] + ) + """log collection job reported properties.""" + job_type: Literal[HciEdgeDeviceJobType.COLLECT_LOG] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Job Type to support polymorphic resource. Required. Job to collect logs from the device.""" + + @overload + def __init__( + self, + *, + from_date: datetime.datetime, + to_date: datetime.datetime, + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_type = HciEdgeDeviceJobType.COLLECT_LOG # type: ignore + + +class HciEdgeDevice(EdgeDevice, discriminator="HCI"): + """Arc-enabled edge device with HCI OS. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: properties for Arc-enabled edge device with HCI OS. + :vartype properties: ~azure.mgmt.azurestackhci.models.HciEdgeDeviceProperties + :ivar kind: Device kind to support polymorphic resource. Required. Arc-enabled edge device with + HCI OS. + :vartype kind: str or ~azure.mgmt.azurestackhci.models.HCI + """ + + properties: Optional["_models.HciEdgeDeviceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """properties for Arc-enabled edge device with HCI OS.""" + kind: Literal[DeviceKind.HCI] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Device kind to support polymorphic resource. Required. Arc-enabled edge device with HCI OS.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.HciEdgeDeviceProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = DeviceKind.HCI # type: ignore + + +class HciEdgeDeviceAdapterPropertyOverrides(_Model): + """The AdapterPropertyOverrides of a cluster. + + :ivar jumbo_packet: This parameter should only be modified based on your OEM guidance. Do not + modify this parameter without OEM validation. + :vartype jumbo_packet: str + :ivar network_direct: This parameter should only be modified based on your OEM guidance. Do not + modify this parameter without OEM validation. + :vartype network_direct: str + :ivar network_direct_technology: This parameter should only be modified based on your OEM + guidance. Do not modify this parameter without OEM validation. Expected values are 'iWARP', + 'RoCEv2', 'RoCE'. + :vartype network_direct_technology: str + """ + + jumbo_packet: Optional[str] = rest_field(name="jumboPacket", visibility=["read"]) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + network_direct: Optional[str] = rest_field(name="networkDirect", visibility=["read"]) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + network_direct_technology: Optional[str] = rest_field(name="networkDirectTechnology", visibility=["read"]) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation. Expected values are 'iWARP', 'RoCEv2', 'RoCE'.""" + + +class HciEdgeDeviceArcExtension(_Model): + """Arc extension installed on edge device. + + :ivar extension_name: Arc extension name installed on edge device. + :vartype extension_name: str + :ivar state: Arc extension state from arc machine extension. Known values are: "NotSpecified", + "Succeeded", "Failed", "Canceled", "Accepted", "Creating", "Updating", "Moving", "Deleting", + and "Deleted". + :vartype state: str or ~azure.mgmt.azurestackhci.models.ArcExtensionState + :ivar error_details: Error details while installing Arc extension. + :vartype error_details: list[~azure.mgmt.azurestackhci.models.HciValidationFailureDetail] + :ivar extension_resource_id: Arc Extension Azure resource id. + :vartype extension_resource_id: str + :ivar type_handler_version: Extension version installed. + :vartype type_handler_version: str + :ivar managed_by: Indicates whether the extension is managed by the user or by Azure. Known + values are: "User" and "Azure". + :vartype managed_by: str or ~azure.mgmt.azurestackhci.models.ExtensionManagedBy + """ + + extension_name: Optional[str] = rest_field(name="extensionName", visibility=["read"]) + """Arc extension name installed on edge device.""" + state: Optional[Union[str, "_models.ArcExtensionState"]] = rest_field(visibility=["read"]) + """Arc extension state from arc machine extension. Known values are: \"NotSpecified\", + \"Succeeded\", \"Failed\", \"Canceled\", \"Accepted\", \"Creating\", \"Updating\", \"Moving\", + \"Deleting\", and \"Deleted\".""" + error_details: Optional[list["_models.HciValidationFailureDetail"]] = rest_field( + name="errorDetails", visibility=["read"] + ) + """Error details while installing Arc extension.""" + extension_resource_id: Optional[str] = rest_field(name="extensionResourceId", visibility=["read"]) + """Arc Extension Azure resource id.""" + type_handler_version: Optional[str] = rest_field(name="typeHandlerVersion", visibility=["read"]) + """Extension version installed.""" + managed_by: Optional[Union[str, "_models.ExtensionManagedBy"]] = rest_field(name="managedBy", visibility=["read"]) + """Indicates whether the extension is managed by the user or by Azure. Known values are: \"User\" + and \"Azure\".""" + + +class HciEdgeDeviceHostNetwork(_Model): + """The HostNetwork of a cluster. + + :ivar intents: The network intents assigned to the network reference pattern used for the + deployment. Each intent will define its own name, traffic type, adapter names, and overrides as + recommended by your OEM. + :vartype intents: list[~azure.mgmt.azurestackhci.models.HciEdgeDeviceIntents] + :ivar storage_networks: List of StorageNetworks config to deploy AzureStackHCI Cluster. + :vartype storage_networks: list[~azure.mgmt.azurestackhci.models.HciEdgeDeviceStorageNetworks] + :ivar storage_connectivity_switchless: Defines how the storage adapters between nodes are + connected either switch or switch less. + :vartype storage_connectivity_switchless: bool + :ivar enable_storage_auto_ip: Optional parameter required only for 3 Nodes Switchless + deployments. This allows users to specify IPs and Mask for Storage NICs when Network ATC is not + assigning the IPs for storage automatically. + :vartype enable_storage_auto_ip: bool + """ + + intents: Optional[list["_models.HciEdgeDeviceIntents"]] = rest_field(visibility=["read"]) + """The network intents assigned to the network reference pattern used for the deployment. Each + intent will define its own name, traffic type, adapter names, and overrides as recommended by + your OEM.""" + storage_networks: Optional[list["_models.HciEdgeDeviceStorageNetworks"]] = rest_field( + name="storageNetworks", visibility=["read"] + ) + """List of StorageNetworks config to deploy AzureStackHCI Cluster.""" + storage_connectivity_switchless: Optional[bool] = rest_field( + name="storageConnectivitySwitchless", visibility=["read"] + ) + """Defines how the storage adapters between nodes are connected either switch or switch less.""" + enable_storage_auto_ip: Optional[bool] = rest_field(name="enableStorageAutoIp", visibility=["read"]) + """Optional parameter required only for 3 Nodes Switchless deployments. This allows users to + specify IPs and Mask for Storage NICs when Network ATC is not assigning the IPs for storage + automatically.""" + + +class HciEdgeDeviceIntents(_Model): + """The Intents of a cluster. + + :ivar scope: Scope for host network intent. + :vartype scope: int + :ivar intent_type: IntentType for host network intent. + :vartype intent_type: int + :ivar is_compute_intent_set: IsComputeIntentSet for host network intent. + :vartype is_compute_intent_set: bool + :ivar is_storage_intent_set: IsStorageIntentSet for host network intent. + :vartype is_storage_intent_set: bool + :ivar is_only_storage: IntentType for host network intent. + :vartype is_only_storage: bool + :ivar is_management_intent_set: IsManagementIntentSet for host network intent. + :vartype is_management_intent_set: bool + :ivar is_stretch_intent_set: IsStretchIntentSet for host network intent. + :vartype is_stretch_intent_set: bool + :ivar is_only_stretch: IsOnlyStretch for host network intent. + :vartype is_only_stretch: bool + :ivar is_network_intent_type: IsNetworkIntentType for host network intent. + :vartype is_network_intent_type: bool + :ivar intent_name: Name of the network intent you wish to create. + :vartype intent_name: str + :ivar intent_adapters: Array of adapters used for the network intent. + :vartype intent_adapters: list[str] + :ivar override_virtual_switch_configuration: This parameter should only be modified based on + your OEM guidance. Do not modify this parameter without OEM validation. + :vartype override_virtual_switch_configuration: bool + :ivar virtual_switch_configuration_overrides: Set virtualSwitch ConfigurationOverrides for + cluster. + :vartype virtual_switch_configuration_overrides: + ~azure.mgmt.azurestackhci.models.HciEdgeDeviceVirtualSwitchConfigurationOverrides + :ivar override_qos_policy: This parameter should only be modified based on your OEM guidance. + Do not modify this parameter without OEM validation. + :vartype override_qos_policy: bool + :ivar qos_policy_overrides: Set QoS PolicyOverrides for cluster. + :vartype qos_policy_overrides: ~azure.mgmt.azurestackhci.models.QosPolicyOverrides + :ivar override_adapter_property: This parameter should only be modified based on your OEM + guidance. Do not modify this parameter without OEM validation. + :vartype override_adapter_property: bool + :ivar adapter_property_overrides: Set Adapter PropertyOverrides for cluster. + :vartype adapter_property_overrides: + ~azure.mgmt.azurestackhci.models.HciEdgeDeviceAdapterPropertyOverrides + """ + + scope: Optional[int] = rest_field(visibility=["read"]) + """Scope for host network intent.""" + intent_type: Optional[int] = rest_field(name="intentType", visibility=["read"]) + """IntentType for host network intent.""" + is_compute_intent_set: Optional[bool] = rest_field(name="isComputeIntentSet", visibility=["read"]) + """IsComputeIntentSet for host network intent.""" + is_storage_intent_set: Optional[bool] = rest_field(name="isStorageIntentSet", visibility=["read"]) + """IsStorageIntentSet for host network intent.""" + is_only_storage: Optional[bool] = rest_field(name="isOnlyStorage", visibility=["read"]) + """IntentType for host network intent.""" + is_management_intent_set: Optional[bool] = rest_field(name="isManagementIntentSet", visibility=["read"]) + """IsManagementIntentSet for host network intent.""" + is_stretch_intent_set: Optional[bool] = rest_field(name="isStretchIntentSet", visibility=["read"]) + """IsStretchIntentSet for host network intent.""" + is_only_stretch: Optional[bool] = rest_field(name="isOnlyStretch", visibility=["read"]) + """IsOnlyStretch for host network intent.""" + is_network_intent_type: Optional[bool] = rest_field(name="isNetworkIntentType", visibility=["read"]) + """IsNetworkIntentType for host network intent.""" + intent_name: Optional[str] = rest_field(name="intentName", visibility=["read"]) + """Name of the network intent you wish to create.""" + intent_adapters: Optional[list[str]] = rest_field(name="intentAdapters", visibility=["read"]) + """Array of adapters used for the network intent.""" + override_virtual_switch_configuration: Optional[bool] = rest_field( + name="overrideVirtualSwitchConfiguration", visibility=["read"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + virtual_switch_configuration_overrides: Optional["_models.HciEdgeDeviceVirtualSwitchConfigurationOverrides"] = ( + rest_field(name="virtualSwitchConfigurationOverrides", visibility=["read"]) + ) + """Set virtualSwitch ConfigurationOverrides for cluster.""" + override_qos_policy: Optional[bool] = rest_field(name="overrideQosPolicy", visibility=["read"]) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + qos_policy_overrides: Optional["_models.QosPolicyOverrides"] = rest_field( + name="qosPolicyOverrides", visibility=["read"] + ) + """Set QoS PolicyOverrides for cluster.""" + override_adapter_property: Optional[bool] = rest_field(name="overrideAdapterProperty", visibility=["read"]) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + adapter_property_overrides: Optional["_models.HciEdgeDeviceAdapterPropertyOverrides"] = rest_field( + name="adapterPropertyOverrides", visibility=["read"] + ) + """Set Adapter PropertyOverrides for cluster.""" + + +class HciEdgeDeviceJob(EdgeDeviceJob, discriminator="HCI"): + """Edge device job for Azure Stack HCI solution. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: HCI Edge device job properties. Required. + :vartype properties: ~azure.mgmt.azurestackhci.models.HciEdgeDeviceJobProperties + :ivar kind: Edge Solution type to support polymorphic resource. Required. Arc-enabled edge + device with HCI OS. + :vartype kind: str or ~azure.mgmt.azurestackhci.models.HCI + """ + + properties: "_models.HciEdgeDeviceJobProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """HCI Edge device job properties. Required.""" + kind: Literal[EdgeDeviceKind.HCI] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Edge Solution type to support polymorphic resource. Required. Arc-enabled edge device with HCI + OS.""" + + @overload + def __init__( + self, + *, + properties: "_models.HciEdgeDeviceJobProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.kind = EdgeDeviceKind.HCI # type: ignore + + +class HciEdgeDeviceProperties(EdgeDeviceProperties): + """properties for Arc-enabled edge device with HCI OS. + + :ivar device_configuration: Device Configuration. + :vartype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration + :ivar provisioning_state: Provisioning state of edgeDevice resource. Known values are: + "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", + "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar reported_properties: The instance view of all current configurations on HCI device. + :vartype reported_properties: ~azure.mgmt.azurestackhci.models.HciReportedProperties + """ + + reported_properties: Optional["_models.HciReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read"] + ) + """The instance view of all current configurations on HCI device.""" + + @overload + def __init__( + self, + *, + device_configuration: Optional["_models.DeviceConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class HciEdgeDeviceStorageAdapterIPInfo(_Model): + """The StorageAdapter physical nodes of a cluster. + + :ivar physical_node: storage adapter physical node name. + :vartype physical_node: str + :ivar ipv4_address: The IPv4 address assigned to each storage adapter physical node on your + Azure Stack HCI cluster. + :vartype ipv4_address: str + :ivar subnet_mask: The SubnetMask address assigned to each storage adapter physical node on + your Azure Stack HCI cluster. + :vartype subnet_mask: str + """ + + physical_node: Optional[str] = rest_field(name="physicalNode", visibility=["read"]) + """storage adapter physical node name.""" + ipv4_address: Optional[str] = rest_field(name="ipv4Address", visibility=["read"]) + """The IPv4 address assigned to each storage adapter physical node on your Azure Stack HCI + cluster.""" + subnet_mask: Optional[str] = rest_field(name="subnetMask", visibility=["read"]) + """The SubnetMask address assigned to each storage adapter physical node on your Azure Stack HCI + cluster.""" + + +class HciEdgeDeviceStorageNetworks(_Model): + """The StorageNetworks of a cluster. + + :ivar name: Name of the storage network. + :vartype name: str + :ivar network_adapter_name: Name of the storage network adapter. + :vartype network_adapter_name: str + :ivar storage_vlan_id: ID specified for the VLAN storage network. This setting is applied to + the network interfaces that route the storage and VM migration traffic. + :vartype storage_vlan_id: str + :ivar storage_adapter_ip_info: List of Storage adapter physical nodes config to deploy + AzureStackHCI Cluster. + :vartype storage_adapter_ip_info: + list[~azure.mgmt.azurestackhci.models.HciEdgeDeviceStorageAdapterIPInfo] + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the storage network.""" + network_adapter_name: Optional[str] = rest_field(name="networkAdapterName", visibility=["read"]) + """Name of the storage network adapter.""" + storage_vlan_id: Optional[str] = rest_field(name="storageVlanId", visibility=["read"]) + """ID specified for the VLAN storage network. This setting is applied to the network interfaces + that route the storage and VM migration traffic.""" + storage_adapter_ip_info: Optional[list["_models.HciEdgeDeviceStorageAdapterIPInfo"]] = rest_field( + name="storageAdapterIPInfo", visibility=["read"] + ) + """List of Storage adapter physical nodes config to deploy AzureStackHCI Cluster.""" + + +class HciEdgeDeviceVirtualSwitchConfigurationOverrides(_Model): # pylint: disable=name-too-long + """The VirtualSwitchConfigurationOverrides of a cluster. + + :ivar enable_iov: Enable IoV for Virtual Switch. + :vartype enable_iov: str + :ivar load_balancing_algorithm: Load Balancing Algorithm for Virtual Switch. + :vartype load_balancing_algorithm: str + """ + + enable_iov: Optional[str] = rest_field(name="enableIov", visibility=["read"]) + """Enable IoV for Virtual Switch.""" + load_balancing_algorithm: Optional[str] = rest_field(name="loadBalancingAlgorithm", visibility=["read"]) + """Load Balancing Algorithm for Virtual Switch.""" + + +class HciHardwareProfile(_Model): + """Hardware configurations for HCI device. + + :ivar processor_type: Process type of the device. + :vartype processor_type: str + """ + + processor_type: Optional[str] = rest_field(name="processorType", visibility=["read"]) + """Process type of the device.""" + + +class HciNetworkProfile(_Model): + """The network profile of a device. + + :ivar nic_details: List of NIC Details of device. + :vartype nic_details: list[~azure.mgmt.azurestackhci.models.HciNicDetail] + :ivar switch_details: List of switch details for edge device. + :vartype switch_details: list[~azure.mgmt.azurestackhci.models.SwitchDetail] + :ivar host_network: HostNetwork config to deploy AzureStackHCI Cluster. + :vartype host_network: ~azure.mgmt.azurestackhci.models.HciEdgeDeviceHostNetwork + :ivar sdn_properties: oftware Defined Networking Properties of the cluster. + :vartype sdn_properties: ~azure.mgmt.azurestackhci.models.SdnProperties + """ + + nic_details: Optional[list["_models.HciNicDetail"]] = rest_field(name="nicDetails", visibility=["read"]) + """List of NIC Details of device.""" + switch_details: Optional[list["_models.SwitchDetail"]] = rest_field(name="switchDetails", visibility=["read"]) + """List of switch details for edge device.""" + host_network: Optional["_models.HciEdgeDeviceHostNetwork"] = rest_field(name="hostNetwork", visibility=["read"]) + """HostNetwork config to deploy AzureStackHCI Cluster.""" + sdn_properties: Optional["_models.SdnProperties"] = rest_field(name="sdnProperties", visibility=["read"]) + """oftware Defined Networking Properties of the cluster.""" + + +class HciNicDetail(_Model): + """The NIC Detail of a device. + + :ivar adapter_name: Adapter Name of NIC. + :vartype adapter_name: str + :ivar interface_description: Interface Description of NIC. + :vartype interface_description: str + :ivar component_id: Component Id of NIC. + :vartype component_id: str + :ivar driver_version: Driver Version of NIC. + :vartype driver_version: str + :ivar ip4_address: Subnet Mask of NIC. + :vartype ip4_address: str + :ivar subnet_mask: Subnet Mask of NIC. + :vartype subnet_mask: str + :ivar default_gateway: Default Gateway of NIC. + :vartype default_gateway: str + :ivar dns_servers: DNS Servers for NIC. + :vartype dns_servers: list[str] + :ivar default_isolation_id: Default Isolation of Management NIC. + :vartype default_isolation_id: str + :ivar mac_address: MAC address information of NIC. + :vartype mac_address: str + :ivar slot: The slot attached to the NIC. + :vartype slot: str + :ivar switch_name: The switch attached to the NIC, if any. + :vartype switch_name: str + :ivar nic_type: The type of NIC, physical, virtual, management. + :vartype nic_type: str + :ivar vlan_id: The VLAN ID of the physical NIC. + :vartype vlan_id: str + :ivar nic_status: The status of NIC, up, disconnected. + :vartype nic_status: str + :ivar rdma_capability: Describes the RDMA capability of the network adapter. Known values are: + "Enabled" and "Disabled". + :vartype rdma_capability: str or ~azure.mgmt.azurestackhci.models.RdmaCapability + """ + + adapter_name: Optional[str] = rest_field(name="adapterName", visibility=["read"]) + """Adapter Name of NIC.""" + interface_description: Optional[str] = rest_field(name="interfaceDescription", visibility=["read"]) + """Interface Description of NIC.""" + component_id: Optional[str] = rest_field(name="componentId", visibility=["read"]) + """Component Id of NIC.""" + driver_version: Optional[str] = rest_field(name="driverVersion", visibility=["read"]) + """Driver Version of NIC.""" + ip4_address: Optional[str] = rest_field(name="ip4Address", visibility=["read"]) + """Subnet Mask of NIC.""" + subnet_mask: Optional[str] = rest_field(name="subnetMask", visibility=["read"]) + """Subnet Mask of NIC.""" + default_gateway: Optional[str] = rest_field(name="defaultGateway", visibility=["read"]) + """Default Gateway of NIC.""" + dns_servers: Optional[list[str]] = rest_field(name="dnsServers", visibility=["read"]) + """DNS Servers for NIC.""" + default_isolation_id: Optional[str] = rest_field(name="defaultIsolationId", visibility=["read"]) + """Default Isolation of Management NIC.""" + mac_address: Optional[str] = rest_field(name="macAddress", visibility=["read"]) + """MAC address information of NIC.""" + slot: Optional[str] = rest_field(visibility=["read"]) + """The slot attached to the NIC.""" + switch_name: Optional[str] = rest_field(name="switchName", visibility=["read"]) + """The switch attached to the NIC, if any.""" + nic_type: Optional[str] = rest_field(name="nicType", visibility=["read"]) + """The type of NIC, physical, virtual, management.""" + vlan_id: Optional[str] = rest_field(name="vlanId", visibility=["read"]) + """The VLAN ID of the physical NIC.""" + nic_status: Optional[str] = rest_field(name="nicStatus", visibility=["read"]) + """The status of NIC, up, disconnected.""" + rdma_capability: Optional[Union[str, "_models.RdmaCapability"]] = rest_field( + name="rdmaCapability", visibility=["read"] + ) + """Describes the RDMA capability of the network adapter. Known values are: \"Enabled\" and + \"Disabled\".""" + + +class HciOsProfile(_Model): + """OS configurations for HCI device. + + :ivar boot_type: The boot type of the device. e.g. UEFI, Legacy etc. + :vartype boot_type: str + :ivar assembly_version: Version of assembly present on device. + :vartype assembly_version: str + """ + + boot_type: Optional[str] = rest_field(name="bootType", visibility=["read"]) + """The boot type of the device. e.g. UEFI, Legacy etc.""" + assembly_version: Optional[str] = rest_field(name="assemblyVersion", visibility=["read"]) + """Version of assembly present on device.""" + + +class HciRemoteSupportJobProperties(HciEdgeDeviceJobProperties, discriminator="RemoteSupport"): + """Represents the properties of a remote support job for HCI. + + :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and + "Deploy". + :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode + :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar job_id: Unique, immutable job id. + :vartype job_id: str + :ivar start_time_utc: The UTC date and time at which the job started. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The UTC date and time at which the job completed. + :vartype end_time_utc: ~datetime.datetime + :ivar status: Status of Edge device job. Known values are: "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and + "Scheduled". + :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus + :ivar access_level: Remote support access level. Required. Known values are: "None", + "Diagnostics", and "DiagnosticsAndRepair". + :vartype access_level: str or ~azure.mgmt.azurestackhci.models.RemoteSupportAccessLevel + :ivar expiration_timestamp: Remote support expiration timestamp. Required. + :vartype expiration_timestamp: ~datetime.datetime + :ivar type: Remote support type. Required. Known values are: "Enable" and "Revoke". + :vartype type: str or ~azure.mgmt.azurestackhci.models.RemoteSupportType + :ivar reported_properties: log collection job reported properties. + :vartype reported_properties: + ~azure.mgmt.azurestackhci.models.RemoteSupportJobReportedProperties + :ivar job_type: Job Type to support polymorphic resource. Required. Job to provide remote + support to the device. + :vartype job_type: str or ~azure.mgmt.azurestackhci.models.REMOTE_SUPPORT + """ + + access_level: Union[str, "_models.RemoteSupportAccessLevel"] = rest_field( + name="accessLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """Remote support access level. Required. Known values are: \"None\", \"Diagnostics\", and + \"DiagnosticsAndRepair\".""" + expiration_timestamp: datetime.datetime = rest_field( + name="expirationTimestamp", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Remote support expiration timestamp. Required.""" + type: Union[str, "_models.RemoteSupportType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Remote support type. Required. Known values are: \"Enable\" and \"Revoke\".""" + reported_properties: Optional["_models.RemoteSupportJobReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read"] + ) + """log collection job reported properties.""" + job_type: Literal[HciEdgeDeviceJobType.REMOTE_SUPPORT] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Job Type to support polymorphic resource. Required. Job to provide remote support to the + device.""" + + @overload + def __init__( + self, + *, + access_level: Union[str, "_models.RemoteSupportAccessLevel"], + expiration_timestamp: datetime.datetime, + type: Union[str, "_models.RemoteSupportType"], + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_type = HciEdgeDeviceJobType.REMOTE_SUPPORT # type: ignore + + +class ReportedProperties(_Model): + """Reported properties pushed from edge device. + + :ivar device_state: edge device state. Known values are: "NotSpecified", "Connected", + "Disconnected", "Repairing", "Draining", "InMaintenance", "Resuming", and "Processing". + :vartype device_state: str or ~azure.mgmt.azurestackhci.models.DeviceState + :ivar extension_profile: Extensions details for edge device. + :vartype extension_profile: ~azure.mgmt.azurestackhci.models.ExtensionProfile + :ivar last_sync_timestamp: Most recent edge device sync timestamp in UTC. + :vartype last_sync_timestamp: ~datetime.datetime + :ivar confidential_vm_profile: CVM support details for edge device. + :vartype confidential_vm_profile: ~azure.mgmt.azurestackhci.models.ConfidentialVmProfile + """ + + device_state: Optional[Union[str, "_models.DeviceState"]] = rest_field(name="deviceState", visibility=["read"]) + """edge device state. Known values are: \"NotSpecified\", \"Connected\", \"Disconnected\", + \"Repairing\", \"Draining\", \"InMaintenance\", \"Resuming\", and \"Processing\".""" + extension_profile: Optional["_models.ExtensionProfile"] = rest_field(name="extensionProfile", visibility=["read"]) + """Extensions details for edge device.""" + last_sync_timestamp: Optional[datetime.datetime] = rest_field( + name="lastSyncTimestamp", visibility=["read"], format="rfc3339" + ) + """Most recent edge device sync timestamp in UTC.""" + confidential_vm_profile: Optional["_models.ConfidentialVmProfile"] = rest_field( + name="confidentialVmProfile", visibility=["read"] + ) + """CVM support details for edge device.""" + + +class HciReportedProperties(ReportedProperties): + """The device Configuration for HCI device. + + :ivar device_state: edge device state. Known values are: "NotSpecified", "Connected", + "Disconnected", "Repairing", "Draining", "InMaintenance", "Resuming", and "Processing". + :vartype device_state: str or ~azure.mgmt.azurestackhci.models.DeviceState + :ivar extension_profile: Extensions details for edge device. + :vartype extension_profile: ~azure.mgmt.azurestackhci.models.ExtensionProfile + :ivar last_sync_timestamp: Most recent edge device sync timestamp in UTC. + :vartype last_sync_timestamp: ~datetime.datetime + :ivar confidential_vm_profile: CVM support details for edge device. + :vartype confidential_vm_profile: ~azure.mgmt.azurestackhci.models.ConfidentialVmProfile + :ivar network_profile: HCI device network information. + :vartype network_profile: ~azure.mgmt.azurestackhci.models.HciNetworkProfile + :ivar os_profile: HCI device OS specific information. + :vartype os_profile: ~azure.mgmt.azurestackhci.models.HciOsProfile + :ivar sbe_deployment_package_info: Solution builder extension (SBE) deployment package + information. + :vartype sbe_deployment_package_info: ~azure.mgmt.azurestackhci.models.SbeDeploymentPackageInfo + :ivar storage_profile: Hci device storage specific information. + :vartype storage_profile: ~azure.mgmt.azurestackhci.models.HciStorageProfile + :ivar hardware_profile: Hci device hardware specific information. + :vartype hardware_profile: ~azure.mgmt.azurestackhci.models.HciHardwareProfile + """ + + network_profile: Optional["_models.HciNetworkProfile"] = rest_field(name="networkProfile", visibility=["read"]) + """HCI device network information.""" + os_profile: Optional["_models.HciOsProfile"] = rest_field(name="osProfile", visibility=["read"]) + """HCI device OS specific information.""" + sbe_deployment_package_info: Optional["_models.SbeDeploymentPackageInfo"] = rest_field( + name="sbeDeploymentPackageInfo", visibility=["read"] + ) + """Solution builder extension (SBE) deployment package information.""" + storage_profile: Optional["_models.HciStorageProfile"] = rest_field(name="storageProfile", visibility=["read"]) + """Hci device storage specific information.""" + hardware_profile: Optional["_models.HciHardwareProfile"] = rest_field(name="hardwareProfile", visibility=["read"]) + """Hci device hardware specific information.""" + + +class HciStorageProfile(_Model): + """Storage configurations for HCI device. + + :ivar poolable_disks_count: Number of storage disks in the device with $CanPool as true. + :vartype poolable_disks_count: int + """ + + poolable_disks_count: Optional[int] = rest_field(name="poolableDisksCount", visibility=["read"]) + """Number of storage disks in the device with $CanPool as true.""" + + +class HciValidationFailureDetail(_Model): + """details of validation failure. + + :ivar exception: Exception details while installing extension. + :vartype exception: str + """ + + exception: Optional[str] = rest_field(visibility=["read"]) + """Exception details while installing extension.""" + + +class IgvmStatusDetail(_Model): + """Provides component-level status information related to IGVM enablement on the device. + + :ivar code: A machine-readable status code indicating the result or condition of a specific + IGVM-related check or operation. + :vartype code: str + :ivar message: A human-readable message providing context or explanation for the associated + status code. + :vartype message: str + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """A machine-readable status code indicating the result or condition of a specific IGVM-related + check or operation.""" + message: Optional[str] = rest_field(visibility=["read"]) + """A human-readable message providing context or explanation for the associated status code.""" + + +class InfrastructureNetwork(_Model): + """The InfrastructureNetwork of a AzureStackHCI Cluster. + + :ivar subnet_mask: Subnet mask that matches the provided IP address space. + :vartype subnet_mask: str + :ivar gateway: Default gateway that should be used for the provided IP address space. + :vartype gateway: str + :ivar ip_pools: Range of IP addresses from which addresses are allocated for nodes within a + subnet. + :vartype ip_pools: list[~azure.mgmt.azurestackhci.models.IpPools] + :ivar dns_server_config: Specifies how DNS servers are configured for the infrastructure + network. Allowed values are 'UseDnsServer' to use the provided DNS servers, and 'UseForwarder' + to use DNS forwarders. Known values are: "UseDnsServer" and "UseForwarder". + :vartype dns_server_config: str or ~azure.mgmt.azurestackhci.models.DnsServerConfig + :ivar dns_zones: Details of the DNS Zones to be configured. + :vartype dns_zones: list[~azure.mgmt.azurestackhci.models.DnsZones] + :ivar dns_servers: IPv4 address of the DNS servers in your environment. + :vartype dns_servers: list[str] + :ivar use_dhcp: Allows customers to use DHCP for Hosts and Cluster IPs. If not declared, the + deployment will default to static IPs. When true, GW and DNS servers are not required. + :vartype use_dhcp: bool + """ + + subnet_mask: Optional[str] = rest_field( + name="subnetMask", visibility=["read", "create", "update", "delete", "query"] + ) + """Subnet mask that matches the provided IP address space.""" + gateway: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Default gateway that should be used for the provided IP address space.""" + ip_pools: Optional[list["_models.IpPools"]] = rest_field( + name="ipPools", visibility=["read", "create", "update", "delete", "query"] + ) + """Range of IP addresses from which addresses are allocated for nodes within a subnet.""" + dns_server_config: Optional[Union[str, "_models.DnsServerConfig"]] = rest_field( + name="dnsServerConfig", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies how DNS servers are configured for the infrastructure network. Allowed values are + 'UseDnsServer' to use the provided DNS servers, and 'UseForwarder' to use DNS forwarders. Known + values are: \"UseDnsServer\" and \"UseForwarder\".""" + dns_zones: Optional[list["_models.DnsZones"]] = rest_field( + name="dnsZones", visibility=["read", "create", "update", "delete", "query"] + ) + """Details of the DNS Zones to be configured.""" + dns_servers: Optional[list[str]] = rest_field( + name="dnsServers", visibility=["read", "create", "update", "delete", "query"] + ) + """IPv4 address of the DNS servers in your environment.""" + use_dhcp: Optional[bool] = rest_field(name="useDhcp", visibility=["read", "create", "update", "delete", "query"]) + """Allows customers to use DHCP for Hosts and Cluster IPs. If not declared, the deployment will + default to static IPs. When true, GW and DNS servers are not required.""" + + @overload + def __init__( + self, + *, + subnet_mask: Optional[str] = None, + gateway: Optional[str] = None, + ip_pools: Optional[list["_models.IpPools"]] = None, + dns_server_config: Optional[Union[str, "_models.DnsServerConfig"]] = None, + dns_zones: Optional[list["_models.DnsZones"]] = None, + dns_servers: Optional[list[str]] = None, + use_dhcp: Optional[bool] = 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 IpAddressRange(_Model): + """IP address range configuration. + + :ivar start_ip: Start IP address. Required. + :vartype start_ip: str + :ivar end_ip: End IP address. Required. + :vartype end_ip: str + """ + + start_ip: str = rest_field(name="startIp", visibility=["read", "create", "update", "delete", "query"]) + """Start IP address. Required.""" + end_ip: str = rest_field(name="endIp", visibility=["read", "create", "update", "delete", "query"]) + """End IP address. Required.""" + + @overload + def __init__( + self, + *, + start_ip: str, + end_ip: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IpPools(_Model): + """The dnsServers of a device. + + :ivar starting_address: Starting IP address for the management network. A minimum of six free, + contiguous IPv4 addresses (excluding your host IPs) are needed for infrastructure services such + as clustering. + :vartype starting_address: str + :ivar ending_address: Ending IP address for the management network. A minimum of six free, + contiguous IPv4 addresses (excluding your host IPs) are needed for infrastructure services such + as clustering. + :vartype ending_address: str + """ + + starting_address: Optional[str] = rest_field( + name="startingAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Starting IP address for the management network. A minimum of six free, contiguous IPv4 + addresses (excluding your host IPs) are needed for infrastructure services such as clustering.""" + ending_address: Optional[str] = rest_field( + name="endingAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """Ending IP address for the management network. A minimum of six free, contiguous IPv4 addresses + (excluding your host IPs) are needed for infrastructure services such as clustering.""" + + @overload + def __init__( + self, + *, + starting_address: Optional[str] = None, + ending_address: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IsolatedVmAttestationConfiguration(_Model): + """Attestation configurations for isolated VM (e.g. TVM, CVM) of the cluster. + + :ivar attestation_resource_id: Fully qualified Azure resource id of the Microsoft Azure + attestation resource associated with this cluster. + :vartype attestation_resource_id: str + :ivar relying_party_service_endpoint: Region specific endpoint for relying party service. + :vartype relying_party_service_endpoint: str + :ivar attestation_service_endpoint: Region specific endpoint for Microsoft Azure Attestation + service for the cluster. + :vartype attestation_service_endpoint: str + """ + + attestation_resource_id: Optional[str] = rest_field(name="attestationResourceId", visibility=["read"]) + """Fully qualified Azure resource id of the Microsoft Azure attestation resource associated with + this cluster.""" + relying_party_service_endpoint: Optional[str] = rest_field(name="relyingPartyServiceEndpoint", visibility=["read"]) + """Region specific endpoint for relying party service.""" + attestation_service_endpoint: Optional[str] = rest_field(name="attestationServiceEndpoint", visibility=["read"]) + """Region specific endpoint for Microsoft Azure Attestation service for the cluster.""" + + +class KubernetesVersion(ProxyResource): + """Represents a kubernetes version resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.azurestackhci.models.KubernetesVersionProperties + """ + + properties: Optional["_models.KubernetesVersionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.KubernetesVersionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class KubernetesVersionProperties(_Model): + """Represents properties of a kubernetes version. + + :ivar version: Represents kubernetes version. Required. + :vartype version: str + """ + + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents kubernetes version. Required.""" + + @overload + def __init__( + self, + *, + version: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LocalAvailabilityZones(_Model): + """Local Availability Zone information for HCI cluster. + + :ivar local_availability_zone_name: Local Availability Zone name for HCI cluster. + :vartype local_availability_zone_name: str + :ivar nodes: Nodes belonging to a particular zone. + :vartype nodes: list[str] + """ + + local_availability_zone_name: Optional[str] = rest_field( + name="localAvailabilityZoneName", visibility=["read", "create", "update", "delete", "query"] + ) + """Local Availability Zone name for HCI cluster.""" + nodes: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Nodes belonging to a particular zone.""" + + @overload + def __init__( + self, + *, + local_availability_zone_name: Optional[str] = None, + nodes: 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 LogCollectionError(_Model): + """Log Collection Error details of the cluster. + + :ivar error_code: Error Code of the log collection. + :vartype error_code: str + :ivar error_message: Error Message of the log collection. + :vartype error_message: str + """ + + error_code: Optional[str] = rest_field(name="errorCode", visibility=["read"]) + """Error Code of the log collection.""" + error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) + """Error Message of the log collection.""" + + +class LogCollectionJobSession(_Model): + """Represents a session for collecting logs from an edge device. + + :ivar start_time: The timestamp when log collection started, in ISO 8601 format. + :vartype start_time: str + :ivar end_time: The timestamp when log collection ended, in ISO 8601 format. + :vartype end_time: str + :ivar time_collected: The total time logs were collected for, in ISO 8601 duration format. + :vartype time_collected: str + :ivar log_size: The size of the collected logs in bytes. + :vartype log_size: int + :ivar status: The status of the log collection session. Known values are: "NotStarted", + "Running", "Failed", "Succeeded", and "Canceled". + :vartype status: str or ~azure.mgmt.azurestackhci.models.DeviceLogCollectionStatus + :ivar correlation_id: A unique identifier for correlating this log collection session with + other operations or sessions. + :vartype correlation_id: str + """ + + start_time: Optional[str] = rest_field(name="startTime", visibility=["read"]) + """The timestamp when log collection started, in ISO 8601 format.""" + end_time: Optional[str] = rest_field(name="endTime", visibility=["read"]) + """The timestamp when log collection ended, in ISO 8601 format.""" + time_collected: Optional[str] = rest_field(name="timeCollected", visibility=["read"]) + """The total time logs were collected for, in ISO 8601 duration format.""" + log_size: Optional[int] = rest_field(name="logSize", visibility=["read"]) + """The size of the collected logs in bytes.""" + status: Optional[Union[str, "_models.DeviceLogCollectionStatus"]] = rest_field(visibility=["read"]) + """The status of the log collection session. Known values are: \"NotStarted\", \"Running\", + \"Failed\", \"Succeeded\", and \"Canceled\".""" + correlation_id: Optional[str] = rest_field(name="correlationId", visibility=["read"]) + """A unique identifier for correlating this log collection session with other operations or + sessions.""" + + +class LogCollectionProperties(_Model): + """Log Collection properties of the cluster. + + :ivar from_date: From DateTimeStamp from when logs need to be connected. + :vartype from_date: ~datetime.datetime + :ivar to_date: To DateTimeStamp till when logs need to be connected. + :vartype to_date: ~datetime.datetime + :ivar last_log_generated: Recent DateTimeStamp where logs are successfully generated. + :vartype last_log_generated: ~datetime.datetime + :ivar log_collection_session_details: + :vartype log_collection_session_details: + list[~azure.mgmt.azurestackhci.models.LogCollectionSession] + """ + + from_date: Optional[datetime.datetime] = rest_field(name="fromDate", visibility=["read"], format="rfc3339") + """From DateTimeStamp from when logs need to be connected.""" + to_date: Optional[datetime.datetime] = rest_field(name="toDate", visibility=["read"], format="rfc3339") + """To DateTimeStamp till when logs need to be connected.""" + last_log_generated: Optional[datetime.datetime] = rest_field( + name="lastLogGenerated", visibility=["read"], format="rfc3339" + ) + """Recent DateTimeStamp where logs are successfully generated.""" + log_collection_session_details: Optional[list["_models.LogCollectionSession"]] = rest_field( + name="logCollectionSessionDetails", visibility=["read"] + ) + + +class LogCollectionReportedProperties(_Model): + """Represents the reported properties of a log collection job. + + :ivar percent_complete: The percentage of the job that is complete. + :vartype percent_complete: int + :ivar validation_status: Validation status of job. + :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar deployment_status: Deployment status of job. + :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar log_collection_session_details: Details of the log collection session. + :vartype log_collection_session_details: + list[~azure.mgmt.azurestackhci.models.LogCollectionJobSession] + """ + + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the job that is complete.""" + validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) + """Validation status of job.""" + deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) + """Deployment status of job.""" + log_collection_session_details: Optional[list["_models.LogCollectionJobSession"]] = rest_field( + name="logCollectionSessionDetails", visibility=["read"] + ) + """Details of the log collection session.""" + + +class LogCollectionRequest(_Model): + """Log Collection Request. + + :ivar properties: Properties for Log Collection Request. + :vartype properties: ~azure.mgmt.azurestackhci.models.LogCollectionRequestProperties + """ + + properties: Optional["_models.LogCollectionRequestProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties for Log Collection Request.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.LogCollectionRequestProperties"] = 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 LogCollectionRequestProperties(_Model): + """Properties for Log Collection Request. + + :ivar from_date: From DateTimeStamp from when logs need to be connected. Required. + :vartype from_date: ~datetime.datetime + :ivar to_date: To DateTimeStamp till when logs need to be connected. Required. + :vartype to_date: ~datetime.datetime + """ + + from_date: datetime.datetime = rest_field( + name="fromDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """From DateTimeStamp from when logs need to be connected. Required.""" + to_date: datetime.datetime = rest_field( + name="toDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """To DateTimeStamp till when logs need to be connected. Required.""" + + @overload + def __init__( + self, + *, + from_date: datetime.datetime, + to_date: datetime.datetime, + ) -> 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 LogCollectionSession(_Model): + """Log Collection Session details of the cluster. + + :ivar log_start_time: Start Time of the logs when it was collected. + :vartype log_start_time: ~datetime.datetime + :ivar log_end_time: End Time of the logs when it was collected. + :vartype log_end_time: ~datetime.datetime + :ivar time_collected: Duration of logs collected. + :vartype time_collected: ~datetime.datetime + :ivar log_size: Size of the logs collected. + :vartype log_size: int + :ivar log_collection_status: LogCollection status. Known values are: "None", "InProgress", + "Failed", and "Succeeded". + :vartype log_collection_status: str or ~azure.mgmt.azurestackhci.models.LogCollectionStatus + :ivar correlation_id: CorrelationId of the log collection. + :vartype correlation_id: str + :ivar log_collection_job_type: Specifies the type of log collection job. Determines whether the + logs are collected immediately on demand or as part of a scheduled operation. Known values are: + "OnDemand" and "Scheduled". + :vartype log_collection_job_type: str or ~azure.mgmt.azurestackhci.models.LogCollectionJobType + :ivar end_time_collected: End Time of the logs when it was collected. + :vartype end_time_collected: ~datetime.datetime + :ivar log_collection_error: Log Collection Error details of the cluster. + :vartype log_collection_error: ~azure.mgmt.azurestackhci.models.LogCollectionError + """ + + log_start_time: Optional[datetime.datetime] = rest_field(name="logStartTime", visibility=["read"], format="rfc3339") + """Start Time of the logs when it was collected.""" + log_end_time: Optional[datetime.datetime] = rest_field(name="logEndTime", visibility=["read"], format="rfc3339") + """End Time of the logs when it was collected.""" + time_collected: Optional[datetime.datetime] = rest_field( + name="timeCollected", visibility=["read"], format="rfc3339" + ) + """Duration of logs collected.""" + log_size: Optional[int] = rest_field(name="logSize", visibility=["read"]) + """Size of the logs collected.""" + log_collection_status: Optional[Union[str, "_models.LogCollectionStatus"]] = rest_field( + name="logCollectionStatus", visibility=["read"] + ) + """LogCollection status. Known values are: \"None\", \"InProgress\", \"Failed\", and + \"Succeeded\".""" + correlation_id: Optional[str] = rest_field(name="correlationId", visibility=["read"]) + """CorrelationId of the log collection.""" + log_collection_job_type: Optional[Union[str, "_models.LogCollectionJobType"]] = rest_field( + name="logCollectionJobType", visibility=["read"] + ) + """Specifies the type of log collection job. Determines whether the logs are collected immediately + on demand or as part of a scheduled operation. Known values are: \"OnDemand\" and + \"Scheduled\".""" + end_time_collected: Optional[datetime.datetime] = rest_field( + name="endTimeCollected", visibility=["read"], format="rfc3339" + ) + """End Time of the logs when it was collected.""" + log_collection_error: Optional["_models.LogCollectionError"] = rest_field( + name="logCollectionError", visibility=["read"] + ) + """Log Collection Error details of the cluster.""" + + +class ManagedServiceIdentity(_Model): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.azurestackhci.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.azurestackhci.models.UserAssignedIdentity] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkAdapter(_Model): + """Network adapter configuration. + + :ivar ip_assignment_type: Type of IP assignment. Required. Known values are: "Automatic" and + "Manual". + :vartype ip_assignment_type: str or ~azure.mgmt.azurestackhci.models.IpAssignmentType + :ivar ip_address: IP address. + :vartype ip_address: str + :ivar adapter_name: Adapter Name. + :vartype adapter_name: str + :ivar mac_address: MAC address. + :vartype mac_address: str + :ivar ip_address_range: IP address range. + :vartype ip_address_range: ~azure.mgmt.azurestackhci.models.IpAddressRange + :ivar gateway: Gateway id. + :vartype gateway: str + :ivar subnet_mask: Subnet mask. + :vartype subnet_mask: str + :ivar dns_address_array: Array of DNS addresses. + :vartype dns_address_array: list[str] + :ivar vlan_id: VLAN ID for the network setup. + :vartype vlan_id: str + """ + + ip_assignment_type: Union[str, "_models.IpAssignmentType"] = rest_field( + name="ipAssignmentType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of IP assignment. Required. Known values are: \"Automatic\" and \"Manual\".""" + ip_address: Optional[str] = rest_field(name="ipAddress", visibility=["read", "create", "update", "delete", "query"]) + """IP address.""" + adapter_name: Optional[str] = rest_field( + name="adapterName", visibility=["read", "create", "update", "delete", "query"] + ) + """Adapter Name.""" + mac_address: Optional[str] = rest_field( + name="macAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """MAC address.""" + ip_address_range: Optional["_models.IpAddressRange"] = rest_field( + name="ipAddressRange", visibility=["read", "create", "update", "delete", "query"] + ) + """IP address range.""" + gateway: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Gateway id.""" + subnet_mask: Optional[str] = rest_field( + name="subnetMask", visibility=["read", "create", "update", "delete", "query"] + ) + """Subnet mask.""" + dns_address_array: Optional[list[str]] = rest_field( + name="dnsAddressArray", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of DNS addresses.""" + vlan_id: Optional[str] = rest_field(name="vlanId", visibility=["read", "create", "update", "delete", "query"]) + """VLAN ID for the network setup.""" + + @overload + def __init__( + self, + *, + ip_assignment_type: Union[str, "_models.IpAssignmentType"], + ip_address: Optional[str] = None, + adapter_name: Optional[str] = None, + mac_address: Optional[str] = None, + ip_address_range: Optional["_models.IpAddressRange"] = None, + gateway: Optional[str] = None, + subnet_mask: Optional[str] = None, + dns_address_array: Optional[list[str]] = None, + vlan_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkConfiguration(_Model): + """Network configuration. + + :ivar network_adapters: List of network adapters. + :vartype network_adapters: list[~azure.mgmt.azurestackhci.models.NetworkAdapter] + """ + + network_adapters: Optional[list["_models.NetworkAdapter"]] = rest_field( + name="networkAdapters", visibility=["read", "create", "update", "delete", "query"] + ) + """List of network adapters.""" + + @overload + def __init__( + self, + *, + network_adapters: Optional[list["_models.NetworkAdapter"]] = 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 NetworkController(_Model): + """network controller config for SDN Integration to deploy AzureStackHCI Cluster. + + :ivar mac_address_pool_start: macAddressPoolStart of network controller used for SDN + Integration. + :vartype mac_address_pool_start: str + :ivar mac_address_pool_stop: macAddressPoolStop of network controller used for SDN Integration. + :vartype mac_address_pool_stop: str + :ivar network_virtualization_enabled: NetworkVirtualizationEnabled of network controller used + for SDN Integration. + :vartype network_virtualization_enabled: bool + """ + + mac_address_pool_start: Optional[str] = rest_field( + name="macAddressPoolStart", visibility=["read", "create", "update", "delete", "query"] + ) + """macAddressPoolStart of network controller used for SDN Integration.""" + mac_address_pool_stop: Optional[str] = rest_field( + name="macAddressPoolStop", visibility=["read", "create", "update", "delete", "query"] + ) + """macAddressPoolStop of network controller used for SDN Integration.""" + network_virtualization_enabled: Optional[bool] = rest_field( + name="networkVirtualizationEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """NetworkVirtualizationEnabled of network controller used for SDN Integration.""" + + @overload + def __init__( + self, + *, + mac_address_pool_start: Optional[str] = None, + mac_address_pool_stop: Optional[str] = None, + network_virtualization_enabled: Optional[bool] = 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 NicDetail(_Model): + """The NIC Detail of a device. + + :ivar adapter_name: Adapter Name of NIC. + :vartype adapter_name: str + :ivar interface_description: Interface Description of NIC. + :vartype interface_description: str + :ivar component_id: Component Id of NIC. + :vartype component_id: str + :ivar driver_version: Driver Version of NIC. + :vartype driver_version: str + :ivar ip4_address: Subnet Mask of NIC. + :vartype ip4_address: str + :ivar subnet_mask: Subnet Mask of NIC. + :vartype subnet_mask: str + :ivar default_gateway: Default Gateway of NIC. + :vartype default_gateway: str + :ivar dns_servers: DNS Servers for NIC. + :vartype dns_servers: list[str] + :ivar default_isolation_id: Default Isolation of Management NIC. + :vartype default_isolation_id: str + """ + + adapter_name: Optional[str] = rest_field( + name="adapterName", visibility=["read", "create", "update", "delete", "query"] + ) + """Adapter Name of NIC.""" + interface_description: Optional[str] = rest_field( + name="interfaceDescription", visibility=["read", "create", "update", "delete", "query"] + ) + """Interface Description of NIC.""" + component_id: Optional[str] = rest_field( + name="componentId", visibility=["read", "create", "update", "delete", "query"] + ) + """Component Id of NIC.""" + driver_version: Optional[str] = rest_field( + name="driverVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Driver Version of NIC.""" + ip4_address: Optional[str] = rest_field( + name="ip4Address", visibility=["read", "create", "update", "delete", "query"] + ) + """Subnet Mask of NIC.""" + subnet_mask: Optional[str] = rest_field( + name="subnetMask", visibility=["read", "create", "update", "delete", "query"] + ) + """Subnet Mask of NIC.""" + default_gateway: Optional[str] = rest_field( + name="defaultGateway", visibility=["read", "create", "update", "delete", "query"] + ) + """Default Gateway of NIC.""" + dns_servers: Optional[list[str]] = rest_field( + name="dnsServers", visibility=["read", "create", "update", "delete", "query"] + ) + """DNS Servers for NIC.""" + default_isolation_id: Optional[str] = rest_field( + name="defaultIsolationId", visibility=["read", "create", "update", "delete", "query"] + ) + """Default Isolation of Management NIC.""" + + @overload + def __init__( + self, + *, + adapter_name: Optional[str] = None, + interface_description: Optional[str] = None, + component_id: Optional[str] = None, + driver_version: Optional[str] = None, + ip4_address: Optional[str] = None, + subnet_mask: Optional[str] = None, + default_gateway: Optional[str] = None, + dns_servers: Optional[list[str]] = None, + default_isolation_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 Observability(_Model): + """The Observability of AzureStackHCI Cluster. + + :ivar streaming_data_client: Enables telemetry data to be sent to Microsoft. + :vartype streaming_data_client: bool + :ivar eu_location: Location of your cluster. The log and diagnostic data is sent to the + appropriate diagnostics servers depending upon where your cluster resides. Setting this to + false results in all data sent to Microsoft to be stored outside of the EU. + :vartype eu_location: bool + :ivar episodic_data_upload: When set to true, collects log data to facilitate quicker issue + resolution. + :vartype episodic_data_upload: bool + """ + + streaming_data_client: Optional[bool] = rest_field( + name="streamingDataClient", visibility=["read", "create", "update", "delete", "query"] + ) + """Enables telemetry data to be sent to Microsoft.""" + eu_location: Optional[bool] = rest_field( + name="euLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Location of your cluster. The log and diagnostic data is sent to the appropriate diagnostics + servers depending upon where your cluster resides. Setting this to false results in all data + sent to Microsoft to be stored outside of the EU.""" + episodic_data_upload: Optional[bool] = rest_field( + name="episodicDataUpload", visibility=["read", "create", "update", "delete", "query"] + ) + """When set to true, collects log data to facilitate quicker issue resolution.""" + + @overload + def __init__( + self, + *, + streaming_data_client: Optional[bool] = None, + eu_location: Optional[bool] = None, + episodic_data_upload: Optional[bool] = 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 Offer(ProxyResource): + """Offer details. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: Offer properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.OfferProperties + """ + + properties: Optional["_models.OfferProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Offer properties.""" + + __flattened_items = ["provisioning_state", "publisher_id", "content", "content_version", "sku_mappings"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.OfferProperties"] = 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 OfferProperties(_Model): + """Publisher properties. + + :ivar provisioning_state: Provisioning State. + :vartype provisioning_state: str + :ivar publisher_id: Identifier of the Publisher for the offer. + :vartype publisher_id: str + :ivar content: JSON serialized catalog content of the offer. + :vartype content: str + :ivar content_version: The API version of the catalog service used to serve the catalog + content. + :vartype content_version: str + :ivar sku_mappings: Array of SKU mappings. + :vartype sku_mappings: list[~azure.mgmt.azurestackhci.models.SkuMappings] + """ + + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """Provisioning State.""" + publisher_id: Optional[str] = rest_field( + name="publisherId", visibility=["read", "create", "update", "delete", "query"] + ) + """Identifier of the Publisher for the offer.""" + content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """JSON serialized catalog content of the offer.""" + content_version: Optional[str] = rest_field( + name="contentVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The API version of the catalog service used to serve the catalog content.""" + sku_mappings: Optional[list["_models.SkuMappings"]] = rest_field( + name="skuMappings", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of SKU mappings.""" + + @overload + def __init__( + self, + *, + publisher_id: Optional[str] = None, + content: Optional[str] = None, + content_version: Optional[str] = None, + sku_mappings: Optional[list["_models.SkuMappings"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OnboardingConfiguration(_Model): + """Onboarding configuration. + + :ivar type: Type of the onboarding resource to support polymorphic resource. + "HybridComputeMachine" + :vartype type: str or ~azure.mgmt.azurestackhci.models.OnboardingResourceType + :ivar resource_id: Resource ID. + :vartype resource_id: str + :ivar location: Location of the resource. + :vartype location: str + :ivar tenant_id: Tenant ID of the resource. + :vartype tenant_id: str + :ivar arc_virtual_machine_id: Azure Arc virtual machine ID. + :vartype arc_virtual_machine_id: str + """ + + type: Optional[Union[str, "_models.OnboardingResourceType"]] = rest_field(visibility=["read", "create"]) + """Type of the onboarding resource to support polymorphic resource. \"HybridComputeMachine\"""" + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource ID.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """Location of the resource.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """Tenant ID of the resource.""" + arc_virtual_machine_id: Optional[str] = rest_field( + name="arcVirtualMachineId", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Arc virtual machine ID.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.OnboardingResourceType"]] = None, + resource_id: Optional[str] = None, + location: Optional[str] = None, + tenant_id: Optional[str] = None, + arc_virtual_machine_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): + """REST API Operation. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for Azure Resource Manager/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~azure.mgmt.azurestackhci.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~azure.mgmt.azurestackhci.models.Origin + :ivar action_type: Extensible enum. Indicates the action type. "Internal" refers to actions + that are for internal only APIs. "Internal" + :vartype action_type: str or ~azure.mgmt.azurestackhci.models.ActionType + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + \"Microsoft.Compute/virtualMachines/write\", + \"Microsoft.Compute/virtualMachines/capture/action\".""" + is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"]) + """Whether the operation applies to data-plane. This is \"true\" for data-plane operations and + \"false\" for Azure Resource Manager/control-plane operations.""" + display: Optional["_models.OperationDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Localized display information for this particular operation.""" + origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and + \"user,system\".""" + action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"]) + """Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for + internal only APIs. \"Internal\"""" + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationDetail(_Model): + """operation detail. + + :ivar name: operation name. + :vartype name: str + :ivar id: operation id. + :vartype id: str + :ivar type: operation type. + :vartype type: str + :ivar resource_id: operation resource id. + :vartype resource_id: str + :ivar description: operation description. + :vartype description: str + :ivar status: operation status. + :vartype status: str + :ivar error: error details. + :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """operation name.""" + id: Optional[str] = rest_field(visibility=["read"]) + """operation id.""" + type: Optional[str] = rest_field(visibility=["read"]) + """operation type.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """operation resource id.""" + description: Optional[str] = rest_field(visibility=["read"]) + """operation description.""" + status: Optional[str] = rest_field(visibility=["read"]) + """operation status.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read"]) + """error details.""" + + +class OperationDisplay(_Model): + """Localized display information for and operation. + + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring + Insights\" or \"Microsoft Compute\".""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name of the resource type related to this operation. E.g. \"Virtual + Machines\" or \"Job Schedule Collections\".""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create + or Update Virtual Machine\", \"Restart Virtual Machine\".""" + description: Optional[str] = rest_field(visibility=["read"]) + """The short, localized friendly description of the operation; suitable for tool tips and detailed + views.""" + + +class OptionalServices(_Model): + """The OptionalServices of AzureStackHCI Cluster. + + :ivar custom_location: The name of custom location. + :vartype custom_location: str + """ + + custom_location: Optional[str] = rest_field( + name="customLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of custom location.""" + + @overload + def __init__( + self, + *, + custom_location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OsImage(ProxyResource): + """Represents a os image resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.azurestackhci.models.OsImageProperties + """ + + properties: Optional["_models.OsImageProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.OsImageProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OsImageProperties(_Model): + """Represents properties of a os image resource. + + :ivar validated_solution_recipe_version: Represents validated solution recipe version of a os + image. + :vartype validated_solution_recipe_version: str + :ivar composed_image_version: Represents composed image version of a os image. + :vartype composed_image_version: str + :ivar composed_image_iso_url: Represents composed image iso download url of a os image. + :vartype composed_image_iso_url: str + :ivar composed_image_iso_hash: Represents composed image iso hash of a os image. + :vartype composed_image_iso_hash: str + """ + + validated_solution_recipe_version: Optional[str] = rest_field( + name="validatedSolutionRecipeVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents validated solution recipe version of a os image.""" + composed_image_version: Optional[str] = rest_field( + name="composedImageVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents composed image version of a os image.""" + composed_image_iso_url: Optional[str] = rest_field( + name="composedImageIsoUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents composed image iso download url of a os image.""" + composed_image_iso_hash: Optional[str] = rest_field( + name="composedImageIsoHash", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents composed image iso hash of a os image.""" + + @overload + def __init__( + self, + *, + validated_solution_recipe_version: Optional[str] = None, + composed_image_version: Optional[str] = None, + composed_image_iso_url: Optional[str] = None, + composed_image_iso_hash: Optional[str] = None, + ) -> 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 OsProfile(_Model): + """OS configurations for HCI device. + + :ivar boot_type: The boot type of the device. e.g. UEFI, Legacy etc. + :vartype boot_type: str + :ivar assembly_version: Version of assembly present on device. + :vartype assembly_version: str + :ivar os_type: OS type (“windows", “linux”). + :vartype os_type: str + :ivar os_sku: OS SKU (e.g., “ Microsoft Azure Linux ROE“, “Azure Stack HCI", "Microsoft Azure + Linux 3.0"). + :vartype os_sku: str + :ivar os_version: OS Version. + :vartype os_version: str + :ivar build_number: OS Build Number. + :vartype build_number: str + :ivar base_image_version: OS Base Image Version. + :vartype base_image_version: str + :ivar image_version: OS Image Version. + :vartype image_version: str + """ + + boot_type: Optional[str] = rest_field(name="bootType", visibility=["read"]) + """The boot type of the device. e.g. UEFI, Legacy etc.""" + assembly_version: Optional[str] = rest_field(name="assemblyVersion", visibility=["read"]) + """Version of assembly present on device.""" + os_type: Optional[str] = rest_field(name="osType", visibility=["read"]) + """OS type (“windows\", “linux”).""" + os_sku: Optional[str] = rest_field(name="osSku", visibility=["read"]) + """OS SKU (e.g., “ Microsoft Azure Linux ROE“, “Azure Stack HCI\", \"Microsoft Azure Linux 3.0\").""" + os_version: Optional[str] = rest_field(name="osVersion", visibility=["read"]) + """OS Version.""" + build_number: Optional[str] = rest_field(name="buildNumber", visibility=["read"]) + """OS Build Number.""" + base_image_version: Optional[str] = rest_field(name="baseImageVersion", visibility=["read"]) + """OS Base Image Version.""" + image_version: Optional[str] = rest_field(name="imageVersion", visibility=["read"]) + """OS Image Version.""" + + +class OsProvisionProfile(_Model): + """Operating system profile. + + :ivar os_name: Name of the operating system. + :vartype os_name: str + :ivar os_type: Type of the operating system. + :vartype os_type: str + :ivar os_version: Version of the operating system. + :vartype os_version: str + :ivar os_image_location: Location of the operating system image. + :vartype os_image_location: str + :ivar vsr_version: Validated Solution Recipe version to be used for the job. + :vartype vsr_version: str + :ivar image_hash: Hash of the OS package downloaded. + :vartype image_hash: str + :ivar gpg_pub_key: GPG Public Key used for package verification. + :vartype gpg_pub_key: str + :ivar operation_type: Operation sub type of OS Provisioning. Known values are: "Provision", + "Update", and "ReImage". + :vartype operation_type: str or ~azure.mgmt.azurestackhci.models.OSOperationType + """ + + os_name: Optional[str] = rest_field(name="osName", visibility=["read", "create", "update", "delete", "query"]) + """Name of the operating system.""" + os_type: Optional[str] = rest_field(name="osType", visibility=["read", "create", "update", "delete", "query"]) + """Type of the operating system.""" + os_version: Optional[str] = rest_field(name="osVersion", visibility=["read", "create", "update", "delete", "query"]) + """Version of the operating system.""" + os_image_location: Optional[str] = rest_field( + name="osImageLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Location of the operating system image.""" + vsr_version: Optional[str] = rest_field( + name="vsrVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Validated Solution Recipe version to be used for the job.""" + image_hash: Optional[str] = rest_field(name="imageHash", visibility=["read", "create", "update", "delete", "query"]) + """Hash of the OS package downloaded.""" + gpg_pub_key: Optional[str] = rest_field( + name="gpgPubKey", visibility=["read", "create", "update", "delete", "query"] + ) + """GPG Public Key used for package verification.""" + operation_type: Optional[Union[str, "_models.OSOperationType"]] = rest_field( + name="operationType", visibility=["read", "create", "update", "delete", "query"] + ) + """Operation sub type of OS Provisioning. Known values are: \"Provision\", \"Update\", and + \"ReImage\".""" + + @overload + def __init__( + self, + *, + os_name: Optional[str] = None, + os_type: Optional[str] = None, + os_version: Optional[str] = None, + os_image_location: Optional[str] = None, + vsr_version: Optional[str] = None, + image_hash: Optional[str] = None, + gpg_pub_key: Optional[str] = None, + operation_type: Optional[Union[str, "_models.OSOperationType"]] = None, + ) -> 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 OwnershipVoucherDetails(_Model): + """Details for ownership voucher. + + :ivar ownership_voucher: Ownership voucher in base64 encoded format. Required. + :vartype ownership_voucher: str + :ivar owner_key_type: Owner key type. Required. "MicrosoftManaged" + :vartype owner_key_type: str or ~azure.mgmt.azurestackhci.models.OwnerKeyType + """ + + ownership_voucher: str = rest_field( + name="ownershipVoucher", visibility=["read", "create", "update", "delete", "query"] + ) + """Ownership voucher in base64 encoded format. Required.""" + owner_key_type: Union[str, "_models.OwnerKeyType"] = rest_field( + name="ownerKeyType", visibility=["read", "create", "update", "delete", "query"] + ) + """Owner key type. Required. \"MicrosoftManaged\"""" + + @overload + def __init__( + self, + *, + ownership_voucher: str, + owner_key_type: Union[str, "_models.OwnerKeyType"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OwnershipVoucherValidationDetails(_Model): + """Ownership Voucher Validation Details. + + :ivar validation_status: The ownership voucher validation status. Known values are: "Valid" and + "Invalid". + :vartype validation_status: str or + ~azure.mgmt.azurestackhci.models.OwnershipVoucherValidationStatus + :ivar serial_number: Serial number of the device. + :vartype serial_number: str + :ivar id: FDO guid of the Ownership Voucher. + :vartype id: str + :ivar manufacturer: Name of the manufacturer. + :vartype manufacturer: str + :ivar model_name: Name of the model. + :vartype model_name: str + :ivar version: Version of the Ownership Voucher format. + :vartype version: str + :ivar azure_machine_id: Azure Machine Id of the Ownership voucher. + :vartype azure_machine_id: str + :ivar error: Error details if the validation failed. + :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + """ + + validation_status: Optional[Union[str, "_models.OwnershipVoucherValidationStatus"]] = rest_field( + name="validationStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The ownership voucher validation status. Known values are: \"Valid\" and \"Invalid\".""" + serial_number: Optional[str] = rest_field( + name="serialNumber", visibility=["read", "create", "update", "delete", "query"] + ) + """Serial number of the device.""" + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """FDO guid of the Ownership Voucher.""" + manufacturer: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the manufacturer.""" + model_name: Optional[str] = rest_field(name="modelName", visibility=["read", "create", "update", "delete", "query"]) + """Name of the model.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version of the Ownership Voucher format.""" + azure_machine_id: Optional[str] = rest_field( + name="azureMachineId", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Machine Id of the Ownership voucher.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Error details if the validation failed.""" + + @overload + def __init__( + self, + *, + validation_status: Optional[Union[str, "_models.OwnershipVoucherValidationStatus"]] = None, + serial_number: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + manufacturer: Optional[str] = None, + model_name: Optional[str] = None, + version: Optional[str] = None, + azure_machine_id: Optional[str] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> 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 PackageVersionInfo(_Model): + """Current version of each updatable component. + + :ivar package_type: Package type. + :vartype package_type: str + :ivar version: Package version. + :vartype version: str + :ivar last_updated: Last time this component was updated. + :vartype last_updated: ~datetime.datetime + """ + + package_type: Optional[str] = rest_field( + name="packageType", visibility=["read", "create", "update", "delete", "query"] + ) + """Package type.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Package version.""" + last_updated: Optional[datetime.datetime] = rest_field( + name="lastUpdated", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last time this component was updated.""" + + @overload + def __init__( + self, + *, + package_type: Optional[str] = None, + version: Optional[str] = None, + last_updated: Optional[datetime.datetime] = 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 PasswordCredential(_Model): + """PasswordCredential. + + :ivar secret_text: + :vartype secret_text: str + :ivar key_id: + :vartype key_id: str + :ivar start_date_time: + :vartype start_date_time: ~datetime.datetime + :ivar end_date_time: + :vartype end_date_time: ~datetime.datetime + """ + + secret_text: Optional[str] = rest_field( + name="secretText", visibility=["read", "create", "update", "delete", "query"] + ) + key_id: Optional[str] = rest_field(name="keyId", visibility=["read", "create", "update", "delete", "query"]) + start_date_time: Optional[datetime.datetime] = rest_field( + name="startDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + end_date_time: Optional[datetime.datetime] = rest_field( + name="endDateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + + @overload + def __init__( + self, + *, + secret_text: Optional[str] = None, + key_id: Optional[str] = None, + start_date_time: Optional[datetime.datetime] = None, + end_date_time: Optional[datetime.datetime] = 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 PerNodeExtensionState(_Model): + """Status of Arc Extension for a particular node in HCI Cluster. + + :ivar name: Name of the node in HCI Cluster. + :vartype name: str + :ivar extension: Fully qualified resource ID for the particular Arc Extension on this node. + :vartype extension: str + :ivar type_handler_version: Specifies the version of the script handler. + :vartype type_handler_version: str + :ivar state: State of Arc Extension in this node. Reflects the current lifecycle status of the + extension on the individual node, such as whether it's being created, updated, deleted, or has + encountered an error. Known values are: "NotSpecified", "Error", "Succeeded", "Canceled", + "Failed", "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", + "PartiallySucceeded", "PartiallyConnected", "InProgress", "Accepted", and "Provisioning". + :vartype state: str or ~azure.mgmt.azurestackhci.models.NodeExtensionState + :ivar instance_view: The extension instance view. + :vartype instance_view: ~azure.mgmt.azurestackhci.models.ExtensionInstanceView + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the node in HCI Cluster.""" + extension: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the particular Arc Extension on this node.""" + type_handler_version: Optional[str] = rest_field(name="typeHandlerVersion", visibility=["read"]) + """Specifies the version of the script handler.""" + state: Optional[Union[str, "_models.NodeExtensionState"]] = rest_field(visibility=["read"]) + """State of Arc Extension in this node. Reflects the current lifecycle status of the extension on + the individual node, such as whether it's being created, updated, deleted, or has encountered + an error. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", \"Canceled\", + \"Failed\", \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", + \"Deleting\", \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", + \"Accepted\", and \"Provisioning\".""" + instance_view: Optional["_models.ExtensionInstanceView"] = rest_field(name="instanceView", visibility=["read"]) + """The extension instance view.""" + + +class PerNodeRemoteSupportSession(_Model): + """Remote Support Node Session Details on the Node. + + :ivar session_start_time: Remote Support Session StartTime on the Node. + :vartype session_start_time: ~datetime.datetime + :ivar session_end_time: Remote Support Session EndTime on the Node. + :vartype session_end_time: ~datetime.datetime + :ivar node_name: Name of the node. + :vartype node_name: str + :ivar duration: Duration of Remote Support Enablement. + :vartype duration: int + :ivar access_level: Remote Support Access Level. Known values are: "Diagnostics" and + "DiagnosticsAndRepair". + :vartype access_level: str or ~azure.mgmt.azurestackhci.models.AccessLevel + """ + + session_start_time: Optional[datetime.datetime] = rest_field( + name="sessionStartTime", visibility=["read"], format="rfc3339" + ) + """Remote Support Session StartTime on the Node.""" + session_end_time: Optional[datetime.datetime] = rest_field( + name="sessionEndTime", visibility=["read"], format="rfc3339" + ) + """Remote Support Session EndTime on the Node.""" + node_name: Optional[str] = rest_field(name="nodeName", visibility=["read"]) + """Name of the node.""" + duration: Optional[int] = rest_field(visibility=["read"]) + """Duration of Remote Support Enablement.""" + access_level: Optional[Union[str, "_models.AccessLevel"]] = rest_field(name="accessLevel", visibility=["read"]) + """Remote Support Access Level. Known values are: \"Diagnostics\" and \"DiagnosticsAndRepair\".""" + + +class PerNodeState(_Model): + """Status of Arc agent for a particular node in HCI Cluster. + + :ivar name: Name of the Node in HCI Cluster. + :vartype name: str + :ivar arc_instance: Fully qualified resource ID for the Arc agent of this node. + :vartype arc_instance: str + :ivar arc_node_service_principal_object_id: The service principal id of the arc for server + node. + :vartype arc_node_service_principal_object_id: str + :ivar state: State of the Arc agent in this node. Indicates the current lifecycle status of the + agent, such as whether it's being provisioned, connected, updated, or has encountered an error. + Known values are: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", "Connected", + "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", + "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". + :vartype state: str or ~azure.mgmt.azurestackhci.models.NodeArcState + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the Node in HCI Cluster.""" + arc_instance: Optional[str] = rest_field(name="arcInstance", visibility=["read"]) + """Fully qualified resource ID for the Arc agent of this node.""" + arc_node_service_principal_object_id: Optional[str] = rest_field( + name="arcNodeServicePrincipalObjectId", visibility=["read"] + ) + """The service principal id of the arc for server node.""" + state: Optional[Union[str, "_models.NodeArcState"]] = rest_field(visibility=["read"]) + """State of the Arc agent in this node. Indicates the current lifecycle status of the agent, such + as whether it's being provisioned, connected, updated, or has encountered an error. Known + values are: \"NotSpecified\", \"Error\", \"Succeeded\", \"Canceled\", \"Failed\", + \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", + \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", \"Accepted\", + \"Provisioning\", and \"DisableInProgress\".""" + + +class PhysicalNodes(_Model): + """The PhysicalNodes of a cluster. + + :ivar name: NETBIOS name of each physical server on your Azure Stack HCI cluster. + :vartype name: str + :ivar ipv4_address: The IPv4 address assigned to each physical server on your Azure Stack HCI + cluster. + :vartype ipv4_address: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """NETBIOS name of each physical server on your Azure Stack HCI cluster.""" + ipv4_address: Optional[str] = rest_field( + name="ipv4Address", visibility=["read", "create", "update", "delete", "query"] + ) + """The IPv4 address assigned to each physical server on your Azure Stack HCI cluster.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + ipv4_address: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PlatformPayload(_Model): + """Represents details of a specific platform update payload. + + :ivar payload_url: Represents url of a platform update payload. + :vartype payload_url: str + :ivar payload_hash: Represents hash of a platform update payload. + :vartype payload_hash: str + :ivar payload_package_size_in_bytes: Represents size in bytes of a platform update payload. + :vartype payload_package_size_in_bytes: str + :ivar payload_identifier: Represents identifier of a platform update payload. + :vartype payload_identifier: str + """ + + payload_url: Optional[str] = rest_field( + name="payloadUrl", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents url of a platform update payload.""" + payload_hash: Optional[str] = rest_field( + name="payloadHash", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents hash of a platform update payload.""" + payload_package_size_in_bytes: Optional[str] = rest_field( + name="payloadPackageSizeInBytes", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents size in bytes of a platform update payload.""" + payload_identifier: Optional[str] = rest_field( + name="payloadIdentifier", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents identifier of a platform update payload.""" + + @overload + def __init__( + self, + *, + payload_url: Optional[str] = None, + payload_hash: Optional[str] = None, + payload_package_size_in_bytes: Optional[str] = None, + payload_identifier: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PlatformUpdate(ProxyResource): + """Represents a platform update resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.azurestackhci.models.PlatformUpdateProperties + """ + + properties: Optional["_models.PlatformUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.PlatformUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PlatformUpdateDetails(_Model): + """Represents details of a specific platform update. + + :ivar validated_solution_recipe_version: Represents validated solution recipe version of a + platform update. + :vartype validated_solution_recipe_version: str + :ivar platform_version: Represents version of a platform update. + :vartype platform_version: str + :ivar platform_payloads: Represents the platform payloads of a platform update. Required. + :vartype platform_payloads: list[~azure.mgmt.azurestackhci.models.PlatformPayload] + """ + + validated_solution_recipe_version: Optional[str] = rest_field( + name="validatedSolutionRecipeVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents validated solution recipe version of a platform update.""" + platform_version: Optional[str] = rest_field( + name="platformVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents version of a platform update.""" + platform_payloads: list["_models.PlatformPayload"] = rest_field( + name="platformPayloads", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the platform payloads of a platform update. Required.""" + + @overload + def __init__( + self, + *, + platform_payloads: list["_models.PlatformPayload"], + validated_solution_recipe_version: Optional[str] = None, + platform_version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PlatformUpdateProperties(_Model): + """Represents properties of a platform update resource. + + :ivar platform_update_details: Represents applicable platform updates. Required. + :vartype platform_update_details: list[~azure.mgmt.azurestackhci.models.PlatformUpdateDetails] + """ + + platform_update_details: list["_models.PlatformUpdateDetails"] = rest_field( + name="platformUpdateDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents applicable platform updates. Required.""" + + @overload + def __init__( + self, + *, + platform_update_details: list["_models.PlatformUpdateDetails"], + ) -> 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 PrecheckResult(_Model): + """PrecheckResult. + + :ivar name: Name of the individual test/rule/alert that was executed. Unique, not exposed to + the customer. + :vartype name: str + :ivar display_name: The health check DisplayName localized of the individual test executed. + :vartype display_name: str + :ivar tags: Key-value pairs that allow grouping/filtering individual tests. + :vartype tags: ~azure.mgmt.azurestackhci.models.PrecheckResultTags + :ivar health_check_tags: Key-value pairs that allow grouping/filtering individual tests. + :vartype health_check_tags: any + :ivar title: User-facing name; one or more sentences indicating the direct issue. + :vartype title: str + :ivar status: Represents the current status of the check being performed. Indicates whether the + check has completed successfully, failed, or is still in progress. Known values are: + "NotYetRegistered", "ConnectedRecently", "NotConnectedRecently", "Disconnected", "Error", + "NotSpecified", "ValidationInProgress", "ValidationSuccess", "ValidationFailed", + "DeploymentInProgress", "DeploymentFailed", and "DeploymentSuccess". + :vartype status: str or ~azure.mgmt.azurestackhci.models.Status + :ivar severity: Indicates the importance or impact level of the result. Determines whether the + result is informational, a warning, or a critical issue that may block updates. Known values + are: "Critical", "Warning", "Informational", and "Hidden". + :vartype severity: str or ~azure.mgmt.azurestackhci.models.Severity + :ivar description: Detailed overview of the issue and what impact the issue has on the stamp. + :vartype description: str + :ivar remediation: Set of steps that can be taken to resolve the issue found. + :vartype remediation: str + :ivar target_resource_id: The unique identifier for the affected resource (such as a node or + drive). + :vartype target_resource_id: str + :ivar target_resource_name: The name of the affected resource. + :vartype target_resource_name: str + :ivar target_resource_type: The type of resource being referred to (well-known set of nouns in + infrastructure, aligning with Monitoring). + :vartype target_resource_type: str + :ivar timestamp: The time in which the HealthCheck was called. + :vartype timestamp: ~datetime.datetime + :ivar additional_data: Property bag of key value pairs for additional information. + :vartype additional_data: str + :ivar health_check_source: The name of the services called for the HealthCheck (I.E. + Test-AzureStack, Test-Cluster). + :vartype health_check_source: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the individual test/rule/alert that was executed. Unique, not exposed to the customer.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """The health check DisplayName localized of the individual test executed.""" + tags: Optional["_models.PrecheckResultTags"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Key-value pairs that allow grouping/filtering individual tests.""" + health_check_tags: Optional[Any] = rest_field( + name="healthCheckTags", visibility=["read", "create", "update", "delete", "query"] + ) + """Key-value pairs that allow grouping/filtering individual tests.""" + title: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """User-facing name; one or more sentences indicating the direct issue.""" + status: Optional[Union[str, "_models.Status"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the current status of the check being performed. Indicates whether the check has + completed successfully, failed, or is still in progress. Known values are: + \"NotYetRegistered\", \"ConnectedRecently\", \"NotConnectedRecently\", \"Disconnected\", + \"Error\", \"NotSpecified\", \"ValidationInProgress\", \"ValidationSuccess\", + \"ValidationFailed\", \"DeploymentInProgress\", \"DeploymentFailed\", and + \"DeploymentSuccess\".""" + severity: Optional[Union[str, "_models.Severity"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates the importance or impact level of the result. Determines whether the result is + informational, a warning, or a critical issue that may block updates. Known values are: + \"Critical\", \"Warning\", \"Informational\", and \"Hidden\".""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Detailed overview of the issue and what impact the issue has on the stamp.""" + remediation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Set of steps that can be taken to resolve the issue found.""" + target_resource_id: Optional[str] = rest_field( + name="targetResourceID", visibility=["read", "create", "update", "delete", "query"] + ) + """The unique identifier for the affected resource (such as a node or drive).""" + target_resource_name: Optional[str] = rest_field( + name="targetResourceName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the affected resource.""" + target_resource_type: Optional[str] = rest_field( + name="targetResourceType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of resource being referred to (well-known set of nouns in infrastructure, aligning + with Monitoring).""" + timestamp: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The time in which the HealthCheck was called.""" + additional_data: Optional[str] = rest_field( + name="additionalData", visibility=["read", "create", "update", "delete", "query"] + ) + """Property bag of key value pairs for additional information.""" + health_check_source: Optional[str] = rest_field( + name="healthCheckSource", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the services called for the HealthCheck (I.E. Test-AzureStack, Test-Cluster).""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + display_name: Optional[str] = None, + tags: Optional["_models.PrecheckResultTags"] = None, + health_check_tags: Optional[Any] = None, + title: Optional[str] = None, + status: Optional[Union[str, "_models.Status"]] = None, + severity: Optional[Union[str, "_models.Severity"]] = None, + description: Optional[str] = None, + remediation: Optional[str] = None, + target_resource_id: Optional[str] = None, + target_resource_name: Optional[str] = None, + target_resource_type: Optional[str] = None, + timestamp: Optional[datetime.datetime] = None, + additional_data: Optional[str] = None, + health_check_source: 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 PrecheckResultTags(_Model): + """Key-value pairs that allow grouping/filtering individual tests. + + :ivar key: Key that allow grouping/filtering individual tests. + :vartype key: str + :ivar value: Value of the key that allow grouping/filtering individual tests. + :vartype value: str + """ + + key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Key that allow grouping/filtering individual tests.""" + value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Value of the key that allow grouping/filtering individual tests.""" + + @overload + def __init__( + self, + *, + key: Optional[str] = None, + value: 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 ProvisioningDetails(_Model): + """Details for device provisioning. + + :ivar os_profile: Operating system profile. Required. + :vartype os_profile: ~azure.mgmt.azurestackhci.models.OsProvisionProfile + :ivar user_details: User configuration. + :vartype user_details: list[~azure.mgmt.azurestackhci.models.UserDetails] + """ + + os_profile: "_models.OsProvisionProfile" = rest_field( + name="osProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Operating system profile. Required.""" + user_details: Optional[list["_models.UserDetails"]] = rest_field( + name="userDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """User configuration.""" + + @overload + def __init__( + self, + *, + os_profile: "_models.OsProvisionProfile", + user_details: Optional[list["_models.UserDetails"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProvisioningRequest(_Model): + """Represents a provisioning request. + + :ivar target: Target operating system to support polymorphic resource. Required. Known values + are: "AzureLinux" and "HCI". + :vartype target: str or ~azure.mgmt.azurestackhci.models.ProvisioningOsType + :ivar os_profile: Operating system profile. Required. + :vartype os_profile: ~azure.mgmt.azurestackhci.models.OsProvisionProfile + :ivar user_details: User configuration. + :vartype user_details: list[~azure.mgmt.azurestackhci.models.UserDetails] + :ivar onboarding_configuration: Onboarding configuration. + :vartype onboarding_configuration: ~azure.mgmt.azurestackhci.models.OnboardingConfiguration + :ivar device_configuration: Device configuration. + :vartype device_configuration: ~azure.mgmt.azurestackhci.models.TargetDeviceConfiguration + :ivar custom_configuration: Base64 encoded custom configuration for CAPI to use. + :vartype custom_configuration: str + """ + + target: Union[str, "_models.ProvisioningOsType"] = rest_field(visibility=["read", "create"]) + """Target operating system to support polymorphic resource. Required. Known values are: + \"AzureLinux\" and \"HCI\".""" + os_profile: "_models.OsProvisionProfile" = rest_field( + name="osProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Operating system profile. Required.""" + user_details: Optional[list["_models.UserDetails"]] = rest_field( + name="userDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """User configuration.""" + onboarding_configuration: Optional["_models.OnboardingConfiguration"] = rest_field( + name="onboardingConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Onboarding configuration.""" + device_configuration: Optional["_models.TargetDeviceConfiguration"] = rest_field( + name="deviceConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Device configuration.""" + custom_configuration: Optional[str] = rest_field( + name="customConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Base64 encoded custom configuration for CAPI to use.""" + + @overload + def __init__( + self, + *, + target: Union[str, "_models.ProvisioningOsType"], + os_profile: "_models.OsProvisionProfile", + user_details: Optional[list["_models.UserDetails"]] = None, + onboarding_configuration: Optional["_models.OnboardingConfiguration"] = None, + device_configuration: Optional["_models.TargetDeviceConfiguration"] = None, + custom_configuration: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProvisionOsJobProperties(EdgeMachineJobProperties, discriminator="ProvisionOs"): + """Represents the properties of an Azure Linux restricted operating environment Provision Os job. + + :ivar deployment_mode: Deployment mode to trigger job. Known values are: "Validate" and + "Deploy". + :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode + :ivar provisioning_state: Job provisioning state. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar job_id: Unique, immutable job id. + :vartype job_id: str + :ivar start_time_utc: The UTC date and time at which the job started. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: The UTC date and time at which the job completed. + :vartype end_time_utc: ~datetime.datetime + :ivar status: Status of Edge device job. Known values are: "NotSpecified", + "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", + "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", "Canceled", "Paused", and + "Scheduled". + :vartype status: str or ~azure.mgmt.azurestackhci.models.JobStatus + :ivar error: error details. + :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail + :ivar job_type: Job Type to support polymorphic resource. Required. Job to provision operating + system in the device. + :vartype job_type: str or ~azure.mgmt.azurestackhci.models.PROVISION_OS + :ivar provisioning_request: Os Provisioning request. Required. + :vartype provisioning_request: ~azure.mgmt.azurestackhci.models.ProvisioningRequest + :ivar reported_properties: Reported Properties for Provision Os job. + :vartype reported_properties: ~azure.mgmt.azurestackhci.models.ProvisionOsReportedProperties + """ + + job_type: Literal[EdgeMachineJobType.PROVISION_OS] = rest_discriminator(name="jobType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Job Type to support polymorphic resource. Required. Job to provision operating system in the + device.""" + provisioning_request: "_models.ProvisioningRequest" = rest_field( + name="provisioningRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """Os Provisioning request. Required.""" + reported_properties: Optional["_models.ProvisionOsReportedProperties"] = rest_field( + name="reportedProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Reported Properties for Provision Os job.""" + + @overload + def __init__( + self, + *, + provisioning_request: "_models.ProvisioningRequest", + deployment_mode: Optional[Union[str, "_models.DeploymentMode"]] = None, + reported_properties: Optional["_models.ProvisionOsReportedProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.job_type = EdgeMachineJobType.PROVISION_OS # type: ignore + + +class ProvisionOsReportedProperties(_Model): + """Reported Properties for Provision Os job. + + :ivar percent_complete: The percentage of the job that is complete. + :vartype percent_complete: int + :ivar validation_status: Validation status of job. + :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar deployment_status: Deployment status of job. + :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + """ + + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the job that is complete.""" + validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) + """Validation status of job.""" + deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) + """Deployment status of job.""" + + +class Publisher(ProxyResource): + """Publisher details. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: Publisher properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.PublisherProperties + """ + + properties: Optional["_models.PublisherProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Publisher properties.""" + + __flattened_items = ["provisioning_state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.PublisherProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class PublisherProperties(_Model): + """Publisher properties. + + :ivar provisioning_state: Provisioning State. + :vartype provisioning_state: str + """ + + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """Provisioning State.""" + + +class QosPolicyOverrides(_Model): + """The QoSPolicyOverrides of a cluster. + + :ivar priority_value8021_action_cluster: This parameter should only be modified based on your + OEM guidance. Do not modify this parameter without OEM validation. + :vartype priority_value8021_action_cluster: str + :ivar priority_value8021_action_smb: This parameter should only be modified based on your OEM + guidance. Do not modify this parameter without OEM validation. + :vartype priority_value8021_action_smb: str + :ivar bandwidth_percentage_smb: This parameter should only be modified based on your OEM + guidance. Do not modify this parameter without OEM validation. + :vartype bandwidth_percentage_smb: str + """ + + priority_value8021_action_cluster: Optional[str] = rest_field( + name="priorityValue8021Action_Cluster", visibility=["read", "create", "update", "delete", "query"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + priority_value8021_action_smb: Optional[str] = rest_field( + name="priorityValue8021Action_SMB", visibility=["read", "create", "update", "delete", "query"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + bandwidth_percentage_smb: Optional[str] = rest_field( + name="bandwidthPercentage_SMB", visibility=["read", "create", "update", "delete", "query"] + ) + """This parameter should only be modified based on your OEM guidance. Do not modify this parameter + without OEM validation.""" + + @overload + def __init__( + self, + *, + priority_value8021_action_cluster: Optional[str] = None, + priority_value8021_action_smb: Optional[str] = None, + bandwidth_percentage_smb: 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 RawCertificateData(_Model): + """RawCertificateData. + + :ivar certificates: + :vartype certificates: list[str] + """ + + certificates: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + certificates: 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 ReconcileArcSettingsRequest(_Model): + """Request for reconciling Arc Settings. + + :ivar properties: List of Arc Nodes in the cluster. + :vartype properties: ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequestProperties + """ + + properties: Optional["_models.ReconcileArcSettingsRequestProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of Arc Nodes in the cluster.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.ReconcileArcSettingsRequestProperties"] = 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 ReconcileArcSettingsRequestProperties(_Model): + """List of Arc Nodes in the cluster. + + :ivar cluster_nodes: + :vartype cluster_nodes: list[str] + """ + + cluster_nodes: Optional[list[str]] = rest_field( + name="clusterNodes", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + cluster_nodes: 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 RemoteSupportJobNodeSettings(_Model): + """Represents the settings of a remote support node. + + :ivar state: The state of the remote support node. + :vartype state: str + :ivar created_at: The timestamp when the node settings were created, in UTC. + :vartype created_at: ~datetime.datetime + :ivar updated_at: The timestamp when the node settings were last updated, in UTC. + :vartype updated_at: ~datetime.datetime + :ivar connection_status: The current connection status of the remote support session. + :vartype connection_status: str + :ivar connection_error_message: The error message, if any, from the last connection attempt. + :vartype connection_error_message: str + """ + + state: Optional[str] = rest_field(visibility=["read"]) + """The state of the remote support node.""" + created_at: Optional[datetime.datetime] = rest_field(name="createdAt", visibility=["read"], format="rfc3339") + """The timestamp when the node settings were created, in UTC.""" + updated_at: Optional[datetime.datetime] = rest_field(name="updatedAt", visibility=["read"], format="rfc3339") + """The timestamp when the node settings were last updated, in UTC.""" + connection_status: Optional[str] = rest_field(name="connectionStatus", visibility=["read"]) + """The current connection status of the remote support session.""" + connection_error_message: Optional[str] = rest_field(name="connectionErrorMessage", visibility=["read"]) + """The error message, if any, from the last connection attempt.""" + + +class RemoteSupportJobReportedProperties(_Model): + """Represents the reported properties of a remote support job. + + :ivar percent_complete: The percentage of the job that is complete. + :vartype percent_complete: int + :ivar validation_status: Validation status of job. + :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar deployment_status: Deployment status of job. + :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus + :ivar node_settings: Optional settings for configuring the node for remote support. + :vartype node_settings: ~azure.mgmt.azurestackhci.models.RemoteSupportJobNodeSettings + :ivar session_details: Details of the remote support session. + :vartype session_details: list[~azure.mgmt.azurestackhci.models.RemoteSupportSession] + """ + + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the job that is complete.""" + validation_status: Optional["_models.EceActionStatus"] = rest_field(name="validationStatus", visibility=["read"]) + """Validation status of job.""" + deployment_status: Optional["_models.EceActionStatus"] = rest_field(name="deploymentStatus", visibility=["read"]) + """Deployment status of job.""" + node_settings: Optional["_models.RemoteSupportJobNodeSettings"] = rest_field( + name="nodeSettings", visibility=["read"] + ) + """Optional settings for configuring the node for remote support.""" + session_details: Optional[list["_models.RemoteSupportSession"]] = rest_field( + name="sessionDetails", visibility=["read"] + ) + """Details of the remote support session.""" + + +class RemoteSupportNodeSettings(_Model): + """Remote Support Node Settings of the cluster. + + :ivar arc_resource_id: Arc ResourceId of the Node. + :vartype arc_resource_id: str + :ivar state: Remote Support Access Connection State on the Node. + :vartype state: str + :ivar created_at: Remote Support Enablement Request Created TimeStamp on the Node. + :vartype created_at: ~datetime.datetime + :ivar updated_at: Remote Support Enablement Request Updated TimeStamp on the Node. + :vartype updated_at: ~datetime.datetime + :ivar connection_status: Remote Support Access Connection Status on the Node. + :vartype connection_status: str + :ivar connection_error_message: Remote Support Access Connection Error Message on the Node. + :vartype connection_error_message: str + :ivar transcript_location: Remote Support Transcript location on the node. + :vartype transcript_location: str + """ + + arc_resource_id: Optional[str] = rest_field(name="arcResourceId", visibility=["read"]) + """Arc ResourceId of the Node.""" + state: Optional[str] = rest_field(visibility=["read"]) + """Remote Support Access Connection State on the Node.""" + created_at: Optional[datetime.datetime] = rest_field(name="createdAt", visibility=["read"], format="rfc3339") + """Remote Support Enablement Request Created TimeStamp on the Node.""" + updated_at: Optional[datetime.datetime] = rest_field(name="updatedAt", visibility=["read"], format="rfc3339") + """Remote Support Enablement Request Updated TimeStamp on the Node.""" + connection_status: Optional[str] = rest_field(name="connectionStatus", visibility=["read"]) + """Remote Support Access Connection Status on the Node.""" + connection_error_message: Optional[str] = rest_field(name="connectionErrorMessage", visibility=["read"]) + """Remote Support Access Connection Error Message on the Node.""" + transcript_location: Optional[str] = rest_field(name="transcriptLocation", visibility=["read"]) + """Remote Support Transcript location on the node.""" + + +class RemoteSupportProperties(_Model): + """Remote Support properties of the cluster. + + :ivar access_level: Remote Support Access Level. Known values are: "Diagnostics" and + "DiagnosticsAndRepair". + :vartype access_level: str or ~azure.mgmt.azurestackhci.models.AccessLevel + :ivar expiration_time_stamp: Expiration DateTimeStamp when Remote Support Access will be + expired. + :vartype expiration_time_stamp: ~datetime.datetime + :ivar remote_support_type: Remote Support Type for cluster. Known values are: "Enable" and + "Revoke". + :vartype remote_support_type: str or ~azure.mgmt.azurestackhci.models.RemoteSupportType + :ivar remote_support_node_settings: + :vartype remote_support_node_settings: + list[~azure.mgmt.azurestackhci.models.RemoteSupportNodeSettings] + :ivar remote_support_session_details: + :vartype remote_support_session_details: + list[~azure.mgmt.azurestackhci.models.PerNodeRemoteSupportSession] + """ + + access_level: Optional[Union[str, "_models.AccessLevel"]] = rest_field(name="accessLevel", visibility=["read"]) + """Remote Support Access Level. Known values are: \"Diagnostics\" and \"DiagnosticsAndRepair\".""" + expiration_time_stamp: Optional[datetime.datetime] = rest_field( + name="expirationTimeStamp", visibility=["read"], format="rfc3339" + ) + """Expiration DateTimeStamp when Remote Support Access will be expired.""" + remote_support_type: Optional[Union[str, "_models.RemoteSupportType"]] = rest_field( + name="remoteSupportType", visibility=["read"] + ) + """Remote Support Type for cluster. Known values are: \"Enable\" and \"Revoke\".""" + remote_support_node_settings: Optional[list["_models.RemoteSupportNodeSettings"]] = rest_field( + name="remoteSupportNodeSettings", visibility=["read"] + ) + remote_support_session_details: Optional[list["_models.PerNodeRemoteSupportSession"]] = rest_field( + name="remoteSupportSessionDetails", visibility=["read"] + ) + + +class RemoteSupportRequest(_Model): + """Remote Support Request. + + :ivar properties: Properties for Remote Support Request. + :vartype properties: ~azure.mgmt.azurestackhci.models.RemoteSupportRequestProperties + """ + + properties: Optional["_models.RemoteSupportRequestProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties for Remote Support Request.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.RemoteSupportRequestProperties"] = 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 RemoteSupportRequestProperties(_Model): + """Properties for Remote Support Request. + + :ivar access_level: Remote Support Access Level. Known values are: "Diagnostics" and + "DiagnosticsAndRepair". + :vartype access_level: str or ~azure.mgmt.azurestackhci.models.AccessLevel + :ivar expiration_time_stamp: Expiration DateTimeStamp when Remote Support Access will be + expired. + :vartype expiration_time_stamp: ~datetime.datetime + :ivar remote_support_type: Remote Support Type for cluster. Known values are: "Enable" and + "Revoke". + :vartype remote_support_type: str or ~azure.mgmt.azurestackhci.models.RemoteSupportType + """ + + access_level: Optional[Union[str, "_models.AccessLevel"]] = rest_field(name="accessLevel", visibility=["read"]) + """Remote Support Access Level. Known values are: \"Diagnostics\" and \"DiagnosticsAndRepair\".""" + expiration_time_stamp: Optional[datetime.datetime] = rest_field( + name="expirationTimeStamp", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Expiration DateTimeStamp when Remote Support Access will be expired.""" + remote_support_type: Optional[Union[str, "_models.RemoteSupportType"]] = rest_field( + name="remoteSupportType", visibility=["read", "create", "update", "delete", "query"] + ) + """Remote Support Type for cluster. Known values are: \"Enable\" and \"Revoke\".""" + + @overload + def __init__( + self, + *, + expiration_time_stamp: Optional[datetime.datetime] = None, + remote_support_type: Optional[Union[str, "_models.RemoteSupportType"]] = 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 RemoteSupportSession(_Model): + """Represents a remote support session. + + :ivar session_id: Unique session Id. + :vartype session_id: str + :ivar session_start_time: The start time of the remote support session, in UTC. + :vartype session_start_time: ~datetime.datetime + :ivar session_end_time: The end time of the remote support session, in UTC. + :vartype session_end_time: ~datetime.datetime + :ivar access_level: The level of access granted during the remote support session. Known values + are: "None", "Diagnostics", and "DiagnosticsAndRepair". + :vartype access_level: str or ~azure.mgmt.azurestackhci.models.RemoteSupportAccessLevel + :ivar transcript_location: The location where the session transcript is stored. + :vartype transcript_location: str + """ + + session_id: Optional[str] = rest_field(name="sessionId", visibility=["read"]) + """Unique session Id.""" + session_start_time: Optional[datetime.datetime] = rest_field( + name="sessionStartTime", visibility=["read"], format="rfc3339" + ) + """The start time of the remote support session, in UTC.""" + session_end_time: Optional[datetime.datetime] = rest_field( + name="sessionEndTime", visibility=["read"], format="rfc3339" + ) + """The end time of the remote support session, in UTC.""" + access_level: Optional[Union[str, "_models.RemoteSupportAccessLevel"]] = rest_field( + name="accessLevel", visibility=["read"] + ) + """The level of access granted during the remote support session. Known values are: \"None\", + \"Diagnostics\", and \"DiagnosticsAndRepair\".""" + transcript_location: Optional[str] = rest_field(name="transcriptLocation", visibility=["read"]) + """The location where the session transcript is stored.""" + + +class SbeCredentials(_Model): + """secrets used for solution builder extension (SBE) partner extensibility. + + :ivar secret_name: secret name stored in keyvault. + :vartype secret_name: str + :ivar ece_secret_name: secret name expected for Enterprise Cloud Engine (ECE). + :vartype ece_secret_name: str + :ivar secret_location: secret URI stored in keyvault. + :vartype secret_location: str + """ + + secret_name: Optional[str] = rest_field( + name="secretName", visibility=["read", "create", "update", "delete", "query"] + ) + """secret name stored in keyvault.""" + ece_secret_name: Optional[str] = rest_field( + name="eceSecretName", visibility=["read", "create", "update", "delete", "query"] + ) + """secret name expected for Enterprise Cloud Engine (ECE).""" + secret_location: Optional[str] = rest_field( + name="secretLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """secret URI stored in keyvault.""" + + @overload + def __init__( + self, + *, + secret_name: Optional[str] = None, + ece_secret_name: Optional[str] = None, + secret_location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SbeDeploymentInfo(_Model): + """Solution builder extension (SBE) package and manifest information for the solution builder + extension staged for AzureStackHCI cluster deployment. + + :ivar version: SBE package version. + :vartype version: str + :ivar family: SBE family name. + :vartype family: str + :ivar publisher: SBE manifest publisher. + :vartype publisher: str + :ivar sbe_manifest_source: SBE Manifest Source. + :vartype sbe_manifest_source: str + :ivar sbe_manifest_creation_date: SBE Manifest Creation Date. + :vartype sbe_manifest_creation_date: ~datetime.datetime + """ + + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """SBE package version.""" + family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """SBE family name.""" + publisher: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """SBE manifest publisher.""" + sbe_manifest_source: Optional[str] = rest_field( + name="sbeManifestSource", visibility=["read", "create", "update", "delete", "query"] + ) + """SBE Manifest Source.""" + sbe_manifest_creation_date: Optional[datetime.datetime] = rest_field( + name="sbeManifestCreationDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """SBE Manifest Creation Date.""" + + @overload + def __init__( + self, + *, + version: Optional[str] = None, + family: Optional[str] = None, + publisher: Optional[str] = None, + sbe_manifest_source: Optional[str] = None, + sbe_manifest_creation_date: Optional[datetime.datetime] = 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 SbeDeploymentPackageInfo(_Model): + """Solution builder extension (SBE) deployment package information. + + :ivar code: SBE deployment validation code. + :vartype code: str + :ivar message: A detailed message that explains the SBE package validation result. + :vartype message: str + :ivar sbe_manifest: This represents discovered update results for matching updates and store it + as SBE manifest. + :vartype sbe_manifest: str + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """SBE deployment validation code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """A detailed message that explains the SBE package validation result.""" + sbe_manifest: Optional[str] = rest_field(name="sbeManifest", visibility=["read"]) + """This represents discovered update results for matching updates and store it as SBE manifest.""" + + +class SbePartnerInfo(_Model): + """The solution builder extension (SBE) partner deployment info for cluster. + + :ivar sbe_deployment_info: SBE package and manifest information for the solution Builder + Extension staged for AzureStackHCI cluster deployment. + :vartype sbe_deployment_info: ~azure.mgmt.azurestackhci.models.SbeDeploymentInfo + :ivar partner_properties: List of SBE partner properties for AzureStackHCI cluster deployment. + :vartype partner_properties: list[~azure.mgmt.azurestackhci.models.SbePartnerProperties] + :ivar credential_list: SBE credentials list for AzureStackHCI cluster deployment. + :vartype credential_list: list[~azure.mgmt.azurestackhci.models.SbeCredentials] + """ + + sbe_deployment_info: Optional["_models.SbeDeploymentInfo"] = rest_field( + name="sbeDeploymentInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """SBE package and manifest information for the solution Builder Extension staged for + AzureStackHCI cluster deployment.""" + partner_properties: Optional[list["_models.SbePartnerProperties"]] = rest_field( + name="partnerProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """List of SBE partner properties for AzureStackHCI cluster deployment.""" + credential_list: Optional[list["_models.SbeCredentials"]] = rest_field( + name="credentialList", visibility=["read", "create", "update", "delete", "query"] + ) + """SBE credentials list for AzureStackHCI cluster deployment.""" + + @overload + def __init__( + self, + *, + sbe_deployment_info: Optional["_models.SbeDeploymentInfo"] = None, + partner_properties: Optional[list["_models.SbePartnerProperties"]] = None, + credential_list: Optional[list["_models.SbeCredentials"]] = 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 SbePartnerProperties(_Model): + """Solution builder extension (SBE) partner properties object. + + :ivar name: SBE partner property name. + :vartype name: str + :ivar value: SBE partner property value. + :vartype value: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """SBE partner property name.""" + value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """SBE partner property value.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + value: 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 ScaleUnits(_Model): + """Scale units will contains list of deployment data. + + :ivar deployment_data: Deployment Data to deploy AzureStackHCI Cluster. Required. + :vartype deployment_data: ~azure.mgmt.azurestackhci.models.DeploymentData + :ivar sbe_partner_info: Solution builder extension (SBE) partner properties. + :vartype sbe_partner_info: ~azure.mgmt.azurestackhci.models.SbePartnerInfo + """ + + deployment_data: "_models.DeploymentData" = rest_field( + name="deploymentData", visibility=["read", "create", "update", "delete", "query"] + ) + """Deployment Data to deploy AzureStackHCI Cluster. Required.""" + sbe_partner_info: Optional["_models.SbePartnerInfo"] = rest_field( + name="sbePartnerInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """Solution builder extension (SBE) partner properties.""" + + @overload + def __init__( + self, + *, + deployment_data: "_models.DeploymentData", + sbe_partner_info: Optional["_models.SbePartnerInfo"] = 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 SdnIntegration(_Model): + """SDN Integration config to deploy AzureStackHCI Cluster. + + :ivar network_controller: network controller config for SDN Integration to deploy AzureStackHCI + Cluster. + :vartype network_controller: ~azure.mgmt.azurestackhci.models.NetworkController + """ + + network_controller: Optional["_models.NetworkController"] = rest_field( + name="networkController", visibility=["read", "create", "update", "delete", "query"] + ) + """network controller config for SDN Integration to deploy AzureStackHCI Cluster.""" + + @overload + def __init__( + self, + *, + network_controller: Optional["_models.NetworkController"] = 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 SecretsLocationDetails(_Model): + """Secrets location details. + + :ivar secrets_type: Type of secrets to store. Required. "BackupSecrets" + :vartype secrets_type: str or ~azure.mgmt.azurestackhci.models.SecretsType + :ivar secrets_location: secrets location. Required. + :vartype secrets_location: str + """ + + secrets_type: Union[str, "_models.SecretsType"] = rest_field( + name="secretsType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of secrets to store. Required. \"BackupSecrets\"""" + secrets_location: str = rest_field( + name="secretsLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """secrets location. Required.""" + + @overload + def __init__( + self, + *, + secrets_type: Union[str, "_models.SecretsType"], + secrets_location: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecretsLocationsChangeRequest(_Model): + """Update secrets locations change Request. + + :ivar properties: List of secret locations. + :vartype properties: list[~azure.mgmt.azurestackhci.models.SecretsLocationDetails] + """ + + properties: Optional[list["_models.SecretsLocationDetails"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of secret locations.""" + + @overload + def __init__( + self, + *, + properties: Optional[list["_models.SecretsLocationDetails"]] = 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 SecurityComplianceStatus(_Model): + """Security compliance properties of the resource. + + :ivar secured_core_compliance: Indicates whether HCI hosts meets secured-core server + requirements. Known values are: "Compliant", "NonCompliant", and "Pending". + :vartype secured_core_compliance: str or ~azure.mgmt.azurestackhci.models.ComplianceStatus + :ivar wdac_compliance: Indicates whether HCI hosts have enforced consistent Windows Defender + Application Control. Known values are: "Compliant", "NonCompliant", and "Pending". + :vartype wdac_compliance: str or ~azure.mgmt.azurestackhci.models.ComplianceStatus + :ivar data_at_rest_encrypted: Indicates whether data at-rest encryption is enabled on Azure + Stack HCI clustered volumes. Known values are: "Compliant", "NonCompliant", and "Pending". + :vartype data_at_rest_encrypted: str or ~azure.mgmt.azurestackhci.models.ComplianceStatus + :ivar data_in_transit_protected: Indicates whether HCI cluster has data in-transit protection. + Known values are: "Compliant", "NonCompliant", and "Pending". + :vartype data_in_transit_protected: str or ~azure.mgmt.azurestackhci.models.ComplianceStatus + :ivar last_updated: Time in UTC when compliance status was last updated. + :vartype last_updated: ~datetime.datetime + """ + + secured_core_compliance: Optional[Union[str, "_models.ComplianceStatus"]] = rest_field( + name="securedCoreCompliance", visibility=["read"] + ) + """Indicates whether HCI hosts meets secured-core server requirements. Known values are: + \"Compliant\", \"NonCompliant\", and \"Pending\".""" + wdac_compliance: Optional[Union[str, "_models.ComplianceStatus"]] = rest_field( + name="wdacCompliance", visibility=["read"] + ) + """Indicates whether HCI hosts have enforced consistent Windows Defender Application Control. + Known values are: \"Compliant\", \"NonCompliant\", and \"Pending\".""" + data_at_rest_encrypted: Optional[Union[str, "_models.ComplianceStatus"]] = rest_field( + name="dataAtRestEncrypted", visibility=["read"] + ) + """Indicates whether data at-rest encryption is enabled on Azure Stack HCI clustered volumes. + Known values are: \"Compliant\", \"NonCompliant\", and \"Pending\".""" + data_in_transit_protected: Optional[Union[str, "_models.ComplianceStatus"]] = rest_field( + name="dataInTransitProtected", visibility=["read"] + ) + """Indicates whether HCI cluster has data in-transit protection. Known values are: \"Compliant\", + \"NonCompliant\", and \"Pending\".""" + last_updated: Optional[datetime.datetime] = rest_field(name="lastUpdated", visibility=["read"], format="rfc3339") + """Time in UTC when compliance status was last updated.""" + + +class SecurityProperties(_Model): + """Security properties of the resource. + + :ivar secured_core_compliance_assignment: Secured Core Compliance Assignment. Known values are: + "Audit" and "ApplyAndAutoCorrect". + :vartype secured_core_compliance_assignment: str or + ~azure.mgmt.azurestackhci.models.ComplianceAssignmentType + :ivar wdac_compliance_assignment: WDAC Compliance Assignment. Known values are: "Audit" and + "ApplyAndAutoCorrect". + :vartype wdac_compliance_assignment: str or + ~azure.mgmt.azurestackhci.models.ComplianceAssignmentType + :ivar smb_encryption_for_intra_cluster_traffic_compliance_assignment: SMB encryption for + intra-cluster traffic Compliance Assignment. Known values are: "Audit" and + "ApplyAndAutoCorrect". + :vartype smb_encryption_for_intra_cluster_traffic_compliance_assignment: str or + ~azure.mgmt.azurestackhci.models.ComplianceAssignmentType + :ivar security_compliance_status: Security Compliance Status. + :vartype security_compliance_status: ~azure.mgmt.azurestackhci.models.SecurityComplianceStatus + :ivar provisioning_state: The status of the last operation. Known values are: "NotSpecified", + "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + """ + + secured_core_compliance_assignment: Optional[Union[str, "_models.ComplianceAssignmentType"]] = rest_field( + name="securedCoreComplianceAssignment", visibility=["read", "create", "update", "delete", "query"] + ) + """Secured Core Compliance Assignment. Known values are: \"Audit\" and \"ApplyAndAutoCorrect\".""" + wdac_compliance_assignment: Optional[Union[str, "_models.ComplianceAssignmentType"]] = rest_field( + name="wdacComplianceAssignment", visibility=["read", "create", "update", "delete", "query"] + ) + """WDAC Compliance Assignment. Known values are: \"Audit\" and \"ApplyAndAutoCorrect\".""" + smb_encryption_for_intra_cluster_traffic_compliance_assignment: Optional[ + Union[str, "_models.ComplianceAssignmentType"] + ] = rest_field( + name="smbEncryptionForIntraClusterTrafficComplianceAssignment", + visibility=["read", "create", "update", "delete", "query"], + ) + """SMB encryption for intra-cluster traffic Compliance Assignment. Known values are: \"Audit\" and + \"ApplyAndAutoCorrect\".""" + security_compliance_status: Optional["_models.SecurityComplianceStatus"] = rest_field( + name="securityComplianceStatus", visibility=["read"] + ) + """Security Compliance Status.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", + \"Failed\", \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", + \"Updating\", \"Deleting\", \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", + \"InProgress\", \"Accepted\", \"Provisioning\", and \"DisableInProgress\".""" + + @overload + def __init__( + self, + *, + secured_core_compliance_assignment: Optional[Union[str, "_models.ComplianceAssignmentType"]] = None, + wdac_compliance_assignment: Optional[Union[str, "_models.ComplianceAssignmentType"]] = None, + smb_encryption_for_intra_cluster_traffic_compliance_assignment: Optional[ + Union[str, "_models.ComplianceAssignmentType"] + ] = 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 SecuritySetting(ProxyResource): + """Security settings proxy resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.azurestackhci.models.SecurityProperties + """ + + properties: Optional["_models.SecurityProperties"] = rest_field(visibility=["read", "create"]) + """The resource-specific properties for this resource.""" + + __flattened_items = [ + "secured_core_compliance_assignment", + "wdac_compliance_assignment", + "smb_encryption_for_intra_cluster_traffic_compliance_assignment", + "security_compliance_status", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SecurityProperties"] = 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 ServiceConfiguration(_Model): + """Service configuration details. + + :ivar service_name: Specifies the name of the service associated with the update or operation. + This helps identify which system component or tool is involved. Required. "WAC" + :vartype service_name: str or ~azure.mgmt.azurestackhci.models.ServiceName + :ivar port: The port on which service is enabled. Required. + :vartype port: int + """ + + service_name: Union[str, "_models.ServiceName"] = rest_field( + name="serviceName", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the name of the service associated with the update or operation. This helps identify + which system component or tool is involved. Required. \"WAC\"""" + port: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The port on which service is enabled. Required.""" + + @overload + def __init__( + self, + *, + service_name: Union[str, "_models.ServiceName"], + port: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SiteDetails(_Model): + """Site Details consists of common configurations. + + :ivar site_resource_id: Site resource Id to be set during Edge Machine resource creation. + Required. + :vartype site_resource_id: str + :ivar device_configuration: Edge Device configuration received from site common configuration. + :vartype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration + """ + + site_resource_id: str = rest_field( + name="siteResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Site resource Id to be set during Edge Machine resource creation. Required.""" + device_configuration: Optional["_models.DeviceConfiguration"] = rest_field( + name="deviceConfiguration", visibility=["read", "create", "update", "delete", "query"] + ) + """Edge Device configuration received from site common configuration.""" + + @overload + def __init__( + self, + *, + site_resource_id: str, + device_configuration: Optional["_models.DeviceConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Sku(ProxyResource): + """Sku details. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: SKU properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.SkuProperties + """ + + properties: Optional["_models.SkuProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """SKU properties.""" + + __flattened_items = ["provisioning_state", "publisher_id", "offer_id", "content", "content_version", "sku_mappings"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SkuProperties"] = 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 SkuMappings(_Model): + """SKU Mapping details. + + :ivar catalog_plan_id: Identifier of the CatalogPlan for the sku. + :vartype catalog_plan_id: str + :ivar marketplace_sku_id: Identifier for the sku. + :vartype marketplace_sku_id: str + :ivar marketplace_sku_versions: Array of SKU versions available. + :vartype marketplace_sku_versions: list[str] + """ + + catalog_plan_id: Optional[str] = rest_field( + name="catalogPlanId", visibility=["read", "create", "update", "delete", "query"] + ) + """Identifier of the CatalogPlan for the sku.""" + marketplace_sku_id: Optional[str] = rest_field( + name="marketplaceSkuId", visibility=["read", "create", "update", "delete", "query"] + ) + """Identifier for the sku.""" + marketplace_sku_versions: Optional[list[str]] = rest_field( + name="marketplaceSkuVersions", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of SKU versions available.""" + + @overload + def __init__( + self, + *, + catalog_plan_id: Optional[str] = None, + marketplace_sku_id: Optional[str] = None, + marketplace_sku_versions: 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 SkuProperties(_Model): + """SKU properties. + + :ivar provisioning_state: Provisioning State. + :vartype provisioning_state: str + :ivar publisher_id: Identifier of the Publisher for the offer. + :vartype publisher_id: str + :ivar offer_id: Identifier of the Offer for the sku. + :vartype offer_id: str + :ivar content: JSON serialized catalog content of the sku offer. + :vartype content: str + :ivar content_version: The API version of the catalog service used to serve the catalog + content. + :vartype content_version: str + :ivar sku_mappings: Array of SKU mappings. + :vartype sku_mappings: list[~azure.mgmt.azurestackhci.models.SkuMappings] + """ + + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """Provisioning State.""" + publisher_id: Optional[str] = rest_field( + name="publisherId", visibility=["read", "create", "update", "delete", "query"] + ) + """Identifier of the Publisher for the offer.""" + offer_id: Optional[str] = rest_field(name="offerId", visibility=["read", "create", "update", "delete", "query"]) + """Identifier of the Offer for the sku.""" + content: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """JSON serialized catalog content of the sku offer.""" + content_version: Optional[str] = rest_field( + name="contentVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The API version of the catalog service used to serve the catalog content.""" + sku_mappings: Optional[list["_models.SkuMappings"]] = rest_field( + name="skuMappings", visibility=["read", "create", "update", "delete", "query"] + ) + """Array of SKU mappings.""" + + @overload + def __init__( + self, + *, + publisher_id: Optional[str] = None, + offer_id: Optional[str] = None, + content: Optional[str] = None, + content_version: Optional[str] = None, + sku_mappings: Optional[list["_models.SkuMappings"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SoftwareAssuranceChangeRequest(_Model): + """SoftwareAssuranceChangeRequest. + + :ivar properties: + :vartype properties: ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequestProperties + """ + + properties: Optional["_models.SoftwareAssuranceChangeRequestProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + properties: Optional["_models.SoftwareAssuranceChangeRequestProperties"] = 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 SoftwareAssuranceChangeRequestProperties(_Model): + """SoftwareAssuranceChangeRequestProperties. + + :ivar software_assurance_intent: Customer Intent for Software Assurance Benefit. This indicates + whether the customer wishes to opt in or out of the Software Assurance program, which provides + licensing and support benefits. Known values are: "Enable" and "Disable". + :vartype software_assurance_intent: str or + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceIntent + """ + + software_assurance_intent: Optional[Union[str, "_models.SoftwareAssuranceIntent"]] = rest_field( + name="softwareAssuranceIntent", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer Intent for Software Assurance Benefit. This indicates whether the customer wishes to + opt in or out of the Software Assurance program, which provides licensing and support benefits. + Known values are: \"Enable\" and \"Disable\".""" + + @overload + def __init__( + self, + *, + software_assurance_intent: Optional[Union[str, "_models.SoftwareAssuranceIntent"]] = 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 SoftwareAssuranceProperties(_Model): + """Software Assurance properties of the cluster. + + :ivar software_assurance_status: Status of the Software Assurance for the cluster. Known values + are: "Enabled" and "Disabled". + :vartype software_assurance_status: str or + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceStatus + :ivar software_assurance_intent: Customer Intent for Software Assurance Benefit. Known values + are: "Enable" and "Disable". + :vartype software_assurance_intent: str or + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceIntent + :ivar last_updated: TimeStamp denoting the latest SA benefit applicability is validated. + :vartype last_updated: ~datetime.datetime + """ + + software_assurance_status: Optional[Union[str, "_models.SoftwareAssuranceStatus"]] = rest_field( + name="softwareAssuranceStatus", visibility=["read"] + ) + """Status of the Software Assurance for the cluster. Known values are: \"Enabled\" and + \"Disabled\".""" + software_assurance_intent: Optional[Union[str, "_models.SoftwareAssuranceIntent"]] = rest_field( + name="softwareAssuranceIntent", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer Intent for Software Assurance Benefit. Known values are: \"Enable\" and \"Disable\".""" + last_updated: Optional[datetime.datetime] = rest_field(name="lastUpdated", visibility=["read"], format="rfc3339") + """TimeStamp denoting the latest SA benefit applicability is validated.""" + + @overload + def __init__( + self, + *, + software_assurance_intent: Optional[Union[str, "_models.SoftwareAssuranceIntent"]] = 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 Step(_Model): + """Progress representation of the update run steps. + + :ivar name: Name of the step. + :vartype name: str + :ivar description: More detailed description of the step. + :vartype description: str + :ivar error_message: Error message, specified if the step is in a failed state. + :vartype error_message: str + :ivar status: Status of the step, bubbled up from the ECE action plan for installation + attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. + :vartype status: str + :ivar start_time_utc: When the step started, or empty if it has not started executing. + :vartype start_time_utc: ~datetime.datetime + :ivar end_time_utc: When the step reached a terminal state. + :vartype end_time_utc: ~datetime.datetime + :ivar last_updated_time_utc: Completion time of this step or the last completed sub-step. + :vartype last_updated_time_utc: ~datetime.datetime + :ivar expected_execution_time: Expected execution time of a given step. This is optionally + authored in the update action plan and can be empty. + :vartype expected_execution_time: str + :ivar steps: Recursive model for child steps of this step. + :vartype steps: list[~azure.mgmt.azurestackhci.models.Step] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the step.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """More detailed description of the step.""" + error_message: Optional[str] = rest_field( + name="errorMessage", visibility=["read", "create", "update", "delete", "query"] + ) + """Error message, specified if the step is in a failed state.""" + status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Status of the step, bubbled up from the ECE action plan for installation attempts. Values are: + 'Success', 'Error', 'InProgress', and 'Unknown status'.""" + start_time_utc: Optional[datetime.datetime] = rest_field( + name="startTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """When the step started, or empty if it has not started executing.""" + end_time_utc: Optional[datetime.datetime] = rest_field( + name="endTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """When the step reached a terminal state.""" + last_updated_time_utc: Optional[datetime.datetime] = rest_field( + name="lastUpdatedTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Completion time of this step or the last completed sub-step.""" + expected_execution_time: Optional[str] = rest_field( + name="expectedExecutionTime", visibility=["read", "create", "update", "delete", "query"] + ) + """Expected execution time of a given step. This is optionally authored in the update action plan + and can be empty.""" + steps: Optional[list["_models.Step"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Recursive model for child steps of this step.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + description: Optional[str] = None, + error_message: Optional[str] = None, + status: Optional[str] = None, + start_time_utc: Optional[datetime.datetime] = None, + end_time_utc: Optional[datetime.datetime] = None, + last_updated_time_utc: Optional[datetime.datetime] = None, + expected_execution_time: Optional[str] = None, + steps: Optional[list["_models.Step"]] = 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 Storage(_Model): + """The Storage config of AzureStackHCI Cluster. + + :ivar configuration_mode: By default, this mode is set to Express and your storage is + configured as per best practices based on the number of nodes in the cluster. Allowed values + are 'Express','InfraOnly', 'KeepStorage'. + :vartype configuration_mode: str + """ + + configuration_mode: Optional[str] = rest_field( + name="configurationMode", visibility=["read", "create", "update", "delete", "query"] + ) + """By default, this mode is set to Express and your storage is configured as per best practices + based on the number of nodes in the cluster. Allowed values are 'Express','InfraOnly', + 'KeepStorage'.""" + + @overload + def __init__( + self, + *, + configuration_mode: 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 StorageConfiguration(_Model): + """Storage configuration. + + :ivar partition_size: Partition size. + :vartype partition_size: str + """ + + partition_size: Optional[str] = rest_field( + name="partitionSize", visibility=["read", "create", "update", "delete", "query"] + ) + """Partition size.""" + + @overload + def __init__( + self, + *, + partition_size: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StorageProfile(_Model): + """StorageProfile of edge machine. + + :ivar poolable_disks_count: Number of storage disks in the device with $CanPool as true. + :vartype poolable_disks_count: int + """ + + poolable_disks_count: Optional[int] = rest_field(name="poolableDisksCount", visibility=["read"]) + """Number of storage disks in the device with $CanPool as true.""" + + +class SwitchDetail(_Model): + """List of switch details for edge device. + + :ivar switch_name: The name of the switch. + :vartype switch_name: str + :ivar switch_type: The type of the switch. e.g. external, internal. + :vartype switch_type: str + :ivar extensions: This represents extensions installed on virtualSwitch. + :vartype extensions: list[~azure.mgmt.azurestackhci.models.SwitchExtension] + """ + + switch_name: Optional[str] = rest_field(name="switchName", visibility=["read"]) + """The name of the switch.""" + switch_type: Optional[str] = rest_field(name="switchType", visibility=["read"]) + """The type of the switch. e.g. external, internal.""" + extensions: Optional[list["_models.SwitchExtension"]] = rest_field(visibility=["read"]) + """This represents extensions installed on virtualSwitch.""" + + +class SwitchExtension(_Model): + """This represents extensions installed on virtualSwitch. + + :ivar switch_id: Unique identifier for virtualSwitch. + :vartype switch_id: str + :ivar extension_name: This will show extension name for virtualSwitch. + :vartype extension_name: str + :ivar extension_enabled: This represents whether extension is enabled on virtualSwitch. + :vartype extension_enabled: bool + """ + + switch_id: Optional[str] = rest_field(name="switchId", visibility=["read"]) + """Unique identifier for virtualSwitch.""" + extension_name: Optional[str] = rest_field(name="extensionName", visibility=["read"]) + """This will show extension name for virtualSwitch.""" + extension_enabled: Optional[bool] = rest_field(name="extensionEnabled", visibility=["read"]) + """This represents whether extension is enabled on virtualSwitch.""" + + +class SystemData(_Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = 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 TargetDeviceConfiguration(_Model): + """Device configuration. + + :ivar network: Network configuration. + :vartype network: ~azure.mgmt.azurestackhci.models.NetworkConfiguration + :ivar host_name: Hostname of the device. + :vartype host_name: str + :ivar web_proxy: Web proxy configuration. + :vartype web_proxy: ~azure.mgmt.azurestackhci.models.WebProxyConfiguration + :ivar time: Time configuration. + :vartype time: ~azure.mgmt.azurestackhci.models.TimeConfiguration + :ivar storage: Storage configuration. + :vartype storage: ~azure.mgmt.azurestackhci.models.StorageConfiguration + """ + + network: Optional["_models.NetworkConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Network configuration.""" + host_name: Optional[str] = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"]) + """Hostname of the device.""" + web_proxy: Optional["_models.WebProxyConfiguration"] = rest_field( + name="webProxy", visibility=["read", "create", "update", "delete", "query"] + ) + """Web proxy configuration.""" + time: Optional["_models.TimeConfiguration"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Time configuration.""" + storage: Optional["_models.StorageConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Storage configuration.""" + + @overload + def __init__( + self, + *, + network: Optional["_models.NetworkConfiguration"] = None, + host_name: Optional[str] = None, + web_proxy: Optional["_models.WebProxyConfiguration"] = None, + time: Optional["_models.TimeConfiguration"] = None, + storage: Optional["_models.StorageConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TimeConfiguration(_Model): + """Time configuration. + + :ivar primary_time_server: Primary NTP server. + :vartype primary_time_server: str + :ivar secondary_time_server: Secondary NTP server. + :vartype secondary_time_server: str + :ivar time_zone: Time zone. + :vartype time_zone: str + """ + + primary_time_server: Optional[str] = rest_field( + name="primaryTimeServer", visibility=["read", "create", "update", "delete", "query"] + ) + """Primary NTP server.""" + secondary_time_server: Optional[str] = rest_field( + name="secondaryTimeServer", visibility=["read", "create", "update", "delete", "query"] + ) + """Secondary NTP server.""" + time_zone: Optional[str] = rest_field(name="timeZone", visibility=["read", "create", "update", "delete", "query"]) + """Time zone.""" + + @overload + def __init__( + self, + *, + primary_time_server: Optional[str] = None, + secondary_time_server: Optional[str] = None, + time_zone: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Update(ProxyResource): + """Update details. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: Update properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.UpdateProperties + :ivar location: The geo-location where the resource lives. + :vartype location: str + """ + + properties: Optional["_models.UpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Update properties.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.UpdateProperties"] = None, + location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateContent(ProxyResource): + """Represents a update content. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.azurestackhci.models.UpdateContentProperties + """ + + properties: Optional["_models.UpdateContentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.UpdateContentProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateContentProperties(_Model): + """Represents properties of a update content resource. + + :ivar update_payloads: Represents the payloads of a update content resource. Required. + :vartype update_payloads: list[~azure.mgmt.azurestackhci.models.ContentPayload] + """ + + update_payloads: list["_models.ContentPayload"] = rest_field( + name="updatePayloads", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the payloads of a update content resource. Required.""" + + @overload + def __init__( + self, + *, + update_payloads: list["_models.ContentPayload"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdatePrerequisite(_Model): + """If update State is HasPrerequisite, this property contains an array of objects describing + prerequisite updates before installing this update. Otherwise, it is empty. + + :ivar update_type: Updatable component type. + :vartype update_type: str + :ivar version: Version of the prerequisite. + :vartype version: str + :ivar package_name: Friendly name of the prerequisite. + :vartype package_name: str + """ + + update_type: Optional[str] = rest_field( + name="updateType", visibility=["read", "create", "update", "delete", "query"] + ) + """Updatable component type.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version of the prerequisite.""" + package_name: Optional[str] = rest_field( + name="packageName", visibility=["read", "create", "update", "delete", "query"] + ) + """Friendly name of the prerequisite.""" + + @overload + def __init__( + self, + *, + update_type: Optional[str] = None, + version: Optional[str] = None, + package_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateProperties(_Model): + """Details of a singular Update in HCI Cluster. + + :ivar provisioning_state: Provisioning state of the Updates proxy resource. Indicates the + current lifecycle status of the update operation, such as whether it has been accepted, is in + progress, or has completed. Known values are: "NotSpecified", "Error", "Succeeded", "Failed", + "Canceled", "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", + "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", "Accepted", "Provisioning", + and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar installed_date: Date that the update was installed. + :vartype installed_date: ~datetime.datetime + :ivar description: Description of the update. + :vartype description: str + :ivar min_sbe_version_required: Minimum Sbe Version of the update. + :vartype min_sbe_version_required: str + :ivar state: Represents the current state of the update as it relates to this stamp. This + includes phases such as preparation, installation, scanning, and error handling, providing + insight into the update's progress and any issues encountered. Known values are: + "HasPrerequisite", "Obsolete", "Ready", "NotApplicableBecauseAnotherUpdateIsInProgress", + "Preparing", "Installing", "Installed", "PreparationFailed", "InstallationFailed", "Invalid", + "Recalled", "Downloading", "DownloadFailed", "HealthChecking", "HealthCheckFailed", + "ReadyToInstall", "ScanInProgress", "ScanFailed", and "AdditionalContentRequired". + :vartype state: str or ~azure.mgmt.azurestackhci.models.State + :ivar prerequisites: If update State is HasPrerequisite, this property contains an array of + objects describing prerequisite updates before installing this update. Otherwise, it is empty. + :vartype prerequisites: list[~azure.mgmt.azurestackhci.models.UpdatePrerequisite] + :ivar component_versions: An array of component versions for a Solution Bundle update, and an + empty array otherwise. + :vartype component_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] + :ivar reboot_required: Indicates whether a reboot is required after the update or operation. + Helps determine if a system restart is necessary to complete the process. Known values are: + "Unknown", "True", and "False". + :vartype reboot_required: str or ~azure.mgmt.azurestackhci.models.RebootRequirement + :ivar health_state: Overall health state for update-specific health checks. Known values are: + "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". + :vartype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState + :ivar health_check_result: An array of PrecheckResult objects. + :vartype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] + :ivar health_check_date: Last time the package-specific checks were run. + :vartype health_check_date: ~datetime.datetime + :ivar package_path: Path where the update package is available. + :vartype package_path: str + :ivar package_size_in_mb: Size of the package. This value is a combination of the size from + update metadata and size of the payload that results from the live scan operation for OS update + content. + :vartype package_size_in_mb: float + :ivar display_name: Display name of the Update. + :vartype display_name: str + :ivar version: Version of the update. + :vartype version: str + :ivar publisher: Publisher of the update package. + :vartype publisher: str + :ivar release_link: Link to release notes for the update. + :vartype release_link: str + :ivar availability_type: Indicates how the update content is made available for download. This + determines whether the update is sourced locally, from an online repository, or requires user + notification. Known values are: "Local", "Online", and "Notify". + :vartype availability_type: str or ~azure.mgmt.azurestackhci.models.AvailabilityType + :ivar package_type: Customer-visible type of the update. + :vartype package_type: str + :ivar additional_properties: Extensible KV pairs serialized as a string. This is currently used + to report the stamp OEM family and hardware model information when an update is flagged as + Invalid for the stamp based on OEM type. + :vartype additional_properties: str + :ivar update_state_properties: Additional information regarding the state of the update. See + definition of UpdateStateProperties type below for more details on this property. + :vartype update_state_properties: ~azure.mgmt.azurestackhci.models.UpdateStateProperties + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the Updates proxy resource. Indicates the current lifecycle status of the + update operation, such as whether it has been accepted, is in progress, or has completed. Known + values are: \"NotSpecified\", \"Error\", \"Succeeded\", \"Failed\", \"Canceled\", + \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", + \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", \"Accepted\", + \"Provisioning\", and \"DisableInProgress\".""" + installed_date: Optional[datetime.datetime] = rest_field( + name="installedDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Date that the update was installed.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the update.""" + min_sbe_version_required: Optional[str] = rest_field( + name="minSbeVersionRequired", visibility=["read", "create", "update", "delete", "query"] + ) + """Minimum Sbe Version of the update.""" + state: Optional[Union[str, "_models.State"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the current state of the update as it relates to this stamp. This includes phases + such as preparation, installation, scanning, and error handling, providing insight into the + update's progress and any issues encountered. Known values are: \"HasPrerequisite\", + \"Obsolete\", \"Ready\", \"NotApplicableBecauseAnotherUpdateIsInProgress\", \"Preparing\", + \"Installing\", \"Installed\", \"PreparationFailed\", \"InstallationFailed\", \"Invalid\", + \"Recalled\", \"Downloading\", \"DownloadFailed\", \"HealthChecking\", \"HealthCheckFailed\", + \"ReadyToInstall\", \"ScanInProgress\", \"ScanFailed\", and \"AdditionalContentRequired\".""" + prerequisites: Optional[list["_models.UpdatePrerequisite"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """If update State is HasPrerequisite, this property contains an array of objects describing + prerequisite updates before installing this update. Otherwise, it is empty.""" + component_versions: Optional[list["_models.PackageVersionInfo"]] = rest_field( + name="componentVersions", visibility=["read", "create", "update", "delete", "query"] + ) + """An array of component versions for a Solution Bundle update, and an empty array otherwise.""" + reboot_required: Optional[Union[str, "_models.RebootRequirement"]] = rest_field( + name="rebootRequired", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether a reboot is required after the update or operation. Helps determine if a + system restart is necessary to complete the process. Known values are: \"Unknown\", \"True\", + and \"False\".""" + health_state: Optional[Union[str, "_models.HealthState"]] = rest_field( + name="healthState", visibility=["read", "create", "update", "delete", "query"] + ) + """Overall health state for update-specific health checks. Known values are: \"Unknown\", + \"Success\", \"Failure\", \"Warning\", \"Error\", and \"InProgress\".""" + health_check_result: Optional[list["_models.PrecheckResult"]] = rest_field( + name="healthCheckResult", visibility=["read", "create", "update", "delete", "query"] + ) + """An array of PrecheckResult objects.""" + health_check_date: Optional[datetime.datetime] = rest_field( + name="healthCheckDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last time the package-specific checks were run.""" + package_path: Optional[str] = rest_field( + name="packagePath", visibility=["read", "create", "update", "delete", "query"] + ) + """Path where the update package is available.""" + package_size_in_mb: Optional[float] = rest_field( + name="packageSizeInMb", visibility=["read", "create", "update", "delete", "query"] + ) + """Size of the package. This value is a combination of the size from update metadata and size of + the payload that results from the live scan operation for OS update content.""" + display_name: Optional[str] = rest_field( + name="displayName", visibility=["read", "create", "update", "delete", "query"] + ) + """Display name of the Update.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Version of the update.""" + publisher: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Publisher of the update package.""" + release_link: Optional[str] = rest_field( + name="releaseLink", visibility=["read", "create", "update", "delete", "query"] + ) + """Link to release notes for the update.""" + availability_type: Optional[Union[str, "_models.AvailabilityType"]] = rest_field( + name="availabilityType", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates how the update content is made available for download. This determines whether the + update is sourced locally, from an online repository, or requires user notification. Known + values are: \"Local\", \"Online\", and \"Notify\".""" + package_type: Optional[str] = rest_field( + name="packageType", visibility=["read", "create", "update", "delete", "query"] + ) + """Customer-visible type of the update.""" + additional_properties: Optional[str] = rest_field( + name="additionalProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Extensible KV pairs serialized as a string. This is currently used to report the stamp OEM + family and hardware model information when an update is flagged as Invalid for the stamp based + on OEM type.""" + update_state_properties: Optional["_models.UpdateStateProperties"] = rest_field( + name="updateStateProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional information regarding the state of the update. See definition of + UpdateStateProperties type below for more details on this property.""" + + __flattened_items = ["progress_percentage", "notify_message"] + + @overload + def __init__( + self, + *, + installed_date: Optional[datetime.datetime] = None, + description: Optional[str] = None, + min_sbe_version_required: Optional[str] = None, + state: Optional[Union[str, "_models.State"]] = None, + prerequisites: Optional[list["_models.UpdatePrerequisite"]] = None, + component_versions: Optional[list["_models.PackageVersionInfo"]] = None, + reboot_required: Optional[Union[str, "_models.RebootRequirement"]] = None, + health_state: Optional[Union[str, "_models.HealthState"]] = None, + health_check_result: Optional[list["_models.PrecheckResult"]] = None, + health_check_date: Optional[datetime.datetime] = None, + package_path: Optional[str] = None, + package_size_in_mb: Optional[float] = None, + display_name: Optional[str] = None, + version: Optional[str] = None, + publisher: Optional[str] = None, + release_link: Optional[str] = None, + availability_type: Optional[Union[str, "_models.AvailabilityType"]] = None, + package_type: Optional[str] = None, + additional_properties: Optional[str] = None, + update_state_properties: Optional["_models.UpdateStateProperties"] = 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.update_state_properties is None: + return None + return getattr(self.update_state_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.update_state_properties is None: + self.update_state_properties = self._attr_to_rest_field["update_state_properties"]._class_type() + setattr(self.update_state_properties, key, value) + else: + super().__setattr__(key, value) + + +class UpdateRun(ProxyResource): + """Details of an Update run. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: Describes Update Run Properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.UpdateRunProperties + :ivar location: The geo-location where the resource lives. + :vartype location: str + """ + + properties: Optional["_models.UpdateRunProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Describes Update Run Properties.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.UpdateRunProperties"] = None, + location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateRunProperties(_Model): + """Details of an Update run. + + :ivar provisioning_state: Provisioning state of the UpdateRuns proxy resource. Indicates the + current lifecycle status of the update operation, such as whether it has been accepted, is in + progress, or has completed. Known values are: "NotSpecified", "Error", "Succeeded", "Failed", + "Canceled", "Connected", "Disconnected", "Deleted", "Creating", "Updating", "Deleting", + "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", "Accepted", "Provisioning", + and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar time_started: Timestamp of the update run was started. + :vartype time_started: ~datetime.datetime + :ivar last_updated_time: Timestamp of the most recently completed step in the update run. + :vartype last_updated_time: ~datetime.datetime + :ivar duration: Duration of the update run. + :vartype duration: str + :ivar state: Represents the current state of the update run. Indicates whether the update is in + progress, has completed successfully, failed, or is in an unknown state. Known values are: + "Unknown", "Succeeded", "InProgress", and "Failed". + :vartype state: str or ~azure.mgmt.azurestackhci.models.UpdateRunPropertiesState + :ivar progress: Progress representation of the update run steps. + :vartype progress: ~azure.mgmt.azurestackhci.models.Step + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the UpdateRuns proxy resource. Indicates the current lifecycle status of + the update operation, such as whether it has been accepted, is in progress, or has completed. + Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", \"Failed\", \"Canceled\", + \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", \"Deleting\", + \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", \"Accepted\", + \"Provisioning\", and \"DisableInProgress\".""" + time_started: Optional[datetime.datetime] = rest_field( + name="timeStarted", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Timestamp of the update run was started.""" + last_updated_time: Optional[datetime.datetime] = rest_field( + name="lastUpdatedTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Timestamp of the most recently completed step in the update run.""" + duration: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Duration of the update run.""" + state: Optional[Union[str, "_models.UpdateRunPropertiesState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the current state of the update run. Indicates whether the update is in progress, + has completed successfully, failed, or is in an unknown state. Known values are: \"Unknown\", + \"Succeeded\", \"InProgress\", and \"Failed\".""" + progress: Optional["_models.Step"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Progress representation of the update run steps.""" + + __flattened_items = [ + "name", + "description", + "error_message", + "status", + "start_time_utc", + "end_time_utc", + "last_updated_time_utc", + "expected_execution_time", + "steps", + ] + + @overload + def __init__( + self, + *, + time_started: Optional[datetime.datetime] = None, + last_updated_time: Optional[datetime.datetime] = None, + duration: Optional[str] = None, + state: Optional[Union[str, "_models.UpdateRunPropertiesState"]] = None, + progress: Optional["_models.Step"] = 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.progress is None: + return None + return getattr(self.progress, 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.progress is None: + self.progress = self._attr_to_rest_field["progress"]._class_type() + setattr(self.progress, key, value) + else: + super().__setattr__(key, value) + + +class UpdateStateProperties(_Model): + """Additional information regarding the state of the update. See definition of + UpdateStateProperties type below for more details on this property. + + :ivar progress_percentage: Progress percentage of ongoing operation. Currently this property is + only valid when the update is in the Downloading state, where it maps to how much of the update + content has been downloaded. + :vartype progress_percentage: float + :ivar notify_message: Brief message with instructions for updates of AvailabilityType Notify. + :vartype notify_message: str + """ + + progress_percentage: Optional[float] = rest_field( + name="progressPercentage", visibility=["read", "create", "update", "delete", "query"] + ) + """Progress percentage of ongoing operation. Currently this property is only valid when the update + is in the Downloading state, where it maps to how much of the update content has been + downloaded.""" + notify_message: Optional[str] = rest_field( + name="notifyMessage", visibility=["read", "create", "update", "delete", "query"] + ) + """Brief message with instructions for updates of AvailabilityType Notify.""" + + @overload + def __init__( + self, + *, + progress_percentage: Optional[float] = None, + notify_message: 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 UpdateSummaries(ProxyResource): + """Get the update summaries for the cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: Update summaries properties. + :vartype properties: ~azure.mgmt.azurestackhci.models.UpdateSummariesProperties + :ivar location: The geo-location where the resource lives. + :vartype location: str + """ + + properties: Optional["_models.UpdateSummariesProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Update summaries properties.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives.""" + + __flattened_items = [ + "provisioning_state", + "oem_family", + "current_oem_version", + "hardware_model", + "package_versions", + "current_version", + "current_sbe_version", + "last_updated", + "last_checked", + "health_state", + "health_check_result", + "health_check_date", + "state", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.UpdateSummariesProperties"] = None, + location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _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 UpdateSummariesProperties(_Model): + """Properties of Update summaries. + + :ivar provisioning_state: Provisioning state of the UpdateSummaries proxy resource. Indicates + the current lifecycle status of the update summary operation, such as whether it has been + accepted, is in progress, or has completed. Known values are: "NotSpecified", "Error", + "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", + "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", + "Accepted", "Provisioning", and "DisableInProgress". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + :ivar oem_family: OEM family name. + :vartype oem_family: str + :ivar current_oem_version: Current OEM Version. + :vartype current_oem_version: str + :ivar hardware_model: Name of the hardware model. + :vartype hardware_model: str + :ivar package_versions: Current version of each updatable component. + :vartype package_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] + :ivar current_version: Current Solution Bundle version of the stamp. + :vartype current_version: str + :ivar current_sbe_version: Current Sbe version of the stamp. + :vartype current_sbe_version: str + :ivar last_updated: Last time an update installation completed successfully. + :vartype last_updated: ~datetime.datetime + :ivar last_checked: Last time the update service successfully checked for updates. + :vartype last_checked: ~datetime.datetime + :ivar health_state: Overall health state for update-specific health checks. Known values are: + "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". + :vartype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState + :ivar health_check_result: An array of pre-check result objects. + :vartype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] + :ivar health_check_date: Last time the package-specific checks were run. + :vartype health_check_date: ~datetime.datetime + :ivar state: Overall update state of the stamp. Indicates the current status of update + deployment across the stamp, including preparation, application, and any issues encountered. + Known values are: "Unknown", "AppliedSuccessfully", "UpdateAvailable", "UpdateInProgress", + "UpdateFailed", "NeedsAttention", "PreparationInProgress", and "PreparationFailed". + :vartype state: str or ~azure.mgmt.azurestackhci.models.UpdateSummariesPropertiesState + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of the UpdateSummaries proxy resource. Indicates the current lifecycle + status of the update summary operation, such as whether it has been accepted, is in progress, + or has completed. Known values are: \"NotSpecified\", \"Error\", \"Succeeded\", \"Failed\", + \"Canceled\", \"Connected\", \"Disconnected\", \"Deleted\", \"Creating\", \"Updating\", + \"Deleting\", \"Moving\", \"PartiallySucceeded\", \"PartiallyConnected\", \"InProgress\", + \"Accepted\", \"Provisioning\", and \"DisableInProgress\".""" + oem_family: Optional[str] = rest_field(name="oemFamily", visibility=["read", "create", "update", "delete", "query"]) + """OEM family name.""" + current_oem_version: Optional[str] = rest_field( + name="currentOemVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Current OEM Version.""" + hardware_model: Optional[str] = rest_field( + name="hardwareModel", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the hardware model.""" + package_versions: Optional[list["_models.PackageVersionInfo"]] = rest_field( + name="packageVersions", visibility=["read", "create", "update", "delete", "query"] + ) + """Current version of each updatable component.""" + current_version: Optional[str] = rest_field( + name="currentVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Current Solution Bundle version of the stamp.""" + current_sbe_version: Optional[str] = rest_field( + name="currentSbeVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Current Sbe version of the stamp.""" + last_updated: Optional[datetime.datetime] = rest_field( + name="lastUpdated", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last time an update installation completed successfully.""" + last_checked: Optional[datetime.datetime] = rest_field( + name="lastChecked", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last time the update service successfully checked for updates.""" + health_state: Optional[Union[str, "_models.HealthState"]] = rest_field( + name="healthState", visibility=["read", "create", "update", "delete", "query"] + ) + """Overall health state for update-specific health checks. Known values are: \"Unknown\", + \"Success\", \"Failure\", \"Warning\", \"Error\", and \"InProgress\".""" + health_check_result: Optional[list["_models.PrecheckResult"]] = rest_field( + name="healthCheckResult", visibility=["read", "create", "update", "delete", "query"] + ) + """An array of pre-check result objects.""" + health_check_date: Optional[datetime.datetime] = rest_field( + name="healthCheckDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Last time the package-specific checks were run.""" + state: Optional[Union[str, "_models.UpdateSummariesPropertiesState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Overall update state of the stamp. Indicates the current status of update deployment across the + stamp, including preparation, application, and any issues encountered. Known values are: + \"Unknown\", \"AppliedSuccessfully\", \"UpdateAvailable\", \"UpdateInProgress\", + \"UpdateFailed\", \"NeedsAttention\", \"PreparationInProgress\", and \"PreparationFailed\".""" + + @overload + def __init__( + self, + *, + oem_family: Optional[str] = None, + current_oem_version: Optional[str] = None, + hardware_model: Optional[str] = None, + package_versions: Optional[list["_models.PackageVersionInfo"]] = None, + current_version: Optional[str] = None, + current_sbe_version: Optional[str] = None, + last_updated: Optional[datetime.datetime] = None, + last_checked: Optional[datetime.datetime] = None, + health_state: Optional[Union[str, "_models.HealthState"]] = None, + health_check_result: Optional[list["_models.PrecheckResult"]] = None, + health_check_date: Optional[datetime.datetime] = None, + state: Optional[Union[str, "_models.UpdateSummariesPropertiesState"]] = 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 UploadCertificateRequest(_Model): + """UploadCertificateRequest. + + :ivar properties: + :vartype properties: ~azure.mgmt.azurestackhci.models.RawCertificateData + """ + + properties: Optional["_models.RawCertificateData"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + properties: Optional["_models.RawCertificateData"] = 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 UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" + + +class UserDetails(_Model): + """User configuration. + + :ivar user_name: Name of the user. Required. + :vartype user_name: str + :ivar secret_type: Type of the secret used for authentication. Required. Known values are: + "KeyVault" and "SshPubKey". + :vartype secret_type: str or ~azure.mgmt.azurestackhci.models.SecretType + :ivar secret_location: Location of the secret used for authentication. + :vartype secret_location: str + :ivar ssh_pub_key: SSH Public Key for the user. + :vartype ssh_pub_key: list[str] + """ + + user_name: str = rest_field(name="userName", visibility=["read", "create", "update", "delete", "query"]) + """Name of the user. Required.""" + secret_type: Union[str, "_models.SecretType"] = rest_field( + name="secretType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the secret used for authentication. Required. Known values are: \"KeyVault\" and + \"SshPubKey\".""" + secret_location: Optional[str] = rest_field( + name="secretLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """Location of the secret used for authentication.""" + ssh_pub_key: Optional[list[str]] = rest_field( + name="sshPubKey", visibility=["read", "create", "update", "delete", "query"] + ) + """SSH Public Key for the user.""" + + @overload + def __init__( + self, + *, + user_name: str, + secret_type: Union[str, "_models.SecretType"], + secret_location: Optional[str] = None, + ssh_pub_key: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ValidatedSolutionRecipe(ProxyResource): + """Represents a validated solution recipe resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeProperties + """ + + properties: Optional["_models.ValidatedSolutionRecipeProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.ValidatedSolutionRecipeProperties"] = 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 ValidatedSolutionRecipeCapabilities(_Model): + """Represents capabilities available in a validated solution recipe. + + :ivar cluster_capabilities: Represents the cluster capabilities. Required. + :vartype cluster_capabilities: + list[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeCapability] + :ivar node_capabilities: Represents the node capabilities. Required. + :vartype node_capabilities: + list[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeCapability] + """ + + cluster_capabilities: list["_models.ValidatedSolutionRecipeCapability"] = rest_field( + name="clusterCapabilities", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the cluster capabilities. Required.""" + node_capabilities: list["_models.ValidatedSolutionRecipeCapability"] = rest_field( + name="nodeCapabilities", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the node capabilities. Required.""" + + @overload + def __init__( + self, + *, + cluster_capabilities: list["_models.ValidatedSolutionRecipeCapability"], + node_capabilities: list["_models.ValidatedSolutionRecipeCapability"], + ) -> 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 ValidatedSolutionRecipeCapability(_Model): + """Represents capability available in a validated solution recipe. + + :ivar capability_name: Represents the capability name. Required. + :vartype capability_name: str + """ + + capability_name: str = rest_field(name="capabilityName", visibility=["read", "create", "update", "delete", "query"]) + """Represents the capability name. Required.""" + + @overload + def __init__( + self, + *, + capability_name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ValidatedSolutionRecipeComponent(_Model): + """Represents component available in a validated solution recipe. + + :ivar name: Represents the component's name. Required. + :vartype name: str + :ivar type: Represents the component's type. Required. + :vartype type: str + :ivar required_version: Represents the component's required version. + :vartype required_version: str + :ivar install_order: Represents the component's install order. + :vartype install_order: int + :ivar tags: Represents the component's tags. Required. + :vartype tags: list[str] + :ivar payloads: Represents the component's payloads. + :vartype payloads: + list[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeComponentPayload] + :ivar metadata: Represents the component's metadata. + :vartype metadata: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeComponentMetadata + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the component's name. Required.""" + type: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the component's type. Required.""" + required_version: Optional[str] = rest_field( + name="requiredVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the component's required version.""" + install_order: Optional[int] = rest_field( + name="installOrder", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the component's install order.""" + tags: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the component's tags. Required.""" + payloads: Optional[list["_models.ValidatedSolutionRecipeComponentPayload"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the component's payloads.""" + metadata: Optional["_models.ValidatedSolutionRecipeComponentMetadata"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the component's metadata.""" + + @overload + def __init__( + self, + *, + name: str, + type: str, + tags: list[str], + required_version: Optional[str] = None, + install_order: Optional[int] = None, + payloads: Optional[list["_models.ValidatedSolutionRecipeComponentPayload"]] = None, + metadata: Optional["_models.ValidatedSolutionRecipeComponentMetadata"] = 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 ValidatedSolutionRecipeComponentMetadata(_Model): + """Represents metadata associated with a component available in a validated solution recipe. + + :ivar extension_type: Represents the type of extension. + :vartype extension_type: str + :ivar publisher: Represents the publisher of the extension. + :vartype publisher: str + :ivar enable_automatic_upgrade: Indicates whether automatic upgrades of the extension are + enabled. + :vartype enable_automatic_upgrade: bool + :ivar lcm_update: Indicates whether the LCM (Lifecycle Management) update of the extension is + enabled. + :vartype lcm_update: bool + :ivar catalog: Specifies the catalog to which the extension belongs. + :vartype catalog: str + :ivar ring: Specifies the ring to which the extension belongs, internally used by component. + :vartype ring: str + :ivar release_train: Specifies the release train to which given component belongs. + :vartype release_train: str + :ivar link: Specifies the link associated with the extension. + :vartype link: str + :ivar name: Specifies the name of the extension. + :vartype name: str + :ivar expected_hash: Specifies the expected hash of the extension. + :vartype expected_hash: str + :ivar preview_source: Specifies the preview source of the extension. + :vartype preview_source: str + """ + + extension_type: Optional[str] = rest_field( + name="extensionType", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents the type of extension.""" + publisher: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the publisher of the extension.""" + enable_automatic_upgrade: Optional[bool] = rest_field( + name="enableAutomaticUpgrade", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether automatic upgrades of the extension are enabled.""" + lcm_update: Optional[bool] = rest_field( + name="lcmUpdate", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether the LCM (Lifecycle Management) update of the extension is enabled.""" + catalog: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifies the catalog to which the extension belongs.""" + ring: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifies the ring to which the extension belongs, internally used by component.""" + release_train: Optional[str] = rest_field( + name="releaseTrain", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the release train to which given component belongs.""" + link: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifies the link associated with the extension.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifies the name of the extension.""" + expected_hash: Optional[str] = rest_field( + name="expectedHash", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the expected hash of the extension.""" + preview_source: Optional[str] = rest_field( + name="previewSource", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the preview source of the extension.""" + + @overload + def __init__( + self, + *, + extension_type: Optional[str] = None, + publisher: Optional[str] = None, + enable_automatic_upgrade: Optional[bool] = None, + lcm_update: Optional[bool] = None, + catalog: Optional[str] = None, + ring: Optional[str] = None, + release_train: Optional[str] = None, + link: Optional[str] = None, + name: Optional[str] = None, + expected_hash: Optional[str] = None, + preview_source: 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 ValidatedSolutionRecipeComponentPayload(_Model): + """Represents payloads associated with a component available in a validated solution recipe. + + :ivar identifier: Represents the unique identifier of the payload used to query the URL. + Required. + :vartype identifier: str + :ivar hash: Represents the cryptographic hash of the payload, ensuring data integrity. + Required. + :vartype hash: str + :ivar file_name: Represents the name of the file associated with the payload. Required. + :vartype file_name: str + :ivar url: Represents the URL from which the payload can be downloaded. Required. + :vartype url: str + """ + + identifier: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the unique identifier of the payload used to query the URL. Required.""" + hash: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the cryptographic hash of the payload, ensuring data integrity. Required.""" + file_name: str = rest_field(name="fileName", visibility=["read", "create", "update", "delete", "query"]) + """Represents the name of the file associated with the payload. Required.""" + url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the URL from which the payload can be downloaded. Required.""" + + @overload + def __init__( + self, + *, + identifier: str, + hash: str, + file_name: str, + url: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ValidatedSolutionRecipeContent(_Model): + """Represents contents of a validated solution recipe resource. + + :ivar info: Represents information about a validated solution recipe. Required. + :vartype info: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeInfo + :ivar capabilities: Represents capabilities available in a validated solution recipe. + :vartype capabilities: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeCapabilities + :ivar components: Represents components available in a validated solution recipe. Required. + :vartype components: list[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeComponent] + """ + + info: "_models.ValidatedSolutionRecipeInfo" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents information about a validated solution recipe. Required.""" + capabilities: Optional["_models.ValidatedSolutionRecipeCapabilities"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Represents capabilities available in a validated solution recipe.""" + components: list["_models.ValidatedSolutionRecipeComponent"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Represents components available in a validated solution recipe. Required.""" + + @overload + def __init__( + self, + *, + info: "_models.ValidatedSolutionRecipeInfo", + components: list["_models.ValidatedSolutionRecipeComponent"], + capabilities: Optional["_models.ValidatedSolutionRecipeCapabilities"] = 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 ValidatedSolutionRecipeInfo(_Model): + """Represents information about a validated solution recipe. + + :ivar solution_type: Represents the solution type for which this validated solution recipe is + applicable. Required. + :vartype solution_type: str + :ivar version: Represents the version for which this validated solution recipe is applicable. + Required. + :vartype version: str + """ + + solution_type: str = rest_field(name="solutionType", visibility=["read", "create", "update", "delete", "query"]) + """Represents the solution type for which this validated solution recipe is applicable. Required.""" + version: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the version for which this validated solution recipe is applicable. Required.""" + + @overload + def __init__( + self, + *, + solution_type: str, + version: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ValidatedSolutionRecipeProperties(_Model): + """Represents properties of a validated solution recipe resource. + + :ivar recipe_content: Represents contents of a validated solution recipe. Required. + :vartype recipe_content: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipeContent + :ivar signature: Represents the signature of the recipe, to be used for ensuring its integrity. + :vartype signature: str + """ + + recipe_content: "_models.ValidatedSolutionRecipeContent" = rest_field( + name="recipeContent", visibility=["read", "create", "update", "delete", "query"] + ) + """Represents contents of a validated solution recipe. Required.""" + signature: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Represents the signature of the recipe, to be used for ensuring its integrity.""" + + @overload + def __init__( + self, + *, + recipe_content: "_models.ValidatedSolutionRecipeContent", + signature: 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 ValidateOwnershipVouchersRequest(_Model): + """Validate Ownership Voucher Request. + + :ivar ownership_voucher_details: Ownership Voucher Details. Required. + :vartype ownership_voucher_details: + list[~azure.mgmt.azurestackhci.models.OwnershipVoucherDetails] + """ + + ownership_voucher_details: list["_models.OwnershipVoucherDetails"] = rest_field( + name="ownershipVoucherDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Ownership Voucher Details. Required.""" + + @overload + def __init__( + self, + *, + ownership_voucher_details: list["_models.OwnershipVoucherDetails"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ValidateOwnershipVouchersResponse(_Model): + """Validate Ownership Voucher Response. + + :ivar ownership_voucher_validation_details: Ownership Voucher Validation Details. Required. + :vartype ownership_voucher_validation_details: + list[~azure.mgmt.azurestackhci.models.OwnershipVoucherValidationDetails] + """ + + ownership_voucher_validation_details: list["_models.OwnershipVoucherValidationDetails"] = rest_field( + name="ownershipVoucherValidationDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """Ownership Voucher Validation Details. Required.""" + + @overload + def __init__( + self, + *, + ownership_voucher_validation_details: list["_models.OwnershipVoucherValidationDetails"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ValidateRequest(_Model): + """The validate request for Edge Device. + + :ivar edge_device_ids: Node Ids against which, current node has to be validated. Required. + :vartype edge_device_ids: list[str] + :ivar additional_info: Additional info required for validation. + :vartype additional_info: str + """ + + edge_device_ids: list[str] = rest_field( + name="edgeDeviceIds", visibility=["read", "create", "update", "delete", "query"] + ) + """Node Ids against which, current node has to be validated. Required.""" + additional_info: Optional[str] = rest_field( + name="additionalInfo", visibility=["read", "create", "update", "delete", "query"] + ) + """Additional info required for validation.""" + + @overload + def __init__( + self, + *, + edge_device_ids: list[str], + additional_info: 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 ValidateResponse(_Model): + """An Accepted response with an Operation-Location header. + + :ivar status: edge device validation status. + :vartype status: str + """ + + status: Optional[str] = rest_field(visibility=["read"]) + """edge device validation status.""" + + +class WebProxyConfiguration(_Model): + """Web proxy configuration. + + :ivar connection_uri: Connection URI of the web proxy. + :vartype connection_uri: str + :ivar port: Port of the web proxy. + :vartype port: str + :ivar bypass_list: Bypass list for the web proxy. + :vartype bypass_list: list[str] + """ + + connection_uri: Optional[str] = rest_field( + name="connectionUri", visibility=["read", "create", "update", "delete", "query"] + ) + """Connection URI of the web proxy.""" + port: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Port of the web proxy.""" + bypass_list: Optional[list[str]] = rest_field( + name="bypassList", visibility=["read", "create", "update", "delete", "query"] + ) + """Bypass list for the web proxy.""" + + @overload + def __init__( + self, + *, + connection_uri: Optional[str] = None, + port: Optional[str] = None, + bypass_list: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models_py3.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models_py3.py deleted file mode 100644 index acc84c5de59c..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_models_py3.py +++ /dev/null @@ -1,6472 +0,0 @@ -# coding=utf-8 -# pylint: disable=too-many-lines -# -------------------------------------------------------------------------- -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -import sys -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union - -from .. import _serialization - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - - -class ArcConnectivityProperties(_serialization.Model): - """Connectivity related configuration required by arc server. - - :ivar enabled: True indicates ARC connectivity is enabled. - :vartype enabled: bool - :ivar service_configurations: Service configurations associated with the connectivity resource. - They are only processed by the server if 'enabled' property is set to 'true'. - :vartype service_configurations: list[~azure.mgmt.azurestackhci.models.ServiceConfiguration] - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "service_configurations": {"key": "serviceConfigurations", "type": "[ServiceConfiguration]"}, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - service_configurations: Optional[List["_models.ServiceConfiguration"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: True indicates ARC connectivity is enabled. - :paramtype enabled: bool - :keyword service_configurations: Service configurations associated with the connectivity - resource. They are only processed by the server if 'enabled' property is set to 'true'. - :paramtype service_configurations: list[~azure.mgmt.azurestackhci.models.ServiceConfiguration] - """ - super().__init__(**kwargs) - self.enabled = enabled - self.service_configurations = service_configurations - - -class ArcIdentityResponse(_serialization.Model): - """ArcIdentity details. - - :ivar arc_application_client_id: - :vartype arc_application_client_id: str - :ivar arc_application_tenant_id: - :vartype arc_application_tenant_id: str - :ivar arc_service_principal_object_id: - :vartype arc_service_principal_object_id: str - :ivar arc_application_object_id: - :vartype arc_application_object_id: str - """ - - _attribute_map = { - "arc_application_client_id": {"key": "properties.arcApplicationClientId", "type": "str"}, - "arc_application_tenant_id": {"key": "properties.arcApplicationTenantId", "type": "str"}, - "arc_service_principal_object_id": {"key": "properties.arcServicePrincipalObjectId", "type": "str"}, - "arc_application_object_id": {"key": "properties.arcApplicationObjectId", "type": "str"}, - } - - def __init__( - self, - *, - arc_application_client_id: Optional[str] = None, - arc_application_tenant_id: Optional[str] = None, - arc_service_principal_object_id: Optional[str] = None, - arc_application_object_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword arc_application_client_id: - :paramtype arc_application_client_id: str - :keyword arc_application_tenant_id: - :paramtype arc_application_tenant_id: str - :keyword arc_service_principal_object_id: - :paramtype arc_service_principal_object_id: str - :keyword arc_application_object_id: - :paramtype arc_application_object_id: str - """ - super().__init__(**kwargs) - self.arc_application_client_id = arc_application_client_id - self.arc_application_tenant_id = arc_application_tenant_id - self.arc_service_principal_object_id = arc_service_principal_object_id - self.arc_application_object_id = arc_application_object_id - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - """ - - -class ArcSetting(ProxyResource): # pylint: disable=too-many-instance-attributes - """ArcSetting details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar provisioning_state: Provisioning state of the ArcSetting proxy resource. Known values - are: "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar arc_instance_resource_group: The resource group that hosts the Arc agents, ie. Hybrid - Compute Machine resources. - :vartype arc_instance_resource_group: str - :ivar arc_application_client_id: App id of arc AAD identity. - :vartype arc_application_client_id: str - :ivar arc_application_tenant_id: Tenant id of arc AAD identity. - :vartype arc_application_tenant_id: str - :ivar arc_service_principal_object_id: Object id of arc AAD service principal. - :vartype arc_service_principal_object_id: str - :ivar arc_application_object_id: Object id of arc AAD identity. - :vartype arc_application_object_id: str - :ivar aggregate_state: Aggregate state of Arc agent across the nodes in this HCI cluster. Known - values are: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", "Connected", - "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype aggregate_state: str or ~azure.mgmt.azurestackhci.models.ArcSettingAggregateState - :ivar per_node_details: State of Arc agent in each of the nodes. - :vartype per_node_details: list[~azure.mgmt.azurestackhci.models.PerNodeState] - :ivar connectivity_properties: contains connectivity related configuration for ARC resources. - :vartype connectivity_properties: JSON - :ivar default_extensions: Properties for each of the default extensions category. - :vartype default_extensions: list[~azure.mgmt.azurestackhci.models.DefaultExtensionDetails] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "aggregate_state": {"readonly": True}, - "per_node_details": {"readonly": True}, - "default_extensions": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "arc_instance_resource_group": {"key": "properties.arcInstanceResourceGroup", "type": "str"}, - "arc_application_client_id": {"key": "properties.arcApplicationClientId", "type": "str"}, - "arc_application_tenant_id": {"key": "properties.arcApplicationTenantId", "type": "str"}, - "arc_service_principal_object_id": {"key": "properties.arcServicePrincipalObjectId", "type": "str"}, - "arc_application_object_id": {"key": "properties.arcApplicationObjectId", "type": "str"}, - "aggregate_state": {"key": "properties.aggregateState", "type": "str"}, - "per_node_details": {"key": "properties.perNodeDetails", "type": "[PerNodeState]"}, - "connectivity_properties": {"key": "properties.connectivityProperties", "type": "object"}, - "default_extensions": {"key": "properties.defaultExtensions", "type": "[DefaultExtensionDetails]"}, - } - - def __init__( - self, - *, - arc_instance_resource_group: Optional[str] = None, - arc_application_client_id: Optional[str] = None, - arc_application_tenant_id: Optional[str] = None, - arc_service_principal_object_id: Optional[str] = None, - arc_application_object_id: Optional[str] = None, - connectivity_properties: Optional[JSON] = None, - **kwargs: Any - ) -> None: - """ - :keyword arc_instance_resource_group: The resource group that hosts the Arc agents, ie. Hybrid - Compute Machine resources. - :paramtype arc_instance_resource_group: str - :keyword arc_application_client_id: App id of arc AAD identity. - :paramtype arc_application_client_id: str - :keyword arc_application_tenant_id: Tenant id of arc AAD identity. - :paramtype arc_application_tenant_id: str - :keyword arc_service_principal_object_id: Object id of arc AAD service principal. - :paramtype arc_service_principal_object_id: str - :keyword arc_application_object_id: Object id of arc AAD identity. - :paramtype arc_application_object_id: str - :keyword connectivity_properties: contains connectivity related configuration for ARC - resources. - :paramtype connectivity_properties: JSON - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.arc_instance_resource_group = arc_instance_resource_group - self.arc_application_client_id = arc_application_client_id - self.arc_application_tenant_id = arc_application_tenant_id - self.arc_service_principal_object_id = arc_service_principal_object_id - self.arc_application_object_id = arc_application_object_id - self.aggregate_state = None - self.per_node_details = None - self.connectivity_properties = connectivity_properties - self.default_extensions = None - - -class ArcSettingList(_serialization.Model): - """List of ArcSetting proxy resources for the HCI cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of ArcSetting proxy resources. - :vartype value: list[~azure.mgmt.azurestackhci.models.ArcSetting] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ArcSetting]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class ArcSettingsPatch(_serialization.Model): - """ArcSetting details to update. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar connectivity_properties: contains connectivity related configuration for ARC resources. - :vartype connectivity_properties: JSON - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "connectivity_properties": {"key": "properties.connectivityProperties", "type": "object"}, - } - - def __init__( - self, *, tags: Optional[Dict[str, str]] = None, connectivity_properties: Optional[JSON] = None, **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword connectivity_properties: contains connectivity related configuration for ARC - resources. - :paramtype connectivity_properties: JSON - """ - super().__init__(**kwargs) - self.tags = tags - self.connectivity_properties = connectivity_properties - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes - """Cluster details. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar provisioning_state: Provisioning state. Known values are: "NotSpecified", "Error", - "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar status: Status of the cluster agent. Known values are: "NotYetRegistered", - "ConnectedRecently", "NotConnectedRecently", "Disconnected", "Error", "NotSpecified", - "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", - "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", and "InProgress". - :vartype status: str or ~azure.mgmt.azurestackhci.models.Status - :ivar connectivity_status: Overall connectivity status for the cluster resource. Known values - are: "NotYetRegistered", "Connected", "NotConnectedRecently", "PartiallyConnected", - "Disconnected", and "NotSpecified". - :vartype connectivity_status: str or ~azure.mgmt.azurestackhci.models.ConnectivityStatus - :ivar cloud_id: Unique, immutable resource id. - :vartype cloud_id: str - :ivar cloud_management_endpoint: Endpoint configured for management from the Azure portal. - :vartype cloud_management_endpoint: str - :ivar aad_client_id: App id of cluster AAD identity. - :vartype aad_client_id: str - :ivar aad_tenant_id: Tenant id of cluster AAD identity. - :vartype aad_tenant_id: str - :ivar aad_application_object_id: Object id of cluster AAD identity. - :vartype aad_application_object_id: str - :ivar aad_service_principal_object_id: Id of cluster identity service principal. - :vartype aad_service_principal_object_id: str - :ivar software_assurance_properties: Software Assurance properties of the cluster. - :vartype software_assurance_properties: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceProperties - :ivar log_collection_properties: Log Collection properties of the cluster. - :vartype log_collection_properties: ~azure.mgmt.azurestackhci.models.LogCollectionProperties - :ivar remote_support_properties: RemoteSupport properties of the cluster. - :vartype remote_support_properties: ~azure.mgmt.azurestackhci.models.RemoteSupportProperties - :ivar desired_properties: Desired properties of the cluster. - :vartype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties - :ivar reported_properties: Properties reported by cluster agent. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.ClusterReportedProperties - :ivar isolated_vm_attestation_configuration: Attestation configurations for isolated VM (e.g. - TVM, CVM) of the cluster. - :vartype isolated_vm_attestation_configuration: - ~azure.mgmt.azurestackhci.models.IsolatedVmAttestationConfiguration - :ivar trial_days_remaining: Number of days remaining in the trial period. - :vartype trial_days_remaining: float - :ivar billing_model: Type of billing applied to the resource. - :vartype billing_model: str - :ivar registration_timestamp: First cluster sync timestamp. - :vartype registration_timestamp: ~datetime.datetime - :ivar last_sync_timestamp: Most recent cluster sync timestamp. - :vartype last_sync_timestamp: ~datetime.datetime - :ivar last_billing_timestamp: Most recent billing meter timestamp. - :vartype last_billing_timestamp: ~datetime.datetime - :ivar service_endpoint: Region specific DataPath Endpoint of the cluster. - :vartype service_endpoint: str - :ivar resource_provider_object_id: Object id of RP Service Principal. - :vartype resource_provider_object_id: str - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type_identity_type: Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Known values are: "None", "SystemAssigned", "UserAssigned", - and "SystemAssigned, UserAssigned". - :vartype type_identity_type: str or ~azure.mgmt.azurestackhci.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.azurestackhci.models.UserAssignedIdentity] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "provisioning_state": {"readonly": True}, - "status": {"readonly": True}, - "connectivity_status": {"readonly": True}, - "cloud_id": {"readonly": True}, - "reported_properties": {"readonly": True}, - "isolated_vm_attestation_configuration": {"readonly": True}, - "trial_days_remaining": {"readonly": True}, - "billing_model": {"readonly": True}, - "registration_timestamp": {"readonly": True}, - "last_sync_timestamp": {"readonly": True}, - "last_billing_timestamp": {"readonly": True}, - "service_endpoint": {"readonly": True}, - "resource_provider_object_id": {"readonly": True}, - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "connectivity_status": {"key": "properties.connectivityStatus", "type": "str"}, - "cloud_id": {"key": "properties.cloudId", "type": "str"}, - "cloud_management_endpoint": {"key": "properties.cloudManagementEndpoint", "type": "str"}, - "aad_client_id": {"key": "properties.aadClientId", "type": "str"}, - "aad_tenant_id": {"key": "properties.aadTenantId", "type": "str"}, - "aad_application_object_id": {"key": "properties.aadApplicationObjectId", "type": "str"}, - "aad_service_principal_object_id": {"key": "properties.aadServicePrincipalObjectId", "type": "str"}, - "software_assurance_properties": { - "key": "properties.softwareAssuranceProperties", - "type": "SoftwareAssuranceProperties", - }, - "log_collection_properties": {"key": "properties.logCollectionProperties", "type": "LogCollectionProperties"}, - "remote_support_properties": {"key": "properties.remoteSupportProperties", "type": "RemoteSupportProperties"}, - "desired_properties": {"key": "properties.desiredProperties", "type": "ClusterDesiredProperties"}, - "reported_properties": {"key": "properties.reportedProperties", "type": "ClusterReportedProperties"}, - "isolated_vm_attestation_configuration": { - "key": "properties.isolatedVmAttestationConfiguration", - "type": "IsolatedVmAttestationConfiguration", - }, - "trial_days_remaining": {"key": "properties.trialDaysRemaining", "type": "float"}, - "billing_model": {"key": "properties.billingModel", "type": "str"}, - "registration_timestamp": {"key": "properties.registrationTimestamp", "type": "iso-8601"}, - "last_sync_timestamp": {"key": "properties.lastSyncTimestamp", "type": "iso-8601"}, - "last_billing_timestamp": {"key": "properties.lastBillingTimestamp", "type": "iso-8601"}, - "service_endpoint": {"key": "properties.serviceEndpoint", "type": "str"}, - "resource_provider_object_id": {"key": "properties.resourceProviderObjectId", "type": "str"}, - "principal_id": {"key": "identity.principalId", "type": "str"}, - "tenant_id": {"key": "identity.tenantId", "type": "str"}, - "type_identity_type": {"key": "identity.type", "type": "str"}, - "user_assigned_identities": {"key": "identity.userAssignedIdentities", "type": "{UserAssignedIdentity}"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - cloud_management_endpoint: Optional[str] = None, - aad_client_id: Optional[str] = None, - aad_tenant_id: Optional[str] = None, - aad_application_object_id: Optional[str] = None, - aad_service_principal_object_id: Optional[str] = None, - software_assurance_properties: Optional["_models.SoftwareAssuranceProperties"] = None, - log_collection_properties: Optional["_models.LogCollectionProperties"] = None, - remote_support_properties: Optional["_models.RemoteSupportProperties"] = None, - desired_properties: Optional["_models.ClusterDesiredProperties"] = None, - type_identity_type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword cloud_management_endpoint: Endpoint configured for management from the Azure portal. - :paramtype cloud_management_endpoint: str - :keyword aad_client_id: App id of cluster AAD identity. - :paramtype aad_client_id: str - :keyword aad_tenant_id: Tenant id of cluster AAD identity. - :paramtype aad_tenant_id: str - :keyword aad_application_object_id: Object id of cluster AAD identity. - :paramtype aad_application_object_id: str - :keyword aad_service_principal_object_id: Id of cluster identity service principal. - :paramtype aad_service_principal_object_id: str - :keyword software_assurance_properties: Software Assurance properties of the cluster. - :paramtype software_assurance_properties: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceProperties - :keyword log_collection_properties: Log Collection properties of the cluster. - :paramtype log_collection_properties: ~azure.mgmt.azurestackhci.models.LogCollectionProperties - :keyword remote_support_properties: RemoteSupport properties of the cluster. - :paramtype remote_support_properties: ~azure.mgmt.azurestackhci.models.RemoteSupportProperties - :keyword desired_properties: Desired properties of the cluster. - :paramtype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties - :keyword type_identity_type: Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Known values are: "None", "SystemAssigned", "UserAssigned", - and "SystemAssigned, UserAssigned". - :paramtype type_identity_type: str or - ~azure.mgmt.azurestackhci.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.azurestackhci.models.UserAssignedIdentity] - """ - super().__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.status = None - self.connectivity_status = None - self.cloud_id = None - self.cloud_management_endpoint = cloud_management_endpoint - self.aad_client_id = aad_client_id - self.aad_tenant_id = aad_tenant_id - self.aad_application_object_id = aad_application_object_id - self.aad_service_principal_object_id = aad_service_principal_object_id - self.software_assurance_properties = software_assurance_properties - self.log_collection_properties = log_collection_properties - self.remote_support_properties = remote_support_properties - self.desired_properties = desired_properties - self.reported_properties = None - self.isolated_vm_attestation_configuration = None - self.trial_days_remaining = None - self.billing_model = None - self.registration_timestamp = None - self.last_sync_timestamp = None - self.last_billing_timestamp = None - self.service_endpoint = None - self.resource_provider_object_id = None - self.principal_id = None - self.tenant_id = None - self.type_identity_type = type_identity_type - self.user_assigned_identities = user_assigned_identities - - -class ClusterDesiredProperties(_serialization.Model): - """Desired properties of the cluster. - - :ivar windows_server_subscription: Desired state of Windows Server Subscription. Known values - are: "Disabled" and "Enabled". - :vartype windows_server_subscription: str or - ~azure.mgmt.azurestackhci.models.WindowsServerSubscription - :ivar diagnostic_level: Desired level of diagnostic data emitted by the cluster. Known values - are: "Off", "Basic", and "Enhanced". - :vartype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel - """ - - _attribute_map = { - "windows_server_subscription": {"key": "windowsServerSubscription", "type": "str"}, - "diagnostic_level": {"key": "diagnosticLevel", "type": "str"}, - } - - def __init__( - self, - *, - windows_server_subscription: Optional[Union[str, "_models.WindowsServerSubscription"]] = None, - diagnostic_level: Optional[Union[str, "_models.DiagnosticLevel"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword windows_server_subscription: Desired state of Windows Server Subscription. Known - values are: "Disabled" and "Enabled". - :paramtype windows_server_subscription: str or - ~azure.mgmt.azurestackhci.models.WindowsServerSubscription - :keyword diagnostic_level: Desired level of diagnostic data emitted by the cluster. Known - values are: "Off", "Basic", and "Enhanced". - :paramtype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel - """ - super().__init__(**kwargs) - self.windows_server_subscription = windows_server_subscription - self.diagnostic_level = diagnostic_level - - -class ClusterIdentityResponse(_serialization.Model): - """Cluster Identity details. - - :ivar aad_client_id: - :vartype aad_client_id: str - :ivar aad_tenant_id: - :vartype aad_tenant_id: str - :ivar aad_service_principal_object_id: - :vartype aad_service_principal_object_id: str - :ivar aad_application_object_id: - :vartype aad_application_object_id: str - """ - - _attribute_map = { - "aad_client_id": {"key": "properties.aadClientId", "type": "str"}, - "aad_tenant_id": {"key": "properties.aadTenantId", "type": "str"}, - "aad_service_principal_object_id": {"key": "properties.aadServicePrincipalObjectId", "type": "str"}, - "aad_application_object_id": {"key": "properties.aadApplicationObjectId", "type": "str"}, - } - - def __init__( - self, - *, - aad_client_id: Optional[str] = None, - aad_tenant_id: Optional[str] = None, - aad_service_principal_object_id: Optional[str] = None, - aad_application_object_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword aad_client_id: - :paramtype aad_client_id: str - :keyword aad_tenant_id: - :paramtype aad_tenant_id: str - :keyword aad_service_principal_object_id: - :paramtype aad_service_principal_object_id: str - :keyword aad_application_object_id: - :paramtype aad_application_object_id: str - """ - super().__init__(**kwargs) - self.aad_client_id = aad_client_id - self.aad_tenant_id = aad_tenant_id - self.aad_service_principal_object_id = aad_service_principal_object_id - self.aad_application_object_id = aad_application_object_id - - -class ClusterList(_serialization.Model): - """List of clusters. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of clusters. - :vartype value: list[~azure.mgmt.azurestackhci.models.Cluster] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Cluster]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.Cluster"]] = None, **kwargs: Any) -> None: - """ - :keyword value: List of clusters. - :paramtype value: list[~azure.mgmt.azurestackhci.models.Cluster] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ClusterNode(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Cluster node details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the cluster node. - :vartype name: str - :ivar id: Id of the node in the cluster. - :vartype id: float - :ivar windows_server_subscription: State of Windows Server Subscription. Known values are: - "Disabled" and "Enabled". - :vartype windows_server_subscription: str or - ~azure.mgmt.azurestackhci.models.WindowsServerSubscription - :ivar node_type: Type of the cluster node hardware. Known values are: "FirstParty" and - "ThirdParty". - :vartype node_type: str or ~azure.mgmt.azurestackhci.models.ClusterNodeType - :ivar ehc_resource_id: Edge Hardware Center Resource Id. - :vartype ehc_resource_id: str - :ivar manufacturer: Manufacturer of the cluster node hardware. - :vartype manufacturer: str - :ivar model: Model name of the cluster node hardware. - :vartype model: str - :ivar os_name: Operating system running on the cluster node. - :vartype os_name: str - :ivar os_version: Version of the operating system running on the cluster node. - :vartype os_version: str - :ivar os_display_version: Display version of the operating system running on the cluster node. - :vartype os_display_version: str - :ivar serial_number: Immutable id of the cluster node. - :vartype serial_number: str - :ivar core_count: Number of physical cores on the cluster node. - :vartype core_count: float - :ivar memory_in_gi_b: Total available memory on the cluster node (in GiB). - :vartype memory_in_gi_b: float - :ivar last_licensing_timestamp: Most recent licensing timestamp. - :vartype last_licensing_timestamp: ~datetime.datetime - :ivar oem_activation: OEM activation status of the node. Known values are: "Disabled" and - "Enabled". - :vartype oem_activation: str or ~azure.mgmt.azurestackhci.models.OemActivation - """ - - _validation = { - "name": {"readonly": True}, - "id": {"readonly": True}, - "windows_server_subscription": {"readonly": True}, - "node_type": {"readonly": True}, - "ehc_resource_id": {"readonly": True}, - "manufacturer": {"readonly": True}, - "model": {"readonly": True}, - "os_name": {"readonly": True}, - "os_version": {"readonly": True}, - "os_display_version": {"readonly": True}, - "serial_number": {"readonly": True}, - "core_count": {"readonly": True}, - "memory_in_gi_b": {"readonly": True}, - "last_licensing_timestamp": {"readonly": True}, - "oem_activation": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "id": {"key": "id", "type": "float"}, - "windows_server_subscription": {"key": "windowsServerSubscription", "type": "str"}, - "node_type": {"key": "nodeType", "type": "str"}, - "ehc_resource_id": {"key": "ehcResourceId", "type": "str"}, - "manufacturer": {"key": "manufacturer", "type": "str"}, - "model": {"key": "model", "type": "str"}, - "os_name": {"key": "osName", "type": "str"}, - "os_version": {"key": "osVersion", "type": "str"}, - "os_display_version": {"key": "osDisplayVersion", "type": "str"}, - "serial_number": {"key": "serialNumber", "type": "str"}, - "core_count": {"key": "coreCount", "type": "float"}, - "memory_in_gi_b": {"key": "memoryInGiB", "type": "float"}, - "last_licensing_timestamp": {"key": "lastLicensingTimestamp", "type": "iso-8601"}, - "oem_activation": {"key": "oemActivation", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.id = None - self.windows_server_subscription = None - self.node_type = None - self.ehc_resource_id = None - self.manufacturer = None - self.model = None - self.os_name = None - self.os_version = None - self.os_display_version = None - self.serial_number = None - self.core_count = None - self.memory_in_gi_b = None - self.last_licensing_timestamp = None - self.oem_activation = None - - -class ClusterPatch(_serialization.Model): - """Cluster details to update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar cloud_management_endpoint: Endpoint configured for management from the Azure portal. - :vartype cloud_management_endpoint: str - :ivar aad_client_id: App id of cluster AAD identity. - :vartype aad_client_id: str - :ivar aad_tenant_id: Tenant id of cluster AAD identity. - :vartype aad_tenant_id: str - :ivar desired_properties: Desired properties of the cluster. - :vartype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Type of managed service identity (where both SystemAssigned and UserAssigned types - are allowed). Known values are: "None", "SystemAssigned", "UserAssigned", and "SystemAssigned, - UserAssigned". - :vartype type: str or ~azure.mgmt.azurestackhci.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.azurestackhci.models.UserAssignedIdentity] - """ - - _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "cloud_management_endpoint": {"key": "properties.cloudManagementEndpoint", "type": "str"}, - "aad_client_id": {"key": "properties.aadClientId", "type": "str"}, - "aad_tenant_id": {"key": "properties.aadTenantId", "type": "str"}, - "desired_properties": {"key": "properties.desiredProperties", "type": "ClusterDesiredProperties"}, - "principal_id": {"key": "identity.principalId", "type": "str"}, - "tenant_id": {"key": "identity.tenantId", "type": "str"}, - "type": {"key": "identity.type", "type": "str"}, - "user_assigned_identities": {"key": "identity.userAssignedIdentities", "type": "{UserAssignedIdentity}"}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - cloud_management_endpoint: Optional[str] = None, - aad_client_id: Optional[str] = None, - aad_tenant_id: Optional[str] = None, - desired_properties: Optional["_models.ClusterDesiredProperties"] = None, - type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword cloud_management_endpoint: Endpoint configured for management from the Azure portal. - :paramtype cloud_management_endpoint: str - :keyword aad_client_id: App id of cluster AAD identity. - :paramtype aad_client_id: str - :keyword aad_tenant_id: Tenant id of cluster AAD identity. - :paramtype aad_tenant_id: str - :keyword desired_properties: Desired properties of the cluster. - :paramtype desired_properties: ~azure.mgmt.azurestackhci.models.ClusterDesiredProperties - :keyword type: Type of managed service identity (where both SystemAssigned and UserAssigned - types are allowed). Known values are: "None", "SystemAssigned", "UserAssigned", and - "SystemAssigned, UserAssigned". - :paramtype type: str or ~azure.mgmt.azurestackhci.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.azurestackhci.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.tags = tags - self.cloud_management_endpoint = cloud_management_endpoint - self.aad_client_id = aad_client_id - self.aad_tenant_id = aad_tenant_id - self.desired_properties = desired_properties - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class ClusterReportedProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Properties reported by cluster agent. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar cluster_name: Name of the on-prem cluster connected to this resource. - :vartype cluster_name: str - :ivar cluster_id: Unique id generated by the on-prem cluster. - :vartype cluster_id: str - :ivar cluster_version: Version of the cluster software. - :vartype cluster_version: str - :ivar nodes: List of nodes reported by the cluster. - :vartype nodes: list[~azure.mgmt.azurestackhci.models.ClusterNode] - :ivar last_updated: Last time the cluster reported the data. - :vartype last_updated: ~datetime.datetime - :ivar imds_attestation: IMDS attestation status of the cluster. Known values are: "Disabled" - and "Enabled". - :vartype imds_attestation: str or ~azure.mgmt.azurestackhci.models.ImdsAttestation - :ivar diagnostic_level: Level of diagnostic data emitted by the cluster. Known values are: - "Off", "Basic", and "Enhanced". - :vartype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel - :ivar supported_capabilities: Capabilities supported by the cluster. - :vartype supported_capabilities: list[str] - :ivar cluster_type: The node type of all the nodes of the cluster. Known values are: - "FirstParty" and "ThirdParty". - :vartype cluster_type: str or ~azure.mgmt.azurestackhci.models.ClusterNodeType - :ivar manufacturer: The manufacturer of all the nodes of the cluster. - :vartype manufacturer: str - :ivar oem_activation: OEM activation status of the cluster. Known values are: "Disabled" and - "Enabled". - :vartype oem_activation: str or ~azure.mgmt.azurestackhci.models.OemActivation - """ - - _validation = { - "cluster_name": {"readonly": True}, - "cluster_id": {"readonly": True}, - "cluster_version": {"readonly": True}, - "nodes": {"readonly": True}, - "last_updated": {"readonly": True}, - "imds_attestation": {"readonly": True}, - "supported_capabilities": {"readonly": True}, - "cluster_type": {"readonly": True}, - "manufacturer": {"readonly": True}, - "oem_activation": {"readonly": True}, - } - - _attribute_map = { - "cluster_name": {"key": "clusterName", "type": "str"}, - "cluster_id": {"key": "clusterId", "type": "str"}, - "cluster_version": {"key": "clusterVersion", "type": "str"}, - "nodes": {"key": "nodes", "type": "[ClusterNode]"}, - "last_updated": {"key": "lastUpdated", "type": "iso-8601"}, - "imds_attestation": {"key": "imdsAttestation", "type": "str"}, - "diagnostic_level": {"key": "diagnosticLevel", "type": "str"}, - "supported_capabilities": {"key": "supportedCapabilities", "type": "[str]"}, - "cluster_type": {"key": "clusterType", "type": "str"}, - "manufacturer": {"key": "manufacturer", "type": "str"}, - "oem_activation": {"key": "oemActivation", "type": "str"}, - } - - def __init__( - self, *, diagnostic_level: Optional[Union[str, "_models.DiagnosticLevel"]] = None, **kwargs: Any - ) -> None: - """ - :keyword diagnostic_level: Level of diagnostic data emitted by the cluster. Known values are: - "Off", "Basic", and "Enhanced". - :paramtype diagnostic_level: str or ~azure.mgmt.azurestackhci.models.DiagnosticLevel - """ - super().__init__(**kwargs) - self.cluster_name = None - self.cluster_id = None - self.cluster_version = None - self.nodes = None - self.last_updated = None - self.imds_attestation = None - self.diagnostic_level = diagnostic_level - self.supported_capabilities = None - self.cluster_type = None - self.manufacturer = None - self.oem_activation = None - - -class DefaultExtensionDetails(_serialization.Model): - """Properties for a particular default extension category. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar category: Default extension category. - :vartype category: str - :ivar consent_time: Consent time for extension category. - :vartype consent_time: ~datetime.datetime - """ - - _validation = { - "category": {"readonly": True}, - "consent_time": {"readonly": True}, - } - - _attribute_map = { - "category": {"key": "category", "type": "str"}, - "consent_time": {"key": "consentTime", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.category = None - self.consent_time = None - - -class DeploymentCluster(_serialization.Model): - """AzureStackHCI Cluster deployment properties. - - :ivar name: The cluster name provided when preparing Active Directory. - :vartype name: str - :ivar witness_type: Use a cloud witness if you have internet access and if you use an Azure - Storage account to provide a vote on cluster quorum. A cloud witness uses Azure Blob Storage to - read or write a blob file and then uses it to arbitrate in split-brain resolution. Only allowed - values are 'Cloud', 'FileShare'. - :vartype witness_type: str - :ivar witness_path: Specify the fileshare path for the local witness for your Azure Stack HCI - cluster. - :vartype witness_path: str - :ivar cloud_account_name: Specify the Azure Storage account name for cloud witness for your - Azure Stack HCI cluster. - :vartype cloud_account_name: str - :ivar azure_service_endpoint: For Azure blob service endpoint type, select either Default or - Custom domain. If you selected **Custom domain, enter the domain for the blob service in this - format core.windows.net. - :vartype azure_service_endpoint: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "witness_type": {"key": "witnessType", "type": "str"}, - "witness_path": {"key": "witnessPath", "type": "str"}, - "cloud_account_name": {"key": "cloudAccountName", "type": "str"}, - "azure_service_endpoint": {"key": "azureServiceEndpoint", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - witness_type: Optional[str] = None, - witness_path: Optional[str] = None, - cloud_account_name: Optional[str] = None, - azure_service_endpoint: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The cluster name provided when preparing Active Directory. - :paramtype name: str - :keyword witness_type: Use a cloud witness if you have internet access and if you use an Azure - Storage account to provide a vote on cluster quorum. A cloud witness uses Azure Blob Storage to - read or write a blob file and then uses it to arbitrate in split-brain resolution. Only allowed - values are 'Cloud', 'FileShare'. - :paramtype witness_type: str - :keyword witness_path: Specify the fileshare path for the local witness for your Azure Stack - HCI cluster. - :paramtype witness_path: str - :keyword cloud_account_name: Specify the Azure Storage account name for cloud witness for your - Azure Stack HCI cluster. - :paramtype cloud_account_name: str - :keyword azure_service_endpoint: For Azure blob service endpoint type, select either Default or - Custom domain. If you selected **Custom domain, enter the domain for the blob service in this - format core.windows.net. - :paramtype azure_service_endpoint: str - """ - super().__init__(**kwargs) - self.name = name - self.witness_type = witness_type - self.witness_path = witness_path - self.cloud_account_name = cloud_account_name - self.azure_service_endpoint = azure_service_endpoint - - -class DeploymentConfiguration(_serialization.Model): - """Deployment Configuration. - - All required parameters must be populated in order to send to server. - - :ivar version: deployment template version. - :vartype version: str - :ivar scale_units: Scale units will contains list of deployment data. Required. - :vartype scale_units: list[~azure.mgmt.azurestackhci.models.ScaleUnits] - """ - - _validation = { - "scale_units": {"required": True}, - } - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - "scale_units": {"key": "scaleUnits", "type": "[ScaleUnits]"}, - } - - def __init__( - self, *, scale_units: List["_models.ScaleUnits"], version: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword version: deployment template version. - :paramtype version: str - :keyword scale_units: Scale units will contains list of deployment data. Required. - :paramtype scale_units: list[~azure.mgmt.azurestackhci.models.ScaleUnits] - """ - super().__init__(**kwargs) - self.version = version - self.scale_units = scale_units - - -class DeploymentData(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The Deployment data of AzureStackHCI Cluster. - - :ivar security_settings: SecuritySettings to deploy AzureStackHCI Cluster. - :vartype security_settings: ~azure.mgmt.azurestackhci.models.DeploymentSecuritySettings - :ivar observability: Observability config to deploy AzureStackHCI Cluster. - :vartype observability: ~azure.mgmt.azurestackhci.models.Observability - :ivar cluster: Observability config to deploy AzureStackHCI Cluster. - :vartype cluster: ~azure.mgmt.azurestackhci.models.DeploymentCluster - :ivar storage: Storage config to deploy AzureStackHCI Cluster. - :vartype storage: ~azure.mgmt.azurestackhci.models.Storage - :ivar naming_prefix: naming prefix to deploy cluster. - :vartype naming_prefix: str - :ivar domain_fqdn: FQDN to deploy cluster. - :vartype domain_fqdn: str - :ivar infrastructure_network: InfrastructureNetwork config to deploy AzureStackHCI Cluster. - :vartype infrastructure_network: list[~azure.mgmt.azurestackhci.models.InfrastructureNetwork] - :ivar physical_nodes: list of physical nodes config to deploy AzureStackHCI Cluster. - :vartype physical_nodes: list[~azure.mgmt.azurestackhci.models.PhysicalNodes] - :ivar host_network: HostNetwork config to deploy AzureStackHCI Cluster. - :vartype host_network: ~azure.mgmt.azurestackhci.models.DeploymentSettingHostNetwork - :ivar sdn_integration: SDN Integration config to deploy AzureStackHCI Cluster. - :vartype sdn_integration: ~azure.mgmt.azurestackhci.models.SdnIntegration - :ivar adou_path: The path to the Active Directory Organizational Unit container object prepared - for the deployment. - :vartype adou_path: str - :ivar secrets_location: Azure keyvault endpoint. This property is deprecated from - 2023-12-01-preview. Please use secrets property instead. - :vartype secrets_location: str - :ivar secrets: secrets used for cloud deployment. - :vartype secrets: list[~azure.mgmt.azurestackhci.models.EceDeploymentSecrets] - :ivar optional_services: OptionalServices config to deploy AzureStackHCI Cluster. - :vartype optional_services: ~azure.mgmt.azurestackhci.models.OptionalServices - """ - - _validation = { - "naming_prefix": {"pattern": r"^[a-zA-Z0-9-]{1,8}$"}, - } - - _attribute_map = { - "security_settings": {"key": "securitySettings", "type": "DeploymentSecuritySettings"}, - "observability": {"key": "observability", "type": "Observability"}, - "cluster": {"key": "cluster", "type": "DeploymentCluster"}, - "storage": {"key": "storage", "type": "Storage"}, - "naming_prefix": {"key": "namingPrefix", "type": "str"}, - "domain_fqdn": {"key": "domainFqdn", "type": "str"}, - "infrastructure_network": {"key": "infrastructureNetwork", "type": "[InfrastructureNetwork]"}, - "physical_nodes": {"key": "physicalNodes", "type": "[PhysicalNodes]"}, - "host_network": {"key": "hostNetwork", "type": "DeploymentSettingHostNetwork"}, - "sdn_integration": {"key": "sdnIntegration", "type": "SdnIntegration"}, - "adou_path": {"key": "adouPath", "type": "str"}, - "secrets_location": {"key": "secretsLocation", "type": "str"}, - "secrets": {"key": "secrets", "type": "[EceDeploymentSecrets]"}, - "optional_services": {"key": "optionalServices", "type": "OptionalServices"}, - } - - def __init__( - self, - *, - security_settings: Optional["_models.DeploymentSecuritySettings"] = None, - observability: Optional["_models.Observability"] = None, - cluster: Optional["_models.DeploymentCluster"] = None, - storage: Optional["_models.Storage"] = None, - naming_prefix: Optional[str] = None, - domain_fqdn: Optional[str] = None, - infrastructure_network: Optional[List["_models.InfrastructureNetwork"]] = None, - physical_nodes: Optional[List["_models.PhysicalNodes"]] = None, - host_network: Optional["_models.DeploymentSettingHostNetwork"] = None, - sdn_integration: Optional["_models.SdnIntegration"] = None, - adou_path: Optional[str] = None, - secrets_location: Optional[str] = None, - secrets: Optional[List["_models.EceDeploymentSecrets"]] = None, - optional_services: Optional["_models.OptionalServices"] = None, - **kwargs: Any - ) -> None: - """ - :keyword security_settings: SecuritySettings to deploy AzureStackHCI Cluster. - :paramtype security_settings: ~azure.mgmt.azurestackhci.models.DeploymentSecuritySettings - :keyword observability: Observability config to deploy AzureStackHCI Cluster. - :paramtype observability: ~azure.mgmt.azurestackhci.models.Observability - :keyword cluster: Observability config to deploy AzureStackHCI Cluster. - :paramtype cluster: ~azure.mgmt.azurestackhci.models.DeploymentCluster - :keyword storage: Storage config to deploy AzureStackHCI Cluster. - :paramtype storage: ~azure.mgmt.azurestackhci.models.Storage - :keyword naming_prefix: naming prefix to deploy cluster. - :paramtype naming_prefix: str - :keyword domain_fqdn: FQDN to deploy cluster. - :paramtype domain_fqdn: str - :keyword infrastructure_network: InfrastructureNetwork config to deploy AzureStackHCI Cluster. - :paramtype infrastructure_network: list[~azure.mgmt.azurestackhci.models.InfrastructureNetwork] - :keyword physical_nodes: list of physical nodes config to deploy AzureStackHCI Cluster. - :paramtype physical_nodes: list[~azure.mgmt.azurestackhci.models.PhysicalNodes] - :keyword host_network: HostNetwork config to deploy AzureStackHCI Cluster. - :paramtype host_network: ~azure.mgmt.azurestackhci.models.DeploymentSettingHostNetwork - :keyword sdn_integration: SDN Integration config to deploy AzureStackHCI Cluster. - :paramtype sdn_integration: ~azure.mgmt.azurestackhci.models.SdnIntegration - :keyword adou_path: The path to the Active Directory Organizational Unit container object - prepared for the deployment. - :paramtype adou_path: str - :keyword secrets_location: Azure keyvault endpoint. This property is deprecated from - 2023-12-01-preview. Please use secrets property instead. - :paramtype secrets_location: str - :keyword secrets: secrets used for cloud deployment. - :paramtype secrets: list[~azure.mgmt.azurestackhci.models.EceDeploymentSecrets] - :keyword optional_services: OptionalServices config to deploy AzureStackHCI Cluster. - :paramtype optional_services: ~azure.mgmt.azurestackhci.models.OptionalServices - """ - super().__init__(**kwargs) - self.security_settings = security_settings - self.observability = observability - self.cluster = cluster - self.storage = storage - self.naming_prefix = naming_prefix - self.domain_fqdn = domain_fqdn - self.infrastructure_network = infrastructure_network - self.physical_nodes = physical_nodes - self.host_network = host_network - self.sdn_integration = sdn_integration - self.adou_path = adou_path - self.secrets_location = secrets_location - self.secrets = secrets - self.optional_services = optional_services - - -class DeploymentSecuritySettings(_serialization.Model): - """The SecuritySettings of AzureStackHCI Cluster. - - :ivar hvci_protection: By default, Hypervisor-protected Code Integrity is enabled on your Azure - HCI cluster. - :vartype hvci_protection: bool - :ivar drtm_protection: By default, Secure Boot is enabled on your Azure HCI cluster. This - setting is hardware dependent. - :vartype drtm_protection: bool - :ivar drift_control_enforced: When set to true, the security baseline is re-applied regularly. - :vartype drift_control_enforced: bool - :ivar credential_guard_enforced: When set to true, Credential Guard is enabled. - :vartype credential_guard_enforced: bool - :ivar smb_signing_enforced: When set to true, the SMB default instance requires sign in for the - client and server services. - :vartype smb_signing_enforced: bool - :ivar smb_cluster_encryption: When set to true, cluster east-west traffic is encrypted. - :vartype smb_cluster_encryption: bool - :ivar side_channel_mitigation_enforced: When set to true, all the side channel mitigations are - enabled. - :vartype side_channel_mitigation_enforced: bool - :ivar bitlocker_boot_volume: When set to true, BitLocker XTS_AES 256-bit encryption is enabled - for all data-at-rest on the OS volume of your Azure Stack HCI cluster. This setting is - TPM-hardware dependent. - :vartype bitlocker_boot_volume: bool - :ivar bitlocker_data_volumes: When set to true, BitLocker XTS-AES 256-bit encryption is enabled - for all data-at-rest on your Azure Stack HCI cluster shared volumes. - :vartype bitlocker_data_volumes: bool - :ivar wdac_enforced: WDAC is enabled by default and limits the applications and the code that - you can run on your Azure Stack HCI cluster. - :vartype wdac_enforced: bool - """ - - _attribute_map = { - "hvci_protection": {"key": "hvciProtection", "type": "bool"}, - "drtm_protection": {"key": "drtmProtection", "type": "bool"}, - "drift_control_enforced": {"key": "driftControlEnforced", "type": "bool"}, - "credential_guard_enforced": {"key": "credentialGuardEnforced", "type": "bool"}, - "smb_signing_enforced": {"key": "smbSigningEnforced", "type": "bool"}, - "smb_cluster_encryption": {"key": "smbClusterEncryption", "type": "bool"}, - "side_channel_mitigation_enforced": {"key": "sideChannelMitigationEnforced", "type": "bool"}, - "bitlocker_boot_volume": {"key": "bitlockerBootVolume", "type": "bool"}, - "bitlocker_data_volumes": {"key": "bitlockerDataVolumes", "type": "bool"}, - "wdac_enforced": {"key": "wdacEnforced", "type": "bool"}, - } - - def __init__( - self, - *, - hvci_protection: bool = True, - drtm_protection: bool = True, - drift_control_enforced: bool = True, - credential_guard_enforced: bool = False, - smb_signing_enforced: bool = True, - smb_cluster_encryption: bool = False, - side_channel_mitigation_enforced: bool = True, - bitlocker_boot_volume: bool = True, - bitlocker_data_volumes: bool = True, - wdac_enforced: bool = True, - **kwargs: Any - ) -> None: - """ - :keyword hvci_protection: By default, Hypervisor-protected Code Integrity is enabled on your - Azure HCI cluster. - :paramtype hvci_protection: bool - :keyword drtm_protection: By default, Secure Boot is enabled on your Azure HCI cluster. This - setting is hardware dependent. - :paramtype drtm_protection: bool - :keyword drift_control_enforced: When set to true, the security baseline is re-applied - regularly. - :paramtype drift_control_enforced: bool - :keyword credential_guard_enforced: When set to true, Credential Guard is enabled. - :paramtype credential_guard_enforced: bool - :keyword smb_signing_enforced: When set to true, the SMB default instance requires sign in for - the client and server services. - :paramtype smb_signing_enforced: bool - :keyword smb_cluster_encryption: When set to true, cluster east-west traffic is encrypted. - :paramtype smb_cluster_encryption: bool - :keyword side_channel_mitigation_enforced: When set to true, all the side channel mitigations - are enabled. - :paramtype side_channel_mitigation_enforced: bool - :keyword bitlocker_boot_volume: When set to true, BitLocker XTS_AES 256-bit encryption is - enabled for all data-at-rest on the OS volume of your Azure Stack HCI cluster. This setting is - TPM-hardware dependent. - :paramtype bitlocker_boot_volume: bool - :keyword bitlocker_data_volumes: When set to true, BitLocker XTS-AES 256-bit encryption is - enabled for all data-at-rest on your Azure Stack HCI cluster shared volumes. - :paramtype bitlocker_data_volumes: bool - :keyword wdac_enforced: WDAC is enabled by default and limits the applications and the code - that you can run on your Azure Stack HCI cluster. - :paramtype wdac_enforced: bool - """ - super().__init__(**kwargs) - self.hvci_protection = hvci_protection - self.drtm_protection = drtm_protection - self.drift_control_enforced = drift_control_enforced - self.credential_guard_enforced = credential_guard_enforced - self.smb_signing_enforced = smb_signing_enforced - self.smb_cluster_encryption = smb_cluster_encryption - self.side_channel_mitigation_enforced = side_channel_mitigation_enforced - self.bitlocker_boot_volume = bitlocker_boot_volume - self.bitlocker_data_volumes = bitlocker_data_volumes - self.wdac_enforced = wdac_enforced - - -class DeploymentSetting(ProxyResource): - """Edge device resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar provisioning_state: DeploymentSetting provisioning state. Known values are: - "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar arc_node_resource_ids: Azure resource ids of Arc machines to be part of cluster. - :vartype arc_node_resource_ids: list[str] - :ivar deployment_mode: The deployment mode for cluster deployment. Known values are: "Validate" - and "Deploy". - :vartype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :ivar operation_type: The intended operation for a cluster. Known values are: - "ClusterProvisioning" and "ClusterUpgrade". - :vartype operation_type: str or ~azure.mgmt.azurestackhci.models.OperationType - :ivar deployment_configuration: Scale units will contains list of deployment data. - :vartype deployment_configuration: ~azure.mgmt.azurestackhci.models.DeploymentConfiguration - :ivar reported_properties: Deployment Status reported from cluster. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.EceReportedProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "reported_properties": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "arc_node_resource_ids": {"key": "properties.arcNodeResourceIds", "type": "[str]"}, - "deployment_mode": {"key": "properties.deploymentMode", "type": "str"}, - "operation_type": {"key": "properties.operationType", "type": "str"}, - "deployment_configuration": {"key": "properties.deploymentConfiguration", "type": "DeploymentConfiguration"}, - "reported_properties": {"key": "properties.reportedProperties", "type": "EceReportedProperties"}, - } - - def __init__( - self, - *, - arc_node_resource_ids: Optional[List[str]] = None, - deployment_mode: Union[str, "_models.DeploymentMode"] = "Deploy", - operation_type: Union[str, "_models.OperationType"] = "ClusterProvisioning", - deployment_configuration: Optional["_models.DeploymentConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword arc_node_resource_ids: Azure resource ids of Arc machines to be part of cluster. - :paramtype arc_node_resource_ids: list[str] - :keyword deployment_mode: The deployment mode for cluster deployment. Known values are: - "Validate" and "Deploy". - :paramtype deployment_mode: str or ~azure.mgmt.azurestackhci.models.DeploymentMode - :keyword operation_type: The intended operation for a cluster. Known values are: - "ClusterProvisioning" and "ClusterUpgrade". - :paramtype operation_type: str or ~azure.mgmt.azurestackhci.models.OperationType - :keyword deployment_configuration: Scale units will contains list of deployment data. - :paramtype deployment_configuration: ~azure.mgmt.azurestackhci.models.DeploymentConfiguration - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.arc_node_resource_ids = arc_node_resource_ids - self.deployment_mode = deployment_mode - self.operation_type = operation_type - self.deployment_configuration = deployment_configuration - self.reported_properties = None - - -class DeploymentSettingAdapterPropertyOverrides(_serialization.Model): # pylint: disable=name-too-long - """The AdapterPropertyOverrides of a cluster. - - :ivar jumbo_packet: This parameter should only be modified based on your OEM guidance. Do not - modify this parameter without OEM validation. - :vartype jumbo_packet: str - :ivar network_direct: This parameter should only be modified based on your OEM guidance. Do not - modify this parameter without OEM validation. - :vartype network_direct: str - :ivar network_direct_technology: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. Expected values are 'iWARP', - 'RoCEv2', 'RoCE'. - :vartype network_direct_technology: str - """ - - _attribute_map = { - "jumbo_packet": {"key": "jumboPacket", "type": "str"}, - "network_direct": {"key": "networkDirect", "type": "str"}, - "network_direct_technology": {"key": "networkDirectTechnology", "type": "str"}, - } - - def __init__( - self, - *, - jumbo_packet: Optional[str] = None, - network_direct: Optional[str] = None, - network_direct_technology: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword jumbo_packet: This parameter should only be modified based on your OEM guidance. Do - not modify this parameter without OEM validation. - :paramtype jumbo_packet: str - :keyword network_direct: This parameter should only be modified based on your OEM guidance. Do - not modify this parameter without OEM validation. - :paramtype network_direct: str - :keyword network_direct_technology: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. Expected values are 'iWARP', - 'RoCEv2', 'RoCE'. - :paramtype network_direct_technology: str - """ - super().__init__(**kwargs) - self.jumbo_packet = jumbo_packet - self.network_direct = network_direct - self.network_direct_technology = network_direct_technology - - -class DeploymentSettingHostNetwork(_serialization.Model): - """The HostNetwork of a cluster. - - :ivar intents: The network intents assigned to the network reference pattern used for the - deployment. Each intent will define its own name, traffic type, adapter names, and overrides as - recommended by your OEM. - :vartype intents: list[~azure.mgmt.azurestackhci.models.DeploymentSettingIntents] - :ivar storage_networks: List of StorageNetworks config to deploy AzureStackHCI Cluster. - :vartype storage_networks: - list[~azure.mgmt.azurestackhci.models.DeploymentSettingStorageNetworks] - :ivar storage_connectivity_switchless: Defines how the storage adapters between nodes are - connected either switch or switch less.. - :vartype storage_connectivity_switchless: bool - :ivar enable_storage_auto_ip: Optional parameter required only for 3 Nodes Switchless - deployments. This allows users to specify IPs and Mask for Storage NICs when Network ATC is not - assigning the IPs for storage automatically. - :vartype enable_storage_auto_ip: bool - """ - - _attribute_map = { - "intents": {"key": "intents", "type": "[DeploymentSettingIntents]"}, - "storage_networks": {"key": "storageNetworks", "type": "[DeploymentSettingStorageNetworks]"}, - "storage_connectivity_switchless": {"key": "storageConnectivitySwitchless", "type": "bool"}, - "enable_storage_auto_ip": {"key": "enableStorageAutoIp", "type": "bool"}, - } - - def __init__( - self, - *, - intents: Optional[List["_models.DeploymentSettingIntents"]] = None, - storage_networks: Optional[List["_models.DeploymentSettingStorageNetworks"]] = None, - storage_connectivity_switchless: bool = False, - enable_storage_auto_ip: bool = False, - **kwargs: Any - ) -> None: - """ - :keyword intents: The network intents assigned to the network reference pattern used for the - deployment. Each intent will define its own name, traffic type, adapter names, and overrides as - recommended by your OEM. - :paramtype intents: list[~azure.mgmt.azurestackhci.models.DeploymentSettingIntents] - :keyword storage_networks: List of StorageNetworks config to deploy AzureStackHCI Cluster. - :paramtype storage_networks: - list[~azure.mgmt.azurestackhci.models.DeploymentSettingStorageNetworks] - :keyword storage_connectivity_switchless: Defines how the storage adapters between nodes are - connected either switch or switch less.. - :paramtype storage_connectivity_switchless: bool - :keyword enable_storage_auto_ip: Optional parameter required only for 3 Nodes Switchless - deployments. This allows users to specify IPs and Mask for Storage NICs when Network ATC is not - assigning the IPs for storage automatically. - :paramtype enable_storage_auto_ip: bool - """ - super().__init__(**kwargs) - self.intents = intents - self.storage_networks = storage_networks - self.storage_connectivity_switchless = storage_connectivity_switchless - self.enable_storage_auto_ip = enable_storage_auto_ip - - -class DeploymentSettingIntents(_serialization.Model): - """The Intents of a cluster. - - :ivar name: Name of the network intent you wish to create. - :vartype name: str - :ivar traffic_type: List of network traffic types. Only allowed values are 'Compute', - 'Storage', 'Management'. - :vartype traffic_type: list[str] - :ivar adapter: Array of network interfaces used for the network intent. - :vartype adapter: list[str] - :ivar override_virtual_switch_configuration: This parameter should only be modified based on - your OEM guidance. Do not modify this parameter without OEM validation. - :vartype override_virtual_switch_configuration: bool - :ivar virtual_switch_configuration_overrides: Set virtualSwitch ConfigurationOverrides for - cluster. - :vartype virtual_switch_configuration_overrides: - ~azure.mgmt.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides - :ivar override_qos_policy: This parameter should only be modified based on your OEM guidance. - Do not modify this parameter without OEM validation. - :vartype override_qos_policy: bool - :ivar qos_policy_overrides: Set QoS PolicyOverrides for cluster. - :vartype qos_policy_overrides: ~azure.mgmt.azurestackhci.models.QosPolicyOverrides - :ivar override_adapter_property: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. - :vartype override_adapter_property: bool - :ivar adapter_property_overrides: Set Adapter PropertyOverrides for cluster. - :vartype adapter_property_overrides: - ~azure.mgmt.azurestackhci.models.DeploymentSettingAdapterPropertyOverrides - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "traffic_type": {"key": "trafficType", "type": "[str]"}, - "adapter": {"key": "adapter", "type": "[str]"}, - "override_virtual_switch_configuration": {"key": "overrideVirtualSwitchConfiguration", "type": "bool"}, - "virtual_switch_configuration_overrides": { - "key": "virtualSwitchConfigurationOverrides", - "type": "DeploymentSettingVirtualSwitchConfigurationOverrides", - }, - "override_qos_policy": {"key": "overrideQosPolicy", "type": "bool"}, - "qos_policy_overrides": {"key": "qosPolicyOverrides", "type": "QosPolicyOverrides"}, - "override_adapter_property": {"key": "overrideAdapterProperty", "type": "bool"}, - "adapter_property_overrides": { - "key": "adapterPropertyOverrides", - "type": "DeploymentSettingAdapterPropertyOverrides", - }, - } - - def __init__( - self, - *, - name: Optional[str] = None, - traffic_type: Optional[List[str]] = None, - adapter: Optional[List[str]] = None, - override_virtual_switch_configuration: bool = False, - virtual_switch_configuration_overrides: Optional[ - "_models.DeploymentSettingVirtualSwitchConfigurationOverrides" - ] = None, - override_qos_policy: bool = False, - qos_policy_overrides: Optional["_models.QosPolicyOverrides"] = None, - override_adapter_property: bool = False, - adapter_property_overrides: Optional["_models.DeploymentSettingAdapterPropertyOverrides"] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the network intent you wish to create. - :paramtype name: str - :keyword traffic_type: List of network traffic types. Only allowed values are 'Compute', - 'Storage', 'Management'. - :paramtype traffic_type: list[str] - :keyword adapter: Array of network interfaces used for the network intent. - :paramtype adapter: list[str] - :keyword override_virtual_switch_configuration: This parameter should only be modified based on - your OEM guidance. Do not modify this parameter without OEM validation. - :paramtype override_virtual_switch_configuration: bool - :keyword virtual_switch_configuration_overrides: Set virtualSwitch ConfigurationOverrides for - cluster. - :paramtype virtual_switch_configuration_overrides: - ~azure.mgmt.azurestackhci.models.DeploymentSettingVirtualSwitchConfigurationOverrides - :keyword override_qos_policy: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. - :paramtype override_qos_policy: bool - :keyword qos_policy_overrides: Set QoS PolicyOverrides for cluster. - :paramtype qos_policy_overrides: ~azure.mgmt.azurestackhci.models.QosPolicyOverrides - :keyword override_adapter_property: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. - :paramtype override_adapter_property: bool - :keyword adapter_property_overrides: Set Adapter PropertyOverrides for cluster. - :paramtype adapter_property_overrides: - ~azure.mgmt.azurestackhci.models.DeploymentSettingAdapterPropertyOverrides - """ - super().__init__(**kwargs) - self.name = name - self.traffic_type = traffic_type - self.adapter = adapter - self.override_virtual_switch_configuration = override_virtual_switch_configuration - self.virtual_switch_configuration_overrides = virtual_switch_configuration_overrides - self.override_qos_policy = override_qos_policy - self.qos_policy_overrides = qos_policy_overrides - self.override_adapter_property = override_adapter_property - self.adapter_property_overrides = adapter_property_overrides - - -class DeploymentSettingListResult(_serialization.Model): - """The response of a DeploymentSetting list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The DeploymentSetting items on this page. Required. - :vartype value: list[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DeploymentSetting]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.DeploymentSetting"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The DeploymentSetting items on this page. Required. - :paramtype value: list[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class DeploymentSettingStorageAdapterIPInfo(_serialization.Model): - """The StorageAdapter physical nodes of a cluster. - - :ivar physical_node: storage adapter physical node name. - :vartype physical_node: str - :ivar ipv4_address: The IPv4 address assigned to each storage adapter physical node on your - Azure Stack HCI cluster. - :vartype ipv4_address: str - :ivar subnet_mask: The SubnetMask address assigned to each storage adapter physical node on - your Azure Stack HCI cluster. - :vartype subnet_mask: str - """ - - _attribute_map = { - "physical_node": {"key": "physicalNode", "type": "str"}, - "ipv4_address": {"key": "ipv4Address", "type": "str"}, - "subnet_mask": {"key": "subnetMask", "type": "str"}, - } - - def __init__( - self, - *, - physical_node: Optional[str] = None, - ipv4_address: Optional[str] = None, - subnet_mask: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword physical_node: storage adapter physical node name. - :paramtype physical_node: str - :keyword ipv4_address: The IPv4 address assigned to each storage adapter physical node on your - Azure Stack HCI cluster. - :paramtype ipv4_address: str - :keyword subnet_mask: The SubnetMask address assigned to each storage adapter physical node on - your Azure Stack HCI cluster. - :paramtype subnet_mask: str - """ - super().__init__(**kwargs) - self.physical_node = physical_node - self.ipv4_address = ipv4_address - self.subnet_mask = subnet_mask - - -class DeploymentSettingStorageNetworks(_serialization.Model): - """The StorageNetworks of a cluster. - - :ivar name: Name of the storage network. - :vartype name: str - :ivar network_adapter_name: Name of the storage network adapter. - :vartype network_adapter_name: str - :ivar vlan_id: ID specified for the VLAN storage network. This setting is applied to the - network interfaces that route the storage and VM migration traffic. - :vartype vlan_id: str - :ivar storage_adapter_ip_info: List of Storage adapter physical nodes config to deploy - AzureStackHCI Cluster. - :vartype storage_adapter_ip_info: - list[~azure.mgmt.azurestackhci.models.DeploymentSettingStorageAdapterIPInfo] - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "network_adapter_name": {"key": "networkAdapterName", "type": "str"}, - "vlan_id": {"key": "vlanId", "type": "str"}, - "storage_adapter_ip_info": {"key": "storageAdapterIPInfo", "type": "[DeploymentSettingStorageAdapterIPInfo]"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - network_adapter_name: Optional[str] = None, - vlan_id: Optional[str] = None, - storage_adapter_ip_info: Optional[List["_models.DeploymentSettingStorageAdapterIPInfo"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the storage network. - :paramtype name: str - :keyword network_adapter_name: Name of the storage network adapter. - :paramtype network_adapter_name: str - :keyword vlan_id: ID specified for the VLAN storage network. This setting is applied to the - network interfaces that route the storage and VM migration traffic. - :paramtype vlan_id: str - :keyword storage_adapter_ip_info: List of Storage adapter physical nodes config to deploy - AzureStackHCI Cluster. - :paramtype storage_adapter_ip_info: - list[~azure.mgmt.azurestackhci.models.DeploymentSettingStorageAdapterIPInfo] - """ - super().__init__(**kwargs) - self.name = name - self.network_adapter_name = network_adapter_name - self.vlan_id = vlan_id - self.storage_adapter_ip_info = storage_adapter_ip_info - - -class DeploymentSettingVirtualSwitchConfigurationOverrides(_serialization.Model): # pylint: disable=name-too-long - """The VirtualSwitchConfigurationOverrides of a cluster. - - :ivar enable_iov: Enable IoV for Virtual Switch. - :vartype enable_iov: str - :ivar load_balancing_algorithm: Load Balancing Algorithm for Virtual Switch. - :vartype load_balancing_algorithm: str - """ - - _attribute_map = { - "enable_iov": {"key": "enableIov", "type": "str"}, - "load_balancing_algorithm": {"key": "loadBalancingAlgorithm", "type": "str"}, - } - - def __init__( - self, *, enable_iov: Optional[str] = None, load_balancing_algorithm: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword enable_iov: Enable IoV for Virtual Switch. - :paramtype enable_iov: str - :keyword load_balancing_algorithm: Load Balancing Algorithm for Virtual Switch. - :paramtype load_balancing_algorithm: str - """ - super().__init__(**kwargs) - self.enable_iov = enable_iov - self.load_balancing_algorithm = load_balancing_algorithm - - -class DeploymentStep(_serialization.Model): - """The Step of AzureStackHCI Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of step. - :vartype name: str - :ivar description: Description of step. - :vartype description: str - :ivar full_step_index: FullStepIndex of step. - :vartype full_step_index: str - :ivar start_time_utc: Start time of step. - :vartype start_time_utc: str - :ivar end_time_utc: End time of step. - :vartype end_time_utc: str - :ivar status: Status of step. Allowed values are 'Error', 'Success', 'InProgress'. - :vartype status: str - :ivar steps: List of nested steps of AzureStackHCI Cluster Deployment. - :vartype steps: list[~azure.mgmt.azurestackhci.models.DeploymentStep] - :ivar exception: List of exceptions in AzureStackHCI Cluster Deployment. - :vartype exception: list[str] - """ - - _validation = { - "name": {"readonly": True}, - "description": {"readonly": True}, - "full_step_index": {"readonly": True}, - "start_time_utc": {"readonly": True}, - "end_time_utc": {"readonly": True}, - "status": {"readonly": True}, - "steps": {"readonly": True}, - "exception": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "full_step_index": {"key": "fullStepIndex", "type": "str"}, - "start_time_utc": {"key": "startTimeUtc", "type": "str"}, - "end_time_utc": {"key": "endTimeUtc", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "steps": {"key": "steps", "type": "[DeploymentStep]"}, - "exception": {"key": "exception", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.description = None - self.full_step_index = None - self.start_time_utc = None - self.end_time_utc = None - self.status = None - self.steps = None - self.exception = None - - -class DeviceConfiguration(_serialization.Model): - """The device Configuration for edge device. - - :ivar nic_details: NIC Details of device. - :vartype nic_details: list[~azure.mgmt.azurestackhci.models.NicDetail] - :ivar device_metadata: Device metadata details. - :vartype device_metadata: str - """ - - _attribute_map = { - "nic_details": {"key": "nicDetails", "type": "[NicDetail]"}, - "device_metadata": {"key": "deviceMetadata", "type": "str"}, - } - - def __init__( - self, - *, - nic_details: Optional[List["_models.NicDetail"]] = None, - device_metadata: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword nic_details: NIC Details of device. - :paramtype nic_details: list[~azure.mgmt.azurestackhci.models.NicDetail] - :keyword device_metadata: Device metadata details. - :paramtype device_metadata: str - """ - super().__init__(**kwargs) - self.nic_details = nic_details - self.device_metadata = device_metadata - - -class EceActionStatus(_serialization.Model): - """The ECE action plan deployment status for AzureStackHCI Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: Status of ECE action AzureStackHCI Cluster Deployment. - :vartype status: str - :ivar steps: List of steps of AzureStackHCI Cluster Deployment. - :vartype steps: list[~azure.mgmt.azurestackhci.models.DeploymentStep] - """ - - _validation = { - "status": {"readonly": True}, - "steps": {"readonly": True}, - } - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "steps": {"key": "steps", "type": "[DeploymentStep]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.status = None - self.steps = None - - -class EceDeploymentSecrets(_serialization.Model): - """Protected parameters list stored in keyvault. - - :ivar secret_name: Secret name stored in keyvault. - :vartype secret_name: str - :ivar ece_secret_name: Secret name expected for Enterprise Cloud Engine (ECE) deployment. Known - values are: "AzureStackLCMUserCredential", "DefaultARBApplication", "LocalAdminCredential", and - "WitnessStorageKey". - :vartype ece_secret_name: str or ~azure.mgmt.azurestackhci.models.EceSecrets - :ivar secret_location: Secret URI stored in keyvault. - :vartype secret_location: str - """ - - _attribute_map = { - "secret_name": {"key": "secretName", "type": "str"}, - "ece_secret_name": {"key": "eceSecretName", "type": "str"}, - "secret_location": {"key": "secretLocation", "type": "str"}, - } - - def __init__( - self, - *, - secret_name: Optional[str] = None, - ece_secret_name: Optional[Union[str, "_models.EceSecrets"]] = None, - secret_location: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword secret_name: Secret name stored in keyvault. - :paramtype secret_name: str - :keyword ece_secret_name: Secret name expected for Enterprise Cloud Engine (ECE) deployment. - Known values are: "AzureStackLCMUserCredential", "DefaultARBApplication", - "LocalAdminCredential", and "WitnessStorageKey". - :paramtype ece_secret_name: str or ~azure.mgmt.azurestackhci.models.EceSecrets - :keyword secret_location: Secret URI stored in keyvault. - :paramtype secret_location: str - """ - super().__init__(**kwargs) - self.secret_name = secret_name - self.ece_secret_name = ece_secret_name - self.secret_location = secret_location - - -class EceReportedProperties(_serialization.Model): - """The DeploymentStatus of AzureStackHCI Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar validation_status: validation status of AzureStackHCI Cluster Deployment. - :vartype validation_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - :ivar deployment_status: Deployment status of AzureStackHCI Cluster Deployment. - :vartype deployment_status: ~azure.mgmt.azurestackhci.models.EceActionStatus - """ - - _validation = { - "validation_status": {"readonly": True}, - "deployment_status": {"readonly": True}, - } - - _attribute_map = { - "validation_status": {"key": "validationStatus", "type": "EceActionStatus"}, - "deployment_status": {"key": "deploymentStatus", "type": "EceActionStatus"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.validation_status = None - self.deployment_status = None - - -class EdgeDevice(ProxyResource): - """Edge device resource. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - HciEdgeDevice - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar kind: Device kind to support polymorphic resource. "HCI" - :vartype kind: str or ~azure.mgmt.azurestackhci.models.DeviceKind - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "kind": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "kind": {"key": "kind", "type": "str"}, - } - - _subtype_map = {"kind": {"HCI": "HciEdgeDevice"}} - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - - -class EdgeDeviceListResult(_serialization.Model): - """The response of a EdgeDevice list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The EdgeDevice items on this page. Required. - :vartype value: list[~azure.mgmt.azurestackhci.models.EdgeDevice] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[EdgeDevice]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.EdgeDevice"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The EdgeDevice items on this page. Required. - :paramtype value: list[~azure.mgmt.azurestackhci.models.EdgeDevice] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class EdgeDeviceProperties(_serialization.Model): - """Edge Device properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_configuration: Device Configuration. - :vartype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration - :ivar provisioning_state: Provisioning state of edgeDevice resource. Known values are: - "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - """ - - _validation = { - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "device_configuration": {"key": "deviceConfiguration", "type": "DeviceConfiguration"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__(self, *, device_configuration: Optional["_models.DeviceConfiguration"] = None, **kwargs: Any) -> None: - """ - :keyword device_configuration: Device Configuration. - :paramtype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration - """ - super().__init__(**kwargs) - self.device_configuration = device_configuration - self.provisioning_state = None - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.azurestackhci.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.azurestackhci.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.azurestackhci.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.azurestackhci.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class Extension(ProxyResource): # pylint: disable=too-many-instance-attributes - """Details of a particular extension in HCI Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar provisioning_state: Provisioning state of the Extension proxy resource. Known values are: - "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar aggregate_state: Aggregate state of Arc Extensions across the nodes in this HCI cluster. - Known values are: "NotSpecified", "Error", "Succeeded", "Canceled", "Failed", "Connected", - "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and - "UpgradeFailedRollbackSucceeded". - :vartype aggregate_state: str or ~azure.mgmt.azurestackhci.models.ExtensionAggregateState - :ivar per_node_extension_details: State of Arc Extension in each of the nodes. - :vartype per_node_extension_details: - list[~azure.mgmt.azurestackhci.models.PerNodeExtensionState] - :ivar managed_by: Indicates if the extension is managed by azure or the user. Known values are: - "User" and "Azure". - :vartype managed_by: str or ~azure.mgmt.azurestackhci.models.ExtensionManagedBy - :ivar force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :vartype force_update_tag: str - :ivar publisher: The name of the extension handler publisher. - :vartype publisher: str - :ivar type_properties_extension_parameters_type: Specifies the type of the extension; an - example is "CustomScriptExtension". - :vartype type_properties_extension_parameters_type: str - :ivar type_handler_version: Specifies the version of the script handler. Latest version would - be used if not specified. - :vartype type_handler_version: str - :ivar auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :vartype auto_upgrade_minor_version: bool - :ivar settings: Json formatted public settings for the extension. - :vartype settings: JSON - :ivar protected_settings: Protected settings (may contain secrets). - :vartype protected_settings: JSON - :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :vartype enable_automatic_upgrade: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "aggregate_state": {"readonly": True}, - "per_node_extension_details": {"readonly": True}, - "managed_by": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "aggregate_state": {"key": "properties.aggregateState", "type": "str"}, - "per_node_extension_details": {"key": "properties.perNodeExtensionDetails", "type": "[PerNodeExtensionState]"}, - "managed_by": {"key": "properties.managedBy", "type": "str"}, - "force_update_tag": {"key": "properties.extensionParameters.forceUpdateTag", "type": "str"}, - "publisher": {"key": "properties.extensionParameters.publisher", "type": "str"}, - "type_properties_extension_parameters_type": {"key": "properties.extensionParameters.type", "type": "str"}, - "type_handler_version": {"key": "properties.extensionParameters.typeHandlerVersion", "type": "str"}, - "auto_upgrade_minor_version": {"key": "properties.extensionParameters.autoUpgradeMinorVersion", "type": "bool"}, - "settings": {"key": "properties.extensionParameters.settings", "type": "object"}, - "protected_settings": {"key": "properties.extensionParameters.protectedSettings", "type": "object"}, - "enable_automatic_upgrade": {"key": "properties.extensionParameters.enableAutomaticUpgrade", "type": "bool"}, - } - - def __init__( - self, - *, - force_update_tag: Optional[str] = None, - publisher: Optional[str] = None, - type_properties_extension_parameters_type: Optional[str] = None, - type_handler_version: Optional[str] = None, - auto_upgrade_minor_version: Optional[bool] = None, - settings: Optional[JSON] = None, - protected_settings: Optional[JSON] = None, - enable_automatic_upgrade: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword force_update_tag: How the extension handler should be forced to update even if the - extension configuration has not changed. - :paramtype force_update_tag: str - :keyword publisher: The name of the extension handler publisher. - :paramtype publisher: str - :keyword type_properties_extension_parameters_type: Specifies the type of the extension; an - example is "CustomScriptExtension". - :paramtype type_properties_extension_parameters_type: str - :keyword type_handler_version: Specifies the version of the script handler. Latest version - would be used if not specified. - :paramtype type_handler_version: str - :keyword auto_upgrade_minor_version: Indicates whether the extension should use a newer minor - version if one is available at deployment time. Once deployed, however, the extension will not - upgrade minor versions unless redeployed, even with this property set to true. - :paramtype auto_upgrade_minor_version: bool - :keyword settings: Json formatted public settings for the extension. - :paramtype settings: JSON - :keyword protected_settings: Protected settings (may contain secrets). - :paramtype protected_settings: JSON - :keyword enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :paramtype enable_automatic_upgrade: bool - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.aggregate_state = None - self.per_node_extension_details = None - self.managed_by = None - self.force_update_tag = force_update_tag - self.publisher = publisher - self.type_properties_extension_parameters_type = type_properties_extension_parameters_type - self.type_handler_version = type_handler_version - self.auto_upgrade_minor_version = auto_upgrade_minor_version - self.settings = settings - self.protected_settings = protected_settings - self.enable_automatic_upgrade = enable_automatic_upgrade - - -class ExtensionInstanceView(_serialization.Model): - """Describes the Extension Instance View. - - :ivar name: The extension name. - :vartype name: str - :ivar type: Specifies the type of the extension; an example is "MicrosoftMonitoringAgent". - :vartype type: str - :ivar type_handler_version: Specifies the version of the script handler. - :vartype type_handler_version: str - :ivar status: Instance view status. - :vartype status: ~azure.mgmt.azurestackhci.models.ExtensionInstanceViewStatus - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "type_handler_version": {"key": "typeHandlerVersion", "type": "str"}, - "status": {"key": "status", "type": "ExtensionInstanceViewStatus"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[str] = None, - type_handler_version: Optional[str] = None, - status: Optional["_models.ExtensionInstanceViewStatus"] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The extension name. - :paramtype name: str - :keyword type: Specifies the type of the extension; an example is "MicrosoftMonitoringAgent". - :paramtype type: str - :keyword type_handler_version: Specifies the version of the script handler. - :paramtype type_handler_version: str - :keyword status: Instance view status. - :paramtype status: ~azure.mgmt.azurestackhci.models.ExtensionInstanceViewStatus - """ - super().__init__(**kwargs) - self.name = name - self.type = type - self.type_handler_version = type_handler_version - self.status = status - - -class ExtensionInstanceViewStatus(_serialization.Model): - """Instance view status. - - :ivar code: The status code. - :vartype code: str - :ivar level: The level code. Known values are: "Info", "Warning", and "Error". - :vartype level: str or ~azure.mgmt.azurestackhci.models.StatusLevelTypes - :ivar display_status: The short localizable label for the status. - :vartype display_status: str - :ivar message: The detailed status message, including for alerts and error messages. - :vartype message: str - :ivar time: The time of the status. - :vartype time: ~datetime.datetime - """ - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "level": {"key": "level", "type": "str"}, - "display_status": {"key": "displayStatus", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "time": {"key": "time", "type": "iso-8601"}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - level: Optional[Union[str, "_models.StatusLevelTypes"]] = None, - display_status: Optional[str] = None, - message: Optional[str] = None, - time: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword code: The status code. - :paramtype code: str - :keyword level: The level code. Known values are: "Info", "Warning", and "Error". - :paramtype level: str or ~azure.mgmt.azurestackhci.models.StatusLevelTypes - :keyword display_status: The short localizable label for the status. - :paramtype display_status: str - :keyword message: The detailed status message, including for alerts and error messages. - :paramtype message: str - :keyword time: The time of the status. - :paramtype time: ~datetime.datetime - """ - super().__init__(**kwargs) - self.code = code - self.level = level - self.display_status = display_status - self.message = message - self.time = time - - -class ExtensionList(_serialization.Model): - """List of Extensions in HCI cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Extensions in HCI cluster. - :vartype value: list[~azure.mgmt.azurestackhci.models.Extension] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Extension]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class ExtensionPatch(_serialization.Model): - """Extension Details to update. - - :ivar extension_parameters: Describes the properties of a Machine Extension that can be - updated. - :vartype extension_parameters: ~azure.mgmt.azurestackhci.models.ExtensionPatchParameters - """ - - _attribute_map = { - "extension_parameters": {"key": "properties.extensionParameters", "type": "ExtensionPatchParameters"}, - } - - def __init__( - self, *, extension_parameters: Optional["_models.ExtensionPatchParameters"] = None, **kwargs: Any - ) -> None: - """ - :keyword extension_parameters: Describes the properties of a Machine Extension that can be - updated. - :paramtype extension_parameters: ~azure.mgmt.azurestackhci.models.ExtensionPatchParameters - """ - super().__init__(**kwargs) - self.extension_parameters = extension_parameters - - -class ExtensionPatchParameters(_serialization.Model): - """Describes the properties of a Machine Extension that can be updated. - - :ivar type_handler_version: Specifies the version of the script handler. Latest version would - be used if not specified. - :vartype type_handler_version: str - :ivar enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :vartype enable_automatic_upgrade: bool - :ivar settings: Json formatted public settings for the extension. - :vartype settings: JSON - :ivar protected_settings: Protected settings (may contain secrets). - :vartype protected_settings: JSON - """ - - _attribute_map = { - "type_handler_version": {"key": "typeHandlerVersion", "type": "str"}, - "enable_automatic_upgrade": {"key": "enableAutomaticUpgrade", "type": "bool"}, - "settings": {"key": "settings", "type": "object"}, - "protected_settings": {"key": "protectedSettings", "type": "object"}, - } - - def __init__( - self, - *, - type_handler_version: Optional[str] = None, - enable_automatic_upgrade: Optional[bool] = None, - settings: Optional[JSON] = None, - protected_settings: Optional[JSON] = None, - **kwargs: Any - ) -> None: - """ - :keyword type_handler_version: Specifies the version of the script handler. Latest version - would be used if not specified. - :paramtype type_handler_version: str - :keyword enable_automatic_upgrade: Indicates whether the extension should be automatically - upgraded by the platform if there is a newer version available. - :paramtype enable_automatic_upgrade: bool - :keyword settings: Json formatted public settings for the extension. - :paramtype settings: JSON - :keyword protected_settings: Protected settings (may contain secrets). - :paramtype protected_settings: JSON - """ - super().__init__(**kwargs) - self.type_handler_version = type_handler_version - self.enable_automatic_upgrade = enable_automatic_upgrade - self.settings = settings - self.protected_settings = protected_settings - - -class ExtensionProfile(_serialization.Model): - """Extensions details for edge device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar extensions: List of Arc extensions installed on edge device. - :vartype extensions: list[~azure.mgmt.azurestackhci.models.HciEdgeDeviceArcExtension] - """ - - _validation = { - "extensions": {"readonly": True}, - } - - _attribute_map = { - "extensions": {"key": "extensions", "type": "[HciEdgeDeviceArcExtension]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.extensions = None - - -class ExtensionUpgradeParameters(_serialization.Model): - """Describes the parameters for Extension upgrade. - - :ivar target_version: Extension Upgrade Target Version. - :vartype target_version: str - """ - - _attribute_map = { - "target_version": {"key": "targetVersion", "type": "str"}, - } - - def __init__(self, *, target_version: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword target_version: Extension Upgrade Target Version. - :paramtype target_version: str - """ - super().__init__(**kwargs) - self.target_version = target_version - - -class HciEdgeDevice(EdgeDevice): - """Arc-enabled edge device with HCI OS. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar kind: Device kind to support polymorphic resource. "HCI" - :vartype kind: str or ~azure.mgmt.azurestackhci.models.DeviceKind - :ivar properties: properties for Arc-enabled edge device with HCI OS. - :vartype properties: ~azure.mgmt.azurestackhci.models.HciEdgeDeviceProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "kind": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "kind": {"key": "kind", "type": "str"}, - "properties": {"key": "properties", "type": "HciEdgeDeviceProperties"}, - } - - def __init__(self, *, properties: Optional["_models.HciEdgeDeviceProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: properties for Arc-enabled edge device with HCI OS. - :paramtype properties: ~azure.mgmt.azurestackhci.models.HciEdgeDeviceProperties - """ - super().__init__(**kwargs) - self.kind: str = "HCI" - self.properties = properties - - -class HciEdgeDeviceAdapterPropertyOverrides(_serialization.Model): - """The AdapterPropertyOverrides of a cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar jumbo_packet: This parameter should only be modified based on your OEM guidance. Do not - modify this parameter without OEM validation. - :vartype jumbo_packet: str - :ivar network_direct: This parameter should only be modified based on your OEM guidance. Do not - modify this parameter without OEM validation. - :vartype network_direct: str - :ivar network_direct_technology: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. Expected values are 'iWARP', - 'RoCEv2', 'RoCE'. - :vartype network_direct_technology: str - """ - - _validation = { - "jumbo_packet": {"readonly": True}, - "network_direct": {"readonly": True}, - "network_direct_technology": {"readonly": True}, - } - - _attribute_map = { - "jumbo_packet": {"key": "jumboPacket", "type": "str"}, - "network_direct": {"key": "networkDirect", "type": "str"}, - "network_direct_technology": {"key": "networkDirectTechnology", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.jumbo_packet = None - self.network_direct = None - self.network_direct_technology = None - - -class HciEdgeDeviceArcExtension(_serialization.Model): - """Arc extension installed on edge device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar extension_name: Arc extension name installed on edge device. - :vartype extension_name: str - :ivar state: Arc extension state from arc machine extension. Known values are: "NotSpecified", - "Succeeded", "Failed", "Canceled", "Accepted", "Creating", "Updating", "Moving", "Deleting", - and "Deleted". - :vartype state: str or ~azure.mgmt.azurestackhci.models.ArcExtensionState - :ivar error_details: Error details while installing Arc extension. - :vartype error_details: list[~azure.mgmt.azurestackhci.models.HciValidationFailureDetail] - :ivar extension_resource_id: Arc Extension Azure resource id. - :vartype extension_resource_id: str - :ivar type_handler_version: Extension version installed. - :vartype type_handler_version: str - :ivar managed_by: Extension managed by user or Azure. Known values are: "User" and "Azure". - :vartype managed_by: str or ~azure.mgmt.azurestackhci.models.ExtensionManagedBy - """ - - _validation = { - "extension_name": {"readonly": True}, - "state": {"readonly": True}, - "error_details": {"readonly": True}, - "extension_resource_id": {"readonly": True}, - "type_handler_version": {"readonly": True}, - "managed_by": {"readonly": True}, - } - - _attribute_map = { - "extension_name": {"key": "extensionName", "type": "str"}, - "state": {"key": "state", "type": "str"}, - "error_details": {"key": "errorDetails", "type": "[HciValidationFailureDetail]"}, - "extension_resource_id": {"key": "extensionResourceId", "type": "str"}, - "type_handler_version": {"key": "typeHandlerVersion", "type": "str"}, - "managed_by": {"key": "managedBy", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.extension_name = None - self.state = None - self.error_details = None - self.extension_resource_id = None - self.type_handler_version = None - self.managed_by = None - - -class HciEdgeDeviceHostNetwork(_serialization.Model): - """The HostNetwork of a cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar intents: The network intents assigned to the network reference pattern used for the - deployment. Each intent will define its own name, traffic type, adapter names, and overrides as - recommended by your OEM. - :vartype intents: list[~azure.mgmt.azurestackhci.models.HciEdgeDeviceIntents] - :ivar storage_networks: List of StorageNetworks config to deploy AzureStackHCI Cluster. - :vartype storage_networks: list[~azure.mgmt.azurestackhci.models.HciEdgeDeviceStorageNetworks] - :ivar storage_connectivity_switchless: Defines how the storage adapters between nodes are - connected either switch or switch less. - :vartype storage_connectivity_switchless: bool - :ivar enable_storage_auto_ip: Optional parameter required only for 3 Nodes Switchless - deployments. This allows users to specify IPs and Mask for Storage NICs when Network ATC is not - assigning the IPs for storage automatically. - :vartype enable_storage_auto_ip: bool - """ - - _validation = { - "intents": {"readonly": True}, - "storage_networks": {"readonly": True}, - "storage_connectivity_switchless": {"readonly": True}, - "enable_storage_auto_ip": {"readonly": True}, - } - - _attribute_map = { - "intents": {"key": "intents", "type": "[HciEdgeDeviceIntents]"}, - "storage_networks": {"key": "storageNetworks", "type": "[HciEdgeDeviceStorageNetworks]"}, - "storage_connectivity_switchless": {"key": "storageConnectivitySwitchless", "type": "bool"}, - "enable_storage_auto_ip": {"key": "enableStorageAutoIp", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.intents = None - self.storage_networks = None - self.storage_connectivity_switchless = None - self.enable_storage_auto_ip = None - - -class HciEdgeDeviceIntents(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The Intents of a cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar scope: Scope for host network intent. - :vartype scope: int - :ivar intent_type: IntentType for host network intent. - :vartype intent_type: int - :ivar is_compute_intent_set: IsComputeIntentSet for host network intent. - :vartype is_compute_intent_set: bool - :ivar is_storage_intent_set: IsStorageIntentSet for host network intent. - :vartype is_storage_intent_set: bool - :ivar is_only_storage: IntentType for host network intent. - :vartype is_only_storage: bool - :ivar is_management_intent_set: IsManagementIntentSet for host network intent. - :vartype is_management_intent_set: bool - :ivar is_stretch_intent_set: IsStretchIntentSet for host network intent. - :vartype is_stretch_intent_set: bool - :ivar is_only_stretch: IsOnlyStretch for host network intent. - :vartype is_only_stretch: bool - :ivar is_network_intent_type: IsNetworkIntentType for host network intent. - :vartype is_network_intent_type: bool - :ivar intent_name: Name of the network intent you wish to create. - :vartype intent_name: str - :ivar intent_adapters: Array of adapters used for the network intent. - :vartype intent_adapters: list[str] - :ivar override_virtual_switch_configuration: This parameter should only be modified based on - your OEM guidance. Do not modify this parameter without OEM validation. - :vartype override_virtual_switch_configuration: bool - :ivar virtual_switch_configuration_overrides: Set virtualSwitch ConfigurationOverrides for - cluster. - :vartype virtual_switch_configuration_overrides: - ~azure.mgmt.azurestackhci.models.HciEdgeDeviceVirtualSwitchConfigurationOverrides - :ivar override_qos_policy: This parameter should only be modified based on your OEM guidance. - Do not modify this parameter without OEM validation. - :vartype override_qos_policy: bool - :ivar qos_policy_overrides: Set QoS PolicyOverrides for cluster. - :vartype qos_policy_overrides: ~azure.mgmt.azurestackhci.models.QosPolicyOverrides - :ivar override_adapter_property: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. - :vartype override_adapter_property: bool - :ivar adapter_property_overrides: Set Adapter PropertyOverrides for cluster. - :vartype adapter_property_overrides: - ~azure.mgmt.azurestackhci.models.HciEdgeDeviceAdapterPropertyOverrides - """ - - _validation = { - "scope": {"readonly": True}, - "intent_type": {"readonly": True}, - "is_compute_intent_set": {"readonly": True}, - "is_storage_intent_set": {"readonly": True}, - "is_only_storage": {"readonly": True}, - "is_management_intent_set": {"readonly": True}, - "is_stretch_intent_set": {"readonly": True}, - "is_only_stretch": {"readonly": True}, - "is_network_intent_type": {"readonly": True}, - "intent_name": {"readonly": True}, - "intent_adapters": {"readonly": True}, - "override_virtual_switch_configuration": {"readonly": True}, - "virtual_switch_configuration_overrides": {"readonly": True}, - "override_qos_policy": {"readonly": True}, - "qos_policy_overrides": {"readonly": True}, - "override_adapter_property": {"readonly": True}, - "adapter_property_overrides": {"readonly": True}, - } - - _attribute_map = { - "scope": {"key": "scope", "type": "int"}, - "intent_type": {"key": "intentType", "type": "int"}, - "is_compute_intent_set": {"key": "isComputeIntentSet", "type": "bool"}, - "is_storage_intent_set": {"key": "isStorageIntentSet", "type": "bool"}, - "is_only_storage": {"key": "isOnlyStorage", "type": "bool"}, - "is_management_intent_set": {"key": "isManagementIntentSet", "type": "bool"}, - "is_stretch_intent_set": {"key": "isStretchIntentSet", "type": "bool"}, - "is_only_stretch": {"key": "isOnlyStretch", "type": "bool"}, - "is_network_intent_type": {"key": "isNetworkIntentType", "type": "bool"}, - "intent_name": {"key": "intentName", "type": "str"}, - "intent_adapters": {"key": "intentAdapters", "type": "[str]"}, - "override_virtual_switch_configuration": {"key": "overrideVirtualSwitchConfiguration", "type": "bool"}, - "virtual_switch_configuration_overrides": { - "key": "virtualSwitchConfigurationOverrides", - "type": "HciEdgeDeviceVirtualSwitchConfigurationOverrides", - }, - "override_qos_policy": {"key": "overrideQosPolicy", "type": "bool"}, - "qos_policy_overrides": {"key": "qosPolicyOverrides", "type": "QosPolicyOverrides"}, - "override_adapter_property": {"key": "overrideAdapterProperty", "type": "bool"}, - "adapter_property_overrides": { - "key": "adapterPropertyOverrides", - "type": "HciEdgeDeviceAdapterPropertyOverrides", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.scope = None - self.intent_type = None - self.is_compute_intent_set = None - self.is_storage_intent_set = None - self.is_only_storage = None - self.is_management_intent_set = None - self.is_stretch_intent_set = None - self.is_only_stretch = None - self.is_network_intent_type = None - self.intent_name = None - self.intent_adapters = None - self.override_virtual_switch_configuration = None - self.virtual_switch_configuration_overrides = None - self.override_qos_policy = None - self.qos_policy_overrides = None - self.override_adapter_property = None - self.adapter_property_overrides = None - - -class HciEdgeDeviceProperties(EdgeDeviceProperties): - """properties for Arc-enabled edge device with HCI OS. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_configuration: Device Configuration. - :vartype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration - :ivar provisioning_state: Provisioning state of edgeDevice resource. Known values are: - "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar reported_properties: The instance view of all current configurations on HCI device. - :vartype reported_properties: ~azure.mgmt.azurestackhci.models.HciReportedProperties - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "reported_properties": {"readonly": True}, - } - - _attribute_map = { - "device_configuration": {"key": "deviceConfiguration", "type": "DeviceConfiguration"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "reported_properties": {"key": "reportedProperties", "type": "HciReportedProperties"}, - } - - def __init__(self, *, device_configuration: Optional["_models.DeviceConfiguration"] = None, **kwargs: Any) -> None: - """ - :keyword device_configuration: Device Configuration. - :paramtype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration - """ - super().__init__(device_configuration=device_configuration, **kwargs) - self.reported_properties = None - - -class HciEdgeDeviceStorageAdapterIPInfo(_serialization.Model): - """The StorageAdapter physical nodes of a cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar physical_node: storage adapter physical node name. - :vartype physical_node: str - :ivar ipv4_address: The IPv4 address assigned to each storage adapter physical node on your - Azure Stack HCI cluster. - :vartype ipv4_address: str - :ivar subnet_mask: The SubnetMask address assigned to each storage adapter physical node on - your Azure Stack HCI cluster. - :vartype subnet_mask: str - """ - - _validation = { - "physical_node": {"readonly": True}, - "ipv4_address": {"readonly": True}, - "subnet_mask": {"readonly": True}, - } - - _attribute_map = { - "physical_node": {"key": "physicalNode", "type": "str"}, - "ipv4_address": {"key": "ipv4Address", "type": "str"}, - "subnet_mask": {"key": "subnetMask", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.physical_node = None - self.ipv4_address = None - self.subnet_mask = None - - -class HciEdgeDeviceStorageNetworks(_serialization.Model): - """The StorageNetworks of a cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the storage network. - :vartype name: str - :ivar network_adapter_name: Name of the storage network adapter. - :vartype network_adapter_name: str - :ivar storage_vlan_id: ID specified for the VLAN storage network. This setting is applied to - the network interfaces that route the storage and VM migration traffic. - :vartype storage_vlan_id: str - :ivar storage_adapter_ip_info: List of Storage adapter physical nodes config to deploy - AzureStackHCI Cluster. - :vartype storage_adapter_ip_info: - list[~azure.mgmt.azurestackhci.models.HciEdgeDeviceStorageAdapterIPInfo] - """ - - _validation = { - "name": {"readonly": True}, - "network_adapter_name": {"readonly": True}, - "storage_vlan_id": {"readonly": True}, - "storage_adapter_ip_info": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "network_adapter_name": {"key": "networkAdapterName", "type": "str"}, - "storage_vlan_id": {"key": "storageVlanId", "type": "str"}, - "storage_adapter_ip_info": {"key": "storageAdapterIPInfo", "type": "[HciEdgeDeviceStorageAdapterIPInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.network_adapter_name = None - self.storage_vlan_id = None - self.storage_adapter_ip_info = None - - -class HciEdgeDeviceVirtualSwitchConfigurationOverrides(_serialization.Model): # pylint: disable=name-too-long - """The VirtualSwitchConfigurationOverrides of a cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar enable_iov: Enable IoV for Virtual Switch. - :vartype enable_iov: str - :ivar load_balancing_algorithm: Load Balancing Algorithm for Virtual Switch. - :vartype load_balancing_algorithm: str - """ - - _validation = { - "enable_iov": {"readonly": True}, - "load_balancing_algorithm": {"readonly": True}, - } - - _attribute_map = { - "enable_iov": {"key": "enableIov", "type": "str"}, - "load_balancing_algorithm": {"key": "loadBalancingAlgorithm", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.enable_iov = None - self.load_balancing_algorithm = None - - -class HciNetworkProfile(_serialization.Model): - """The network profile of a device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar nic_details: List of NIC Details of device. - :vartype nic_details: list[~azure.mgmt.azurestackhci.models.HciNicDetail] - :ivar switch_details: List of switch details for edge device. - :vartype switch_details: list[~azure.mgmt.azurestackhci.models.SwitchDetail] - :ivar host_network: HostNetwork config to deploy AzureStackHCI Cluster. - :vartype host_network: ~azure.mgmt.azurestackhci.models.HciEdgeDeviceHostNetwork - """ - - _validation = { - "nic_details": {"readonly": True}, - "switch_details": {"readonly": True}, - "host_network": {"readonly": True}, - } - - _attribute_map = { - "nic_details": {"key": "nicDetails", "type": "[HciNicDetail]"}, - "switch_details": {"key": "switchDetails", "type": "[SwitchDetail]"}, - "host_network": {"key": "hostNetwork", "type": "HciEdgeDeviceHostNetwork"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.nic_details = None - self.switch_details = None - self.host_network = None - - -class HciNicDetail(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The NIC Detail of a device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar adapter_name: Adapter Name of NIC. - :vartype adapter_name: str - :ivar interface_description: Interface Description of NIC. - :vartype interface_description: str - :ivar component_id: Component Id of NIC. - :vartype component_id: str - :ivar driver_version: Driver Version of NIC. - :vartype driver_version: str - :ivar ip4_address: Subnet Mask of NIC. - :vartype ip4_address: str - :ivar subnet_mask: Subnet Mask of NIC. - :vartype subnet_mask: str - :ivar default_gateway: Default Gateway of NIC. - :vartype default_gateway: str - :ivar dns_servers: DNS Servers for NIC. - :vartype dns_servers: list[str] - :ivar default_isolation_id: Default Isolation of Management NIC. - :vartype default_isolation_id: str - :ivar mac_address: MAC address information of NIC. - :vartype mac_address: str - :ivar slot: The slot attached to the NIC. - :vartype slot: str - :ivar switch_name: The switch attached to the NIC, if any. - :vartype switch_name: str - :ivar nic_type: The type of NIC, physical, virtual, management. - :vartype nic_type: str - :ivar vlan_id: The VLAN ID of the physical NIC. - :vartype vlan_id: str - :ivar nic_status: The status of NIC, up, disconnected. - :vartype nic_status: str - """ - - _validation = { - "adapter_name": {"readonly": True}, - "interface_description": {"readonly": True}, - "component_id": {"readonly": True}, - "driver_version": {"readonly": True}, - "ip4_address": {"readonly": True}, - "subnet_mask": {"readonly": True}, - "default_gateway": {"readonly": True}, - "dns_servers": {"readonly": True}, - "default_isolation_id": {"readonly": True}, - "mac_address": {"readonly": True}, - "slot": {"readonly": True}, - "switch_name": {"readonly": True}, - "nic_type": {"readonly": True}, - "vlan_id": {"readonly": True}, - "nic_status": {"readonly": True}, - } - - _attribute_map = { - "adapter_name": {"key": "adapterName", "type": "str"}, - "interface_description": {"key": "interfaceDescription", "type": "str"}, - "component_id": {"key": "componentId", "type": "str"}, - "driver_version": {"key": "driverVersion", "type": "str"}, - "ip4_address": {"key": "ip4Address", "type": "str"}, - "subnet_mask": {"key": "subnetMask", "type": "str"}, - "default_gateway": {"key": "defaultGateway", "type": "str"}, - "dns_servers": {"key": "dnsServers", "type": "[str]"}, - "default_isolation_id": {"key": "defaultIsolationId", "type": "str"}, - "mac_address": {"key": "macAddress", "type": "str"}, - "slot": {"key": "slot", "type": "str"}, - "switch_name": {"key": "switchName", "type": "str"}, - "nic_type": {"key": "nicType", "type": "str"}, - "vlan_id": {"key": "vlanId", "type": "str"}, - "nic_status": {"key": "nicStatus", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.adapter_name = None - self.interface_description = None - self.component_id = None - self.driver_version = None - self.ip4_address = None - self.subnet_mask = None - self.default_gateway = None - self.dns_servers = None - self.default_isolation_id = None - self.mac_address = None - self.slot = None - self.switch_name = None - self.nic_type = None - self.vlan_id = None - self.nic_status = None - - -class HciOsProfile(_serialization.Model): - """OS configurations for HCI device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar boot_type: The boot type of the device. e.g. UEFI, Legacy etc. - :vartype boot_type: str - :ivar assembly_version: Version of assembly present on device. - :vartype assembly_version: str - """ - - _validation = { - "boot_type": {"readonly": True}, - "assembly_version": {"readonly": True}, - } - - _attribute_map = { - "boot_type": {"key": "bootType", "type": "str"}, - "assembly_version": {"key": "assemblyVersion", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.boot_type = None - self.assembly_version = None - - -class ReportedProperties(_serialization.Model): - """Reported properties pushed from edge device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_state: edge device state. Known values are: "NotSpecified", "Connected", - "Disconnected", "Repairing", "Draining", "InMaintenance", "Resuming", and "Processing". - :vartype device_state: str or ~azure.mgmt.azurestackhci.models.DeviceState - :ivar extension_profile: Extensions details for edge device. - :vartype extension_profile: ~azure.mgmt.azurestackhci.models.ExtensionProfile - """ - - _validation = { - "device_state": {"readonly": True}, - "extension_profile": {"readonly": True}, - } - - _attribute_map = { - "device_state": {"key": "deviceState", "type": "str"}, - "extension_profile": {"key": "extensionProfile", "type": "ExtensionProfile"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.device_state = None - self.extension_profile = None - - -class HciReportedProperties(ReportedProperties): - """The device Configuration for HCI device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar device_state: edge device state. Known values are: "NotSpecified", "Connected", - "Disconnected", "Repairing", "Draining", "InMaintenance", "Resuming", and "Processing". - :vartype device_state: str or ~azure.mgmt.azurestackhci.models.DeviceState - :ivar extension_profile: Extensions details for edge device. - :vartype extension_profile: ~azure.mgmt.azurestackhci.models.ExtensionProfile - :ivar network_profile: HCI device network information. - :vartype network_profile: ~azure.mgmt.azurestackhci.models.HciNetworkProfile - :ivar os_profile: HCI device OS specific information. - :vartype os_profile: ~azure.mgmt.azurestackhci.models.HciOsProfile - :ivar sbe_deployment_package_info: Solution builder extension (SBE) deployment package - information. - :vartype sbe_deployment_package_info: ~azure.mgmt.azurestackhci.models.SbeDeploymentPackageInfo - """ - - _validation = { - "device_state": {"readonly": True}, - "extension_profile": {"readonly": True}, - "network_profile": {"readonly": True}, - "os_profile": {"readonly": True}, - "sbe_deployment_package_info": {"readonly": True}, - } - - _attribute_map = { - "device_state": {"key": "deviceState", "type": "str"}, - "extension_profile": {"key": "extensionProfile", "type": "ExtensionProfile"}, - "network_profile": {"key": "networkProfile", "type": "HciNetworkProfile"}, - "os_profile": {"key": "osProfile", "type": "HciOsProfile"}, - "sbe_deployment_package_info": {"key": "sbeDeploymentPackageInfo", "type": "SbeDeploymentPackageInfo"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.network_profile = None - self.os_profile = None - self.sbe_deployment_package_info = None - - -class HciValidationFailureDetail(_serialization.Model): - """details of validation failure. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar exception: Exception details while installing extension. - :vartype exception: str - """ - - _validation = { - "exception": {"readonly": True}, - } - - _attribute_map = { - "exception": {"key": "exception", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.exception = None - - -class InfrastructureNetwork(_serialization.Model): - """The InfrastructureNetwork of a AzureStackHCI Cluster. - - :ivar subnet_mask: Subnet mask that matches the provided IP address space. - :vartype subnet_mask: str - :ivar gateway: Default gateway that should be used for the provided IP address space. - :vartype gateway: str - :ivar ip_pools: Range of IP addresses from which addresses are allocated for nodes within a - subnet. - :vartype ip_pools: list[~azure.mgmt.azurestackhci.models.IpPools] - :ivar dns_servers: IPv4 address of the DNS servers in your environment. - :vartype dns_servers: list[str] - :ivar use_dhcp: Allows customers to use DHCP for Hosts and Cluster IPs. If not declared, the - deployment will default to static IPs. When true, GW and DNS servers are not required. - :vartype use_dhcp: bool - """ - - _attribute_map = { - "subnet_mask": {"key": "subnetMask", "type": "str"}, - "gateway": {"key": "gateway", "type": "str"}, - "ip_pools": {"key": "ipPools", "type": "[IpPools]"}, - "dns_servers": {"key": "dnsServers", "type": "[str]"}, - "use_dhcp": {"key": "useDhcp", "type": "bool"}, - } - - def __init__( - self, - *, - subnet_mask: Optional[str] = None, - gateway: Optional[str] = None, - ip_pools: Optional[List["_models.IpPools"]] = None, - dns_servers: Optional[List[str]] = None, - use_dhcp: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword subnet_mask: Subnet mask that matches the provided IP address space. - :paramtype subnet_mask: str - :keyword gateway: Default gateway that should be used for the provided IP address space. - :paramtype gateway: str - :keyword ip_pools: Range of IP addresses from which addresses are allocated for nodes within a - subnet. - :paramtype ip_pools: list[~azure.mgmt.azurestackhci.models.IpPools] - :keyword dns_servers: IPv4 address of the DNS servers in your environment. - :paramtype dns_servers: list[str] - :keyword use_dhcp: Allows customers to use DHCP for Hosts and Cluster IPs. If not declared, the - deployment will default to static IPs. When true, GW and DNS servers are not required. - :paramtype use_dhcp: bool - """ - super().__init__(**kwargs) - self.subnet_mask = subnet_mask - self.gateway = gateway - self.ip_pools = ip_pools - self.dns_servers = dns_servers - self.use_dhcp = use_dhcp - - -class IpPools(_serialization.Model): - """The dnsServers of a device. - - :ivar starting_address: Starting IP address for the management network. A minimum of six free, - contiguous IPv4 addresses (excluding your host IPs) are needed for infrastructure services such - as clustering. - :vartype starting_address: str - :ivar ending_address: Ending IP address for the management network. A minimum of six free, - contiguous IPv4 addresses (excluding your host IPs) are needed for infrastructure services such - as clustering. - :vartype ending_address: str - """ - - _attribute_map = { - "starting_address": {"key": "startingAddress", "type": "str"}, - "ending_address": {"key": "endingAddress", "type": "str"}, - } - - def __init__( - self, *, starting_address: Optional[str] = None, ending_address: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword starting_address: Starting IP address for the management network. A minimum of six - free, contiguous IPv4 addresses (excluding your host IPs) are needed for infrastructure - services such as clustering. - :paramtype starting_address: str - :keyword ending_address: Ending IP address for the management network. A minimum of six free, - contiguous IPv4 addresses (excluding your host IPs) are needed for infrastructure services such - as clustering. - :paramtype ending_address: str - """ - super().__init__(**kwargs) - self.starting_address = starting_address - self.ending_address = ending_address - - -class IsolatedVmAttestationConfiguration(_serialization.Model): - """Attestation configurations for isolated VM (e.g. TVM, CVM) of the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar attestation_resource_id: Fully qualified Azure resource id of the Microsoft Azure - attestation resource associated with this cluster. - :vartype attestation_resource_id: str - :ivar relying_party_service_endpoint: Region specific endpoint for relying party service. - :vartype relying_party_service_endpoint: str - :ivar attestation_service_endpoint: Region specific endpoint for Microsoft Azure Attestation - service for the cluster. - :vartype attestation_service_endpoint: str - """ - - _validation = { - "attestation_resource_id": {"readonly": True}, - "relying_party_service_endpoint": {"readonly": True}, - "attestation_service_endpoint": {"readonly": True}, - } - - _attribute_map = { - "attestation_resource_id": {"key": "attestationResourceId", "type": "str"}, - "relying_party_service_endpoint": {"key": "relyingPartyServiceEndpoint", "type": "str"}, - "attestation_service_endpoint": {"key": "attestationServiceEndpoint", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.attestation_resource_id = None - self.relying_party_service_endpoint = None - self.attestation_service_endpoint = None - - -class LogCollectionError(_serialization.Model): - """Log Collection Error details of the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_code: Error Code of the log collection. - :vartype error_code: str - :ivar error_message: Error Message of the log collection. - :vartype error_message: str - """ - - _validation = { - "error_code": {"readonly": True}, - "error_message": {"readonly": True}, - } - - _attribute_map = { - "error_code": {"key": "errorCode", "type": "str"}, - "error_message": {"key": "errorMessage", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.error_code = None - self.error_message = None - - -class LogCollectionProperties(_serialization.Model): - """Log Collection properties of the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar from_date: From DateTimeStamp from when logs need to be connected. - :vartype from_date: ~datetime.datetime - :ivar to_date: To DateTimeStamp till when logs need to be connected. - :vartype to_date: ~datetime.datetime - :ivar last_log_generated: Recent DateTimeStamp where logs are successfully generated. - :vartype last_log_generated: ~datetime.datetime - :ivar log_collection_session_details: - :vartype log_collection_session_details: - list[~azure.mgmt.azurestackhci.models.LogCollectionSession] - """ - - _validation = { - "from_date": {"readonly": True}, - "to_date": {"readonly": True}, - "last_log_generated": {"readonly": True}, - "log_collection_session_details": {"readonly": True}, - } - - _attribute_map = { - "from_date": {"key": "fromDate", "type": "iso-8601"}, - "to_date": {"key": "toDate", "type": "iso-8601"}, - "last_log_generated": {"key": "lastLogGenerated", "type": "iso-8601"}, - "log_collection_session_details": {"key": "logCollectionSessionDetails", "type": "[LogCollectionSession]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.from_date = None - self.to_date = None - self.last_log_generated = None - self.log_collection_session_details = None - - -class LogCollectionRequest(_serialization.Model): - """Log Collection Request. - - :ivar properties: Properties for Log Collection Request. - :vartype properties: ~azure.mgmt.azurestackhci.models.LogCollectionRequestProperties - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "LogCollectionRequestProperties"}, - } - - def __init__(self, *, properties: Optional["_models.LogCollectionRequestProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Properties for Log Collection Request. - :paramtype properties: ~azure.mgmt.azurestackhci.models.LogCollectionRequestProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class LogCollectionRequestProperties(_serialization.Model): - """Properties for Log Collection Request. - - All required parameters must be populated in order to send to server. - - :ivar from_date: From DateTimeStamp from when logs need to be connected. Required. - :vartype from_date: ~datetime.datetime - :ivar to_date: To DateTimeStamp till when logs need to be connected. Required. - :vartype to_date: ~datetime.datetime - """ - - _validation = { - "from_date": {"required": True}, - "to_date": {"required": True}, - } - - _attribute_map = { - "from_date": {"key": "fromDate", "type": "iso-8601"}, - "to_date": {"key": "toDate", "type": "iso-8601"}, - } - - def __init__(self, *, from_date: datetime.datetime, to_date: datetime.datetime, **kwargs: Any) -> None: - """ - :keyword from_date: From DateTimeStamp from when logs need to be connected. Required. - :paramtype from_date: ~datetime.datetime - :keyword to_date: To DateTimeStamp till when logs need to be connected. Required. - :paramtype to_date: ~datetime.datetime - """ - super().__init__(**kwargs) - self.from_date = from_date - self.to_date = to_date - - -class LogCollectionSession(_serialization.Model): - """Log Collection Session details of the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar log_start_time: Start Time of the logs when it was collected. - :vartype log_start_time: ~datetime.datetime - :ivar log_end_time: End Time of the logs when it was collected. - :vartype log_end_time: ~datetime.datetime - :ivar time_collected: Duration of logs collected. - :vartype time_collected: ~datetime.datetime - :ivar log_size: Size of the logs collected. - :vartype log_size: int - :ivar log_collection_status: LogCollection status. Known values are: "None", "InProgress", - "Failed", and "Succeeded". - :vartype log_collection_status: str or ~azure.mgmt.azurestackhci.models.LogCollectionStatus - :ivar log_collection_job_type: LogCollection job type. Known values are: "OnDemand" and - "Scheduled". - :vartype log_collection_job_type: str or ~azure.mgmt.azurestackhci.models.LogCollectionJobType - :ivar correlation_id: CorrelationId of the log collection. - :vartype correlation_id: str - :ivar end_time_collected: End Time of the logs when it was collected. - :vartype end_time_collected: ~datetime.datetime - :ivar log_collection_error: Log Collection Error details of the cluster. - :vartype log_collection_error: ~azure.mgmt.azurestackhci.models.LogCollectionError - """ - - _validation = { - "log_start_time": {"readonly": True}, - "log_end_time": {"readonly": True}, - "time_collected": {"readonly": True}, - "log_size": {"readonly": True}, - "log_collection_status": {"readonly": True}, - "log_collection_job_type": {"readonly": True}, - "correlation_id": {"readonly": True}, - "end_time_collected": {"readonly": True}, - "log_collection_error": {"readonly": True}, - } - - _attribute_map = { - "log_start_time": {"key": "logStartTime", "type": "iso-8601"}, - "log_end_time": {"key": "logEndTime", "type": "iso-8601"}, - "time_collected": {"key": "timeCollected", "type": "iso-8601"}, - "log_size": {"key": "logSize", "type": "int"}, - "log_collection_status": {"key": "logCollectionStatus", "type": "str"}, - "log_collection_job_type": {"key": "logCollectionJobType", "type": "str"}, - "correlation_id": {"key": "correlationId", "type": "str"}, - "end_time_collected": {"key": "endTimeCollected", "type": "iso-8601"}, - "log_collection_error": {"key": "logCollectionError", "type": "LogCollectionError"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.log_start_time = None - self.log_end_time = None - self.time_collected = None - self.log_size = None - self.log_collection_status = None - self.log_collection_job_type = None - self.correlation_id = None - self.end_time_collected = None - self.log_collection_error = None - - -class NetworkController(_serialization.Model): - """network controller config for SDN Integration to deploy AzureStackHCI Cluster. - - :ivar mac_address_pool_start: macAddressPoolStart of network controller used for SDN - Integration. - :vartype mac_address_pool_start: str - :ivar mac_address_pool_stop: macAddressPoolStop of network controller used for SDN Integration. - :vartype mac_address_pool_stop: str - :ivar network_virtualization_enabled: NetworkVirtualizationEnabled of network controller used - for SDN Integration. - :vartype network_virtualization_enabled: bool - """ - - _attribute_map = { - "mac_address_pool_start": {"key": "macAddressPoolStart", "type": "str"}, - "mac_address_pool_stop": {"key": "macAddressPoolStop", "type": "str"}, - "network_virtualization_enabled": {"key": "networkVirtualizationEnabled", "type": "bool"}, - } - - def __init__( - self, - *, - mac_address_pool_start: Optional[str] = None, - mac_address_pool_stop: Optional[str] = None, - network_virtualization_enabled: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword mac_address_pool_start: macAddressPoolStart of network controller used for SDN - Integration. - :paramtype mac_address_pool_start: str - :keyword mac_address_pool_stop: macAddressPoolStop of network controller used for SDN - Integration. - :paramtype mac_address_pool_stop: str - :keyword network_virtualization_enabled: NetworkVirtualizationEnabled of network controller - used for SDN Integration. - :paramtype network_virtualization_enabled: bool - """ - super().__init__(**kwargs) - self.mac_address_pool_start = mac_address_pool_start - self.mac_address_pool_stop = mac_address_pool_stop - self.network_virtualization_enabled = network_virtualization_enabled - - -class NicDetail(_serialization.Model): - """The NIC Detail of a device. - - :ivar adapter_name: Adapter Name of NIC. - :vartype adapter_name: str - :ivar interface_description: Interface Description of NIC. - :vartype interface_description: str - :ivar component_id: Component Id of NIC. - :vartype component_id: str - :ivar driver_version: Driver Version of NIC. - :vartype driver_version: str - :ivar ip4_address: Subnet Mask of NIC. - :vartype ip4_address: str - :ivar subnet_mask: Subnet Mask of NIC. - :vartype subnet_mask: str - :ivar default_gateway: Default Gateway of NIC. - :vartype default_gateway: str - :ivar dns_servers: DNS Servers for NIC. - :vartype dns_servers: list[str] - :ivar default_isolation_id: Default Isolation of Management NIC. - :vartype default_isolation_id: str - """ - - _attribute_map = { - "adapter_name": {"key": "adapterName", "type": "str"}, - "interface_description": {"key": "interfaceDescription", "type": "str"}, - "component_id": {"key": "componentId", "type": "str"}, - "driver_version": {"key": "driverVersion", "type": "str"}, - "ip4_address": {"key": "ip4Address", "type": "str"}, - "subnet_mask": {"key": "subnetMask", "type": "str"}, - "default_gateway": {"key": "defaultGateway", "type": "str"}, - "dns_servers": {"key": "dnsServers", "type": "[str]"}, - "default_isolation_id": {"key": "defaultIsolationId", "type": "str"}, - } - - def __init__( - self, - *, - adapter_name: Optional[str] = None, - interface_description: Optional[str] = None, - component_id: Optional[str] = None, - driver_version: Optional[str] = None, - ip4_address: Optional[str] = None, - subnet_mask: Optional[str] = None, - default_gateway: Optional[str] = None, - dns_servers: Optional[List[str]] = None, - default_isolation_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword adapter_name: Adapter Name of NIC. - :paramtype adapter_name: str - :keyword interface_description: Interface Description of NIC. - :paramtype interface_description: str - :keyword component_id: Component Id of NIC. - :paramtype component_id: str - :keyword driver_version: Driver Version of NIC. - :paramtype driver_version: str - :keyword ip4_address: Subnet Mask of NIC. - :paramtype ip4_address: str - :keyword subnet_mask: Subnet Mask of NIC. - :paramtype subnet_mask: str - :keyword default_gateway: Default Gateway of NIC. - :paramtype default_gateway: str - :keyword dns_servers: DNS Servers for NIC. - :paramtype dns_servers: list[str] - :keyword default_isolation_id: Default Isolation of Management NIC. - :paramtype default_isolation_id: str - """ - super().__init__(**kwargs) - self.adapter_name = adapter_name - self.interface_description = interface_description - self.component_id = component_id - self.driver_version = driver_version - self.ip4_address = ip4_address - self.subnet_mask = subnet_mask - self.default_gateway = default_gateway - self.dns_servers = dns_servers - self.default_isolation_id = default_isolation_id - - -class Observability(_serialization.Model): - """The Observability of AzureStackHCI Cluster. - - :ivar streaming_data_client: Enables telemetry data to be sent to Microsoft. - :vartype streaming_data_client: bool - :ivar eu_location: Location of your cluster. The log and diagnostic data is sent to the - appropriate diagnostics servers depending upon where your cluster resides. Setting this to - false results in all data sent to Microsoft to be stored outside of the EU. - :vartype eu_location: bool - :ivar episodic_data_upload: When set to true, collects log data to facilitate quicker issue - resolution. - :vartype episodic_data_upload: bool - """ - - _attribute_map = { - "streaming_data_client": {"key": "streamingDataClient", "type": "bool"}, - "eu_location": {"key": "euLocation", "type": "bool"}, - "episodic_data_upload": {"key": "episodicDataUpload", "type": "bool"}, - } - - def __init__( - self, - *, - streaming_data_client: bool = True, - eu_location: bool = False, - episodic_data_upload: bool = True, - **kwargs: Any - ) -> None: - """ - :keyword streaming_data_client: Enables telemetry data to be sent to Microsoft. - :paramtype streaming_data_client: bool - :keyword eu_location: Location of your cluster. The log and diagnostic data is sent to the - appropriate diagnostics servers depending upon where your cluster resides. Setting this to - false results in all data sent to Microsoft to be stored outside of the EU. - :paramtype eu_location: bool - :keyword episodic_data_upload: When set to true, collects log data to facilitate quicker issue - resolution. - :paramtype episodic_data_upload: bool - """ - super().__init__(**kwargs) - self.streaming_data_client = streaming_data_client - self.eu_location = eu_location - self.episodic_data_upload = episodic_data_upload - - -class Offer(ProxyResource): - """Offer details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar provisioning_state: Provisioning State. - :vartype provisioning_state: str - :ivar publisher_id: Identifier of the Publisher for the offer. - :vartype publisher_id: str - :ivar content: JSON serialized catalog content of the offer. - :vartype content: str - :ivar content_version: The API version of the catalog service used to serve the catalog - content. - :vartype content_version: str - :ivar sku_mappings: Array of SKU mappings. - :vartype sku_mappings: list[~azure.mgmt.azurestackhci.models.SkuMappings] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "publisher_id": {"key": "properties.publisherId", "type": "str"}, - "content": {"key": "properties.content", "type": "str"}, - "content_version": {"key": "properties.contentVersion", "type": "str"}, - "sku_mappings": {"key": "properties.skuMappings", "type": "[SkuMappings]"}, - } - - def __init__( - self, - *, - publisher_id: Optional[str] = None, - content: Optional[str] = None, - content_version: Optional[str] = None, - sku_mappings: Optional[List["_models.SkuMappings"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword publisher_id: Identifier of the Publisher for the offer. - :paramtype publisher_id: str - :keyword content: JSON serialized catalog content of the offer. - :paramtype content: str - :keyword content_version: The API version of the catalog service used to serve the catalog - content. - :paramtype content_version: str - :keyword sku_mappings: Array of SKU mappings. - :paramtype sku_mappings: list[~azure.mgmt.azurestackhci.models.SkuMappings] - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.publisher_id = publisher_id - self.content = content - self.content_version = content_version - self.sku_mappings = sku_mappings - - -class OfferList(_serialization.Model): - """List of Offer proxy resources for the HCI cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Offer proxy resources. - :vartype value: list[~azure.mgmt.azurestackhci.models.Offer] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Offer]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class Operation(_serialization.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - :vartype name: str - :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for - data-plane operations and "false" for ARM/control-plane operations. - :vartype is_data_action: bool - :ivar display: Localized display information for this particular operation. - :vartype display: ~azure.mgmt.azurestackhci.models.OperationDisplay - :ivar origin: The intended executor of the operation; as in Resource Based Access Control - (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", - and "user,system". - :vartype origin: str or ~azure.mgmt.azurestackhci.models.Origin - :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for - internal only APIs. "Internal" - :vartype action_type: str or ~azure.mgmt.azurestackhci.models.ActionType - """ - - _validation = { - "name": {"readonly": True}, - "is_data_action": {"readonly": True}, - "origin": {"readonly": True}, - "action_type": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "action_type": {"key": "actionType", "type": "str"}, - } - - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: - """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.azurestackhci.models.OperationDisplay - """ - super().__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None - - -class OperationDisplay(_serialization.Model): - """Localized display information for this particular operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft - Monitoring Insights" or "Microsoft Compute". - :vartype provider: str - :ivar resource: The localized friendly name of the resource type related to this operation. - E.g. "Virtual Machines" or "Job Schedule Collections". - :vartype resource: str - :ivar operation: The concise, localized friendly name for the operation; suitable for - dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". - :vartype operation: str - :ivar description: The short, localized friendly description of the operation; suitable for - tool tips and detailed views. - :vartype description: str - """ - - _validation = { - "provider": {"readonly": True}, - "resource": {"readonly": True}, - "operation": {"readonly": True}, - "description": {"readonly": True}, - } - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - - -class OperationListResult(_serialization.Model): - """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link - to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations supported by the resource provider. - :vartype value: list[~azure.mgmt.azurestackhci.models.Operation] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class OptionalServices(_serialization.Model): - """The OptionalServices of AzureStackHCI Cluster. - - :ivar custom_location: The name of custom location. - :vartype custom_location: str - """ - - _attribute_map = { - "custom_location": {"key": "customLocation", "type": "str"}, - } - - def __init__(self, *, custom_location: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword custom_location: The name of custom location. - :paramtype custom_location: str - """ - super().__init__(**kwargs) - self.custom_location = custom_location - - -class PackageVersionInfo(_serialization.Model): - """Current version of each updatable component. - - :ivar package_type: Package type. - :vartype package_type: str - :ivar version: Package version. - :vartype version: str - :ivar last_updated: Last time this component was updated. - :vartype last_updated: ~datetime.datetime - """ - - _attribute_map = { - "package_type": {"key": "packageType", "type": "str"}, - "version": {"key": "version", "type": "str"}, - "last_updated": {"key": "lastUpdated", "type": "iso-8601"}, - } - - def __init__( - self, - *, - package_type: Optional[str] = None, - version: Optional[str] = None, - last_updated: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword package_type: Package type. - :paramtype package_type: str - :keyword version: Package version. - :paramtype version: str - :keyword last_updated: Last time this component was updated. - :paramtype last_updated: ~datetime.datetime - """ - super().__init__(**kwargs) - self.package_type = package_type - self.version = version - self.last_updated = last_updated - - -class PasswordCredential(_serialization.Model): - """PasswordCredential. - - :ivar secret_text: - :vartype secret_text: str - :ivar key_id: - :vartype key_id: str - :ivar start_date_time: - :vartype start_date_time: ~datetime.datetime - :ivar end_date_time: - :vartype end_date_time: ~datetime.datetime - """ - - _attribute_map = { - "secret_text": {"key": "secretText", "type": "str"}, - "key_id": {"key": "keyId", "type": "str"}, - "start_date_time": {"key": "startDateTime", "type": "iso-8601"}, - "end_date_time": {"key": "endDateTime", "type": "iso-8601"}, - } - - def __init__( - self, - *, - secret_text: Optional[str] = None, - key_id: Optional[str] = None, - start_date_time: Optional[datetime.datetime] = None, - end_date_time: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword secret_text: - :paramtype secret_text: str - :keyword key_id: - :paramtype key_id: str - :keyword start_date_time: - :paramtype start_date_time: ~datetime.datetime - :keyword end_date_time: - :paramtype end_date_time: ~datetime.datetime - """ - super().__init__(**kwargs) - self.secret_text = secret_text - self.key_id = key_id - self.start_date_time = start_date_time - self.end_date_time = end_date_time - - -class PerNodeExtensionState(_serialization.Model): - """Status of Arc Extension for a particular node in HCI Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the node in HCI Cluster. - :vartype name: str - :ivar extension: Fully qualified resource ID for the particular Arc Extension on this node. - :vartype extension: str - :ivar type_handler_version: Specifies the version of the script handler. - :vartype type_handler_version: str - :ivar state: State of Arc Extension in this node. Known values are: "NotSpecified", "Error", - "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", and "Provisioning". - :vartype state: str or ~azure.mgmt.azurestackhci.models.NodeExtensionState - :ivar instance_view: The extension instance view. - :vartype instance_view: ~azure.mgmt.azurestackhci.models.ExtensionInstanceView - """ - - _validation = { - "name": {"readonly": True}, - "extension": {"readonly": True}, - "type_handler_version": {"readonly": True}, - "state": {"readonly": True}, - "instance_view": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "extension": {"key": "extension", "type": "str"}, - "type_handler_version": {"key": "typeHandlerVersion", "type": "str"}, - "state": {"key": "state", "type": "str"}, - "instance_view": {"key": "instanceView", "type": "ExtensionInstanceView"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.extension = None - self.type_handler_version = None - self.state = None - self.instance_view = None - - -class PerNodeRemoteSupportSession(_serialization.Model): - """Remote Support Node Session Details on the Node. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar session_start_time: Remote Support Session StartTime on the Node. - :vartype session_start_time: ~datetime.datetime - :ivar session_end_time: Remote Support Session EndTime on the Node. - :vartype session_end_time: ~datetime.datetime - :ivar node_name: Name of the node. - :vartype node_name: str - :ivar duration: Duration of Remote Support Enablement. - :vartype duration: int - :ivar access_level: Remote Support Access Level. Known values are: "Diagnostics" and - "DiagnosticsAndRepair". - :vartype access_level: str or ~azure.mgmt.azurestackhci.models.AccessLevel - """ - - _validation = { - "session_start_time": {"readonly": True}, - "session_end_time": {"readonly": True}, - "node_name": {"readonly": True}, - "duration": {"readonly": True}, - "access_level": {"readonly": True}, - } - - _attribute_map = { - "session_start_time": {"key": "sessionStartTime", "type": "iso-8601"}, - "session_end_time": {"key": "sessionEndTime", "type": "iso-8601"}, - "node_name": {"key": "nodeName", "type": "str"}, - "duration": {"key": "duration", "type": "int"}, - "access_level": {"key": "accessLevel", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.session_start_time = None - self.session_end_time = None - self.node_name = None - self.duration = None - self.access_level = None - - -class PerNodeState(_serialization.Model): - """Status of Arc agent for a particular node in HCI Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the Node in HCI Cluster. - :vartype name: str - :ivar arc_instance: Fully qualified resource ID for the Arc agent of this node. - :vartype arc_instance: str - :ivar arc_node_service_principal_object_id: The service principal id of the arc for server - node. - :vartype arc_node_service_principal_object_id: str - :ivar state: State of Arc agent in this node. Known values are: "NotSpecified", "Error", - "Succeeded", "Canceled", "Failed", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype state: str or ~azure.mgmt.azurestackhci.models.NodeArcState - """ - - _validation = { - "name": {"readonly": True}, - "arc_instance": {"readonly": True}, - "arc_node_service_principal_object_id": {"readonly": True}, - "state": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "arc_instance": {"key": "arcInstance", "type": "str"}, - "arc_node_service_principal_object_id": {"key": "arcNodeServicePrincipalObjectId", "type": "str"}, - "state": {"key": "state", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.arc_instance = None - self.arc_node_service_principal_object_id = None - self.state = None - - -class PhysicalNodes(_serialization.Model): - """The PhysicalNodes of a cluster. - - :ivar name: NETBIOS name of each physical server on your Azure Stack HCI cluster. - :vartype name: str - :ivar ipv4_address: The IPv4 address assigned to each physical server on your Azure Stack HCI - cluster. - :vartype ipv4_address: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "ipv4_address": {"key": "ipv4Address", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, ipv4_address: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: NETBIOS name of each physical server on your Azure Stack HCI cluster. - :paramtype name: str - :keyword ipv4_address: The IPv4 address assigned to each physical server on your Azure Stack - HCI cluster. - :paramtype ipv4_address: str - """ - super().__init__(**kwargs) - self.name = name - self.ipv4_address = ipv4_address - - -class PrecheckResult(_serialization.Model): # pylint: disable=too-many-instance-attributes - """PrecheckResult. - - :ivar name: Name of the individual test/rule/alert that was executed. Unique, not exposed to - the customer. - :vartype name: str - :ivar display_name: The health check DisplayName localized of the individual test executed. - :vartype display_name: str - :ivar tags: Key-value pairs that allow grouping/filtering individual tests. - :vartype tags: ~azure.mgmt.azurestackhci.models.PrecheckResultTags - :ivar health_check_tags: Key-value pairs that allow grouping/filtering individual tests. - :vartype health_check_tags: JSON - :ivar title: User-facing name; one or more sentences indicating the direct issue. - :vartype title: str - :ivar status: The status of the check running (i.e. Failed, Succeeded, In Progress). This - answers whether the check ran, and passed or failed. Known values are: "NotYetRegistered", - "ConnectedRecently", "NotConnectedRecently", "Disconnected", "Error", "NotSpecified", - "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", - "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", and "InProgress". - :vartype status: str or ~azure.mgmt.azurestackhci.models.Status - :ivar severity: Severity of the result (Critical, Warning, Informational, Hidden). This answers - how important the result is. Critical is the only update-blocking severity. Known values are: - "Critical", "Warning", "Informational", and "Hidden". - :vartype severity: str or ~azure.mgmt.azurestackhci.models.Severity - :ivar description: Detailed overview of the issue and what impact the issue has on the stamp. - :vartype description: str - :ivar remediation: Set of steps that can be taken to resolve the issue found. - :vartype remediation: str - :ivar target_resource_id: The unique identifier for the affected resource (such as a node or - drive). - :vartype target_resource_id: str - :ivar target_resource_name: The name of the affected resource. - :vartype target_resource_name: str - :ivar target_resource_type: The type of resource being referred to (well-known set of nouns in - infrastructure, aligning with Monitoring). - :vartype target_resource_type: str - :ivar timestamp: The time in which the HealthCheck was called. - :vartype timestamp: ~datetime.datetime - :ivar additional_data: Property bag of key value pairs for additional information. - :vartype additional_data: str - :ivar health_check_source: The name of the services called for the HealthCheck (I.E. - Test-AzureStack, Test-Cluster). - :vartype health_check_source: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "tags": {"key": "tags", "type": "PrecheckResultTags"}, - "health_check_tags": {"key": "healthCheckTags", "type": "object"}, - "title": {"key": "title", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "remediation": {"key": "remediation", "type": "str"}, - "target_resource_id": {"key": "targetResourceID", "type": "str"}, - "target_resource_name": {"key": "targetResourceName", "type": "str"}, - "target_resource_type": {"key": "targetResourceType", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "additional_data": {"key": "additionalData", "type": "str"}, - "health_check_source": {"key": "healthCheckSource", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - display_name: Optional[str] = None, - tags: Optional["_models.PrecheckResultTags"] = None, - health_check_tags: Optional[JSON] = None, - title: Optional[str] = None, - status: Optional[Union[str, "_models.Status"]] = None, - severity: Optional[Union[str, "_models.Severity"]] = None, - description: Optional[str] = None, - remediation: Optional[str] = None, - target_resource_id: Optional[str] = None, - target_resource_name: Optional[str] = None, - target_resource_type: Optional[str] = None, - timestamp: Optional[datetime.datetime] = None, - additional_data: Optional[str] = None, - health_check_source: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the individual test/rule/alert that was executed. Unique, not exposed to - the customer. - :paramtype name: str - :keyword display_name: The health check DisplayName localized of the individual test executed. - :paramtype display_name: str - :keyword tags: Key-value pairs that allow grouping/filtering individual tests. - :paramtype tags: ~azure.mgmt.azurestackhci.models.PrecheckResultTags - :keyword health_check_tags: Key-value pairs that allow grouping/filtering individual tests. - :paramtype health_check_tags: JSON - :keyword title: User-facing name; one or more sentences indicating the direct issue. - :paramtype title: str - :keyword status: The status of the check running (i.e. Failed, Succeeded, In Progress). This - answers whether the check ran, and passed or failed. Known values are: "NotYetRegistered", - "ConnectedRecently", "NotConnectedRecently", "Disconnected", "Error", "NotSpecified", - "ValidationInProgress", "ValidationSuccess", "ValidationFailed", "DeploymentInProgress", - "DeploymentFailed", "DeploymentSuccess", "Succeeded", "Failed", and "InProgress". - :paramtype status: str or ~azure.mgmt.azurestackhci.models.Status - :keyword severity: Severity of the result (Critical, Warning, Informational, Hidden). This - answers how important the result is. Critical is the only update-blocking severity. Known - values are: "Critical", "Warning", "Informational", and "Hidden". - :paramtype severity: str or ~azure.mgmt.azurestackhci.models.Severity - :keyword description: Detailed overview of the issue and what impact the issue has on the - stamp. - :paramtype description: str - :keyword remediation: Set of steps that can be taken to resolve the issue found. - :paramtype remediation: str - :keyword target_resource_id: The unique identifier for the affected resource (such as a node or - drive). - :paramtype target_resource_id: str - :keyword target_resource_name: The name of the affected resource. - :paramtype target_resource_name: str - :keyword target_resource_type: The type of resource being referred to (well-known set of nouns - in infrastructure, aligning with Monitoring). - :paramtype target_resource_type: str - :keyword timestamp: The time in which the HealthCheck was called. - :paramtype timestamp: ~datetime.datetime - :keyword additional_data: Property bag of key value pairs for additional information. - :paramtype additional_data: str - :keyword health_check_source: The name of the services called for the HealthCheck (I.E. - Test-AzureStack, Test-Cluster). - :paramtype health_check_source: str - """ - super().__init__(**kwargs) - self.name = name - self.display_name = display_name - self.tags = tags - self.health_check_tags = health_check_tags - self.title = title - self.status = status - self.severity = severity - self.description = description - self.remediation = remediation - self.target_resource_id = target_resource_id - self.target_resource_name = target_resource_name - self.target_resource_type = target_resource_type - self.timestamp = timestamp - self.additional_data = additional_data - self.health_check_source = health_check_source - - -class PrecheckResultTags(_serialization.Model): - """Key-value pairs that allow grouping/filtering individual tests. - - :ivar key: Key that allow grouping/filtering individual tests. - :vartype key: str - :ivar value: Value of the key that allow grouping/filtering individual tests. - :vartype value: str - """ - - _attribute_map = { - "key": {"key": "key", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, key: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword key: Key that allow grouping/filtering individual tests. - :paramtype key: str - :keyword value: Value of the key that allow grouping/filtering individual tests. - :paramtype value: str - """ - super().__init__(**kwargs) - self.key = key - self.value = value - - -class Publisher(ProxyResource): - """Publisher details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar provisioning_state: Provisioning State. - :vartype provisioning_state: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provisioning_state = None - - -class PublisherList(_serialization.Model): - """List of Publisher proxy resources for the HCI cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Publisher proxy resources. - :vartype value: list[~azure.mgmt.azurestackhci.models.Publisher] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Publisher]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class QosPolicyOverrides(_serialization.Model): - """The QoSPolicyOverrides of a cluster. - - :ivar priority_value8021_action_cluster: This parameter should only be modified based on your - OEM guidance. Do not modify this parameter without OEM validation. - :vartype priority_value8021_action_cluster: str - :ivar priority_value8021_action_smb: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. - :vartype priority_value8021_action_smb: str - :ivar bandwidth_percentage_smb: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. - :vartype bandwidth_percentage_smb: str - """ - - _attribute_map = { - "priority_value8021_action_cluster": {"key": "priorityValue8021Action_Cluster", "type": "str"}, - "priority_value8021_action_smb": {"key": "priorityValue8021Action_SMB", "type": "str"}, - "bandwidth_percentage_smb": {"key": "bandwidthPercentage_SMB", "type": "str"}, - } - - def __init__( - self, - *, - priority_value8021_action_cluster: Optional[str] = None, - priority_value8021_action_smb: Optional[str] = None, - bandwidth_percentage_smb: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword priority_value8021_action_cluster: This parameter should only be modified based on - your OEM guidance. Do not modify this parameter without OEM validation. - :paramtype priority_value8021_action_cluster: str - :keyword priority_value8021_action_smb: This parameter should only be modified based on your - OEM guidance. Do not modify this parameter without OEM validation. - :paramtype priority_value8021_action_smb: str - :keyword bandwidth_percentage_smb: This parameter should only be modified based on your OEM - guidance. Do not modify this parameter without OEM validation. - :paramtype bandwidth_percentage_smb: str - """ - super().__init__(**kwargs) - self.priority_value8021_action_cluster = priority_value8021_action_cluster - self.priority_value8021_action_smb = priority_value8021_action_smb - self.bandwidth_percentage_smb = bandwidth_percentage_smb - - -class RawCertificateData(_serialization.Model): - """RawCertificateData. - - :ivar certificates: - :vartype certificates: list[str] - """ - - _attribute_map = { - "certificates": {"key": "certificates", "type": "[str]"}, - } - - def __init__(self, *, certificates: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword certificates: - :paramtype certificates: list[str] - """ - super().__init__(**kwargs) - self.certificates = certificates - - -class RemoteSupportNodeSettings(_serialization.Model): - """Remote Support Node Settings of the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar arc_resource_id: Arc ResourceId of the Node. - :vartype arc_resource_id: str - :ivar state: Remote Support Access Connection State on the Node. - :vartype state: str - :ivar created_at: Remote Support Enablement Request Created TimeStamp on the Node. - :vartype created_at: ~datetime.datetime - :ivar updated_at: Remote Support Enablement Request Updated TimeStamp on the Node. - :vartype updated_at: ~datetime.datetime - :ivar connection_status: Remote Support Access Connection Status on the Node. - :vartype connection_status: str - :ivar connection_error_message: Remote Support Access Connection Error Message on the Node. - :vartype connection_error_message: str - :ivar transcript_location: Remote Support Transcript location on the node. - :vartype transcript_location: str - """ - - _validation = { - "arc_resource_id": {"readonly": True}, - "state": {"readonly": True}, - "created_at": {"readonly": True}, - "updated_at": {"readonly": True}, - "connection_status": {"readonly": True}, - "connection_error_message": {"readonly": True}, - "transcript_location": {"readonly": True}, - } - - _attribute_map = { - "arc_resource_id": {"key": "arcResourceId", "type": "str"}, - "state": {"key": "state", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "updated_at": {"key": "updatedAt", "type": "iso-8601"}, - "connection_status": {"key": "connectionStatus", "type": "str"}, - "connection_error_message": {"key": "connectionErrorMessage", "type": "str"}, - "transcript_location": {"key": "transcriptLocation", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.arc_resource_id = None - self.state = None - self.created_at = None - self.updated_at = None - self.connection_status = None - self.connection_error_message = None - self.transcript_location = None - - -class RemoteSupportProperties(_serialization.Model): - """Remote Support properties of the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_level: Remote Support Access Level. Known values are: "Diagnostics" and - "DiagnosticsAndRepair". - :vartype access_level: str or ~azure.mgmt.azurestackhci.models.AccessLevel - :ivar expiration_time_stamp: Expiration DateTimeStamp when Remote Support Access will be - expired. - :vartype expiration_time_stamp: ~datetime.datetime - :ivar remote_support_type: Remote Support Type for cluster. Known values are: "Enable" and - "Revoke". - :vartype remote_support_type: str or ~azure.mgmt.azurestackhci.models.RemoteSupportType - :ivar remote_support_node_settings: - :vartype remote_support_node_settings: - list[~azure.mgmt.azurestackhci.models.RemoteSupportNodeSettings] - :ivar remote_support_session_details: - :vartype remote_support_session_details: - list[~azure.mgmt.azurestackhci.models.PerNodeRemoteSupportSession] - """ - - _validation = { - "access_level": {"readonly": True}, - "expiration_time_stamp": {"readonly": True}, - "remote_support_type": {"readonly": True}, - "remote_support_node_settings": {"readonly": True}, - "remote_support_session_details": {"readonly": True}, - } - - _attribute_map = { - "access_level": {"key": "accessLevel", "type": "str"}, - "expiration_time_stamp": {"key": "expirationTimeStamp", "type": "iso-8601"}, - "remote_support_type": {"key": "remoteSupportType", "type": "str"}, - "remote_support_node_settings": {"key": "remoteSupportNodeSettings", "type": "[RemoteSupportNodeSettings]"}, - "remote_support_session_details": { - "key": "remoteSupportSessionDetails", - "type": "[PerNodeRemoteSupportSession]", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.access_level = None - self.expiration_time_stamp = None - self.remote_support_type = None - self.remote_support_node_settings = None - self.remote_support_session_details = None - - -class RemoteSupportRequest(_serialization.Model): - """Remote Support Request. - - :ivar properties: Properties for Remote Support Request. - :vartype properties: ~azure.mgmt.azurestackhci.models.RemoteSupportRequestProperties - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "RemoteSupportRequestProperties"}, - } - - def __init__(self, *, properties: Optional["_models.RemoteSupportRequestProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Properties for Remote Support Request. - :paramtype properties: ~azure.mgmt.azurestackhci.models.RemoteSupportRequestProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class RemoteSupportRequestProperties(_serialization.Model): - """Properties for Remote Support Request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar access_level: Remote Support Access Level. Known values are: "Diagnostics" and - "DiagnosticsAndRepair". - :vartype access_level: str or ~azure.mgmt.azurestackhci.models.AccessLevel - :ivar expiration_time_stamp: Expiration DateTimeStamp when Remote Support Access will be - expired. - :vartype expiration_time_stamp: ~datetime.datetime - :ivar remote_support_type: Remote Support Type for cluster. Known values are: "Enable" and - "Revoke". - :vartype remote_support_type: str or ~azure.mgmt.azurestackhci.models.RemoteSupportType - """ - - _validation = { - "access_level": {"readonly": True}, - } - - _attribute_map = { - "access_level": {"key": "accessLevel", "type": "str"}, - "expiration_time_stamp": {"key": "expirationTimeStamp", "type": "iso-8601"}, - "remote_support_type": {"key": "remoteSupportType", "type": "str"}, - } - - def __init__( - self, - *, - expiration_time_stamp: Optional[datetime.datetime] = None, - remote_support_type: Optional[Union[str, "_models.RemoteSupportType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword expiration_time_stamp: Expiration DateTimeStamp when Remote Support Access will be - expired. - :paramtype expiration_time_stamp: ~datetime.datetime - :keyword remote_support_type: Remote Support Type for cluster. Known values are: "Enable" and - "Revoke". - :paramtype remote_support_type: str or ~azure.mgmt.azurestackhci.models.RemoteSupportType - """ - super().__init__(**kwargs) - self.access_level = None - self.expiration_time_stamp = expiration_time_stamp - self.remote_support_type = remote_support_type - - -class SbeCredentials(_serialization.Model): - """secrets used for solution builder extension (SBE) partner extensibility. - - :ivar secret_name: secret name stored in keyvault. - :vartype secret_name: str - :ivar ece_secret_name: secret name expected for Enterprise Cloud Engine (ECE). - :vartype ece_secret_name: str - :ivar secret_location: secret URI stored in keyvault. - :vartype secret_location: str - """ - - _attribute_map = { - "secret_name": {"key": "secretName", "type": "str"}, - "ece_secret_name": {"key": "eceSecretName", "type": "str"}, - "secret_location": {"key": "secretLocation", "type": "str"}, - } - - def __init__( - self, - *, - secret_name: Optional[str] = None, - ece_secret_name: Optional[str] = None, - secret_location: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword secret_name: secret name stored in keyvault. - :paramtype secret_name: str - :keyword ece_secret_name: secret name expected for Enterprise Cloud Engine (ECE). - :paramtype ece_secret_name: str - :keyword secret_location: secret URI stored in keyvault. - :paramtype secret_location: str - """ - super().__init__(**kwargs) - self.secret_name = secret_name - self.ece_secret_name = ece_secret_name - self.secret_location = secret_location - - -class SbeDeploymentInfo(_serialization.Model): - """Solution builder extension (SBE) package and manifest information for the solution builder - extension staged for AzureStackHCI cluster deployment. - - :ivar version: SBE package version. - :vartype version: str - :ivar family: SBE family name. - :vartype family: str - :ivar publisher: SBE manifest publisher. - :vartype publisher: str - :ivar sbe_manifest_source: SBE Manifest Source. - :vartype sbe_manifest_source: str - :ivar sbe_manifest_creation_date: SBE Manifest Creation Date. - :vartype sbe_manifest_creation_date: ~datetime.datetime - """ - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "publisher": {"key": "publisher", "type": "str"}, - "sbe_manifest_source": {"key": "sbeManifestSource", "type": "str"}, - "sbe_manifest_creation_date": {"key": "sbeManifestCreationDate", "type": "iso-8601"}, - } - - def __init__( - self, - *, - version: Optional[str] = None, - family: Optional[str] = None, - publisher: Optional[str] = None, - sbe_manifest_source: Optional[str] = None, - sbe_manifest_creation_date: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword version: SBE package version. - :paramtype version: str - :keyword family: SBE family name. - :paramtype family: str - :keyword publisher: SBE manifest publisher. - :paramtype publisher: str - :keyword sbe_manifest_source: SBE Manifest Source. - :paramtype sbe_manifest_source: str - :keyword sbe_manifest_creation_date: SBE Manifest Creation Date. - :paramtype sbe_manifest_creation_date: ~datetime.datetime - """ - super().__init__(**kwargs) - self.version = version - self.family = family - self.publisher = publisher - self.sbe_manifest_source = sbe_manifest_source - self.sbe_manifest_creation_date = sbe_manifest_creation_date - - -class SbeDeploymentPackageInfo(_serialization.Model): - """Solution builder extension (SBE) deployment package information. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: SBE deployment validation code. - :vartype code: str - :ivar message: A detailed message that explains the SBE package validation result. - :vartype message: str - :ivar sbe_manifest: This represents discovered update results for matching updates and store it - as SBE manifest. - :vartype sbe_manifest: str - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "sbe_manifest": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "sbe_manifest": {"key": "sbeManifest", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code = None - self.message = None - self.sbe_manifest = None - - -class SbePartnerInfo(_serialization.Model): - """The solution builder extension (SBE) partner deployment info for cluster. - - :ivar sbe_deployment_info: SBE package and manifest information for the solution Builder - Extension staged for AzureStackHCI cluster deployment. - :vartype sbe_deployment_info: ~azure.mgmt.azurestackhci.models.SbeDeploymentInfo - :ivar partner_properties: List of SBE partner properties for AzureStackHCI cluster deployment. - :vartype partner_properties: list[~azure.mgmt.azurestackhci.models.SbePartnerProperties] - :ivar credential_list: SBE credentials list for AzureStackHCI cluster deployment. - :vartype credential_list: list[~azure.mgmt.azurestackhci.models.SbeCredentials] - """ - - _attribute_map = { - "sbe_deployment_info": {"key": "sbeDeploymentInfo", "type": "SbeDeploymentInfo"}, - "partner_properties": {"key": "partnerProperties", "type": "[SbePartnerProperties]"}, - "credential_list": {"key": "credentialList", "type": "[SbeCredentials]"}, - } - - def __init__( - self, - *, - sbe_deployment_info: Optional["_models.SbeDeploymentInfo"] = None, - partner_properties: Optional[List["_models.SbePartnerProperties"]] = None, - credential_list: Optional[List["_models.SbeCredentials"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword sbe_deployment_info: SBE package and manifest information for the solution Builder - Extension staged for AzureStackHCI cluster deployment. - :paramtype sbe_deployment_info: ~azure.mgmt.azurestackhci.models.SbeDeploymentInfo - :keyword partner_properties: List of SBE partner properties for AzureStackHCI cluster - deployment. - :paramtype partner_properties: list[~azure.mgmt.azurestackhci.models.SbePartnerProperties] - :keyword credential_list: SBE credentials list for AzureStackHCI cluster deployment. - :paramtype credential_list: list[~azure.mgmt.azurestackhci.models.SbeCredentials] - """ - super().__init__(**kwargs) - self.sbe_deployment_info = sbe_deployment_info - self.partner_properties = partner_properties - self.credential_list = credential_list - - -class SbePartnerProperties(_serialization.Model): - """Solution builder extension (SBE) partner properties object. - - :ivar name: SBE partner property name. - :vartype name: str - :ivar value: SBE partner property value. - :vartype value: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: SBE partner property name. - :paramtype name: str - :keyword value: SBE partner property value. - :paramtype value: str - """ - super().__init__(**kwargs) - self.name = name - self.value = value - - -class ScaleUnits(_serialization.Model): - """Scale units will contains list of deployment data. - - All required parameters must be populated in order to send to server. - - :ivar deployment_data: Deployment Data to deploy AzureStackHCI Cluster. Required. - :vartype deployment_data: ~azure.mgmt.azurestackhci.models.DeploymentData - :ivar sbe_partner_info: Solution builder extension (SBE) partner properties. - :vartype sbe_partner_info: ~azure.mgmt.azurestackhci.models.SbePartnerInfo - """ - - _validation = { - "deployment_data": {"required": True}, - } - - _attribute_map = { - "deployment_data": {"key": "deploymentData", "type": "DeploymentData"}, - "sbe_partner_info": {"key": "sbePartnerInfo", "type": "SbePartnerInfo"}, - } - - def __init__( - self, - *, - deployment_data: "_models.DeploymentData", - sbe_partner_info: Optional["_models.SbePartnerInfo"] = None, - **kwargs: Any - ) -> None: - """ - :keyword deployment_data: Deployment Data to deploy AzureStackHCI Cluster. Required. - :paramtype deployment_data: ~azure.mgmt.azurestackhci.models.DeploymentData - :keyword sbe_partner_info: Solution builder extension (SBE) partner properties. - :paramtype sbe_partner_info: ~azure.mgmt.azurestackhci.models.SbePartnerInfo - """ - super().__init__(**kwargs) - self.deployment_data = deployment_data - self.sbe_partner_info = sbe_partner_info - - -class SdnIntegration(_serialization.Model): - """SDN Integration config to deploy AzureStackHCI Cluster. - - :ivar network_controller: network controller config for SDN Integration to deploy AzureStackHCI - Cluster. - :vartype network_controller: ~azure.mgmt.azurestackhci.models.NetworkController - """ - - _attribute_map = { - "network_controller": {"key": "networkController", "type": "NetworkController"}, - } - - def __init__(self, *, network_controller: Optional["_models.NetworkController"] = None, **kwargs: Any) -> None: - """ - :keyword network_controller: network controller config for SDN Integration to deploy - AzureStackHCI Cluster. - :paramtype network_controller: ~azure.mgmt.azurestackhci.models.NetworkController - """ - super().__init__(**kwargs) - self.network_controller = network_controller - - -class SecurityComplianceStatus(_serialization.Model): - """Security compliance properties of the resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar secured_core_compliance: Indicates whether HCI hosts meets secured-core server - requirements. Known values are: "Compliant", "NonCompliant", and "Pending". - :vartype secured_core_compliance: str or ~azure.mgmt.azurestackhci.models.ComplianceStatus - :ivar wdac_compliance: Indicates whether HCI hosts have enforced consistent Windows Defender - Application Control. Known values are: "Compliant", "NonCompliant", and "Pending". - :vartype wdac_compliance: str or ~azure.mgmt.azurestackhci.models.ComplianceStatus - :ivar data_at_rest_encrypted: Indicates whether data at-rest encryption is enabled on Azure - Stack HCI clustered volumes. Known values are: "Compliant", "NonCompliant", and "Pending". - :vartype data_at_rest_encrypted: str or ~azure.mgmt.azurestackhci.models.ComplianceStatus - :ivar data_in_transit_protected: Indicates whether HCI cluster has data in-transit protection. - Known values are: "Compliant", "NonCompliant", and "Pending". - :vartype data_in_transit_protected: str or ~azure.mgmt.azurestackhci.models.ComplianceStatus - :ivar last_updated: Time in UTC when compliance status was last updated. - :vartype last_updated: ~datetime.datetime - """ - - _validation = { - "secured_core_compliance": {"readonly": True}, - "wdac_compliance": {"readonly": True}, - "data_at_rest_encrypted": {"readonly": True}, - "data_in_transit_protected": {"readonly": True}, - "last_updated": {"readonly": True}, - } - - _attribute_map = { - "secured_core_compliance": {"key": "securedCoreCompliance", "type": "str"}, - "wdac_compliance": {"key": "wdacCompliance", "type": "str"}, - "data_at_rest_encrypted": {"key": "dataAtRestEncrypted", "type": "str"}, - "data_in_transit_protected": {"key": "dataInTransitProtected", "type": "str"}, - "last_updated": {"key": "lastUpdated", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.secured_core_compliance = None - self.wdac_compliance = None - self.data_at_rest_encrypted = None - self.data_in_transit_protected = None - self.last_updated = None - - -class SecuritySetting(ProxyResource): - """Security settings proxy resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar secured_core_compliance_assignment: Secured Core Compliance Assignment. Known values are: - "Audit" and "ApplyAndAutoCorrect". - :vartype secured_core_compliance_assignment: str or - ~azure.mgmt.azurestackhci.models.ComplianceAssignmentType - :ivar wdac_compliance_assignment: WDAC Compliance Assignment. Known values are: "Audit" and - "ApplyAndAutoCorrect". - :vartype wdac_compliance_assignment: str or - ~azure.mgmt.azurestackhci.models.ComplianceAssignmentType - :ivar smb_encryption_for_intra_cluster_traffic_compliance_assignment: SMB encryption for - intra-cluster traffic Compliance Assignment. Known values are: "Audit" and - "ApplyAndAutoCorrect". - :vartype smb_encryption_for_intra_cluster_traffic_compliance_assignment: str or - ~azure.mgmt.azurestackhci.models.ComplianceAssignmentType - :ivar security_compliance_status: Security Compliance Status. - :vartype security_compliance_status: ~azure.mgmt.azurestackhci.models.SecurityComplianceStatus - :ivar provisioning_state: The status of the last operation. Known values are: "NotSpecified", - "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", "Deleted", "Creating", - "Updating", "Deleting", "Moving", "PartiallySucceeded", "PartiallyConnected", "InProgress", - "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "security_compliance_status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "secured_core_compliance_assignment": {"key": "properties.securedCoreComplianceAssignment", "type": "str"}, - "wdac_compliance_assignment": {"key": "properties.wdacComplianceAssignment", "type": "str"}, - "smb_encryption_for_intra_cluster_traffic_compliance_assignment": { - "key": "properties.smbEncryptionForIntraClusterTrafficComplianceAssignment", - "type": "str", - }, - "security_compliance_status": { - "key": "properties.securityComplianceStatus", - "type": "SecurityComplianceStatus", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - secured_core_compliance_assignment: Optional[Union[str, "_models.ComplianceAssignmentType"]] = None, - wdac_compliance_assignment: Optional[Union[str, "_models.ComplianceAssignmentType"]] = None, - smb_encryption_for_intra_cluster_traffic_compliance_assignment: Optional[ - Union[str, "_models.ComplianceAssignmentType"] - ] = None, - provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword secured_core_compliance_assignment: Secured Core Compliance Assignment. Known values - are: "Audit" and "ApplyAndAutoCorrect". - :paramtype secured_core_compliance_assignment: str or - ~azure.mgmt.azurestackhci.models.ComplianceAssignmentType - :keyword wdac_compliance_assignment: WDAC Compliance Assignment. Known values are: "Audit" and - "ApplyAndAutoCorrect". - :paramtype wdac_compliance_assignment: str or - ~azure.mgmt.azurestackhci.models.ComplianceAssignmentType - :keyword smb_encryption_for_intra_cluster_traffic_compliance_assignment: SMB encryption for - intra-cluster traffic Compliance Assignment. Known values are: "Audit" and - "ApplyAndAutoCorrect". - :paramtype smb_encryption_for_intra_cluster_traffic_compliance_assignment: str or - ~azure.mgmt.azurestackhci.models.ComplianceAssignmentType - :keyword provisioning_state: The status of the last operation. Known values are: - "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :paramtype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - """ - super().__init__(**kwargs) - self.secured_core_compliance_assignment = secured_core_compliance_assignment - self.wdac_compliance_assignment = wdac_compliance_assignment - self.smb_encryption_for_intra_cluster_traffic_compliance_assignment = ( - smb_encryption_for_intra_cluster_traffic_compliance_assignment - ) - self.security_compliance_status = None - self.provisioning_state = provisioning_state - - -class SecuritySettingListResult(_serialization.Model): - """The response of a SecuritySetting list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The SecuritySetting items on this page. Required. - :vartype value: list[~azure.mgmt.azurestackhci.models.SecuritySetting] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SecuritySetting]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.SecuritySetting"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The SecuritySetting items on this page. Required. - :paramtype value: list[~azure.mgmt.azurestackhci.models.SecuritySetting] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ServiceConfiguration(_serialization.Model): - """Service configuration details. - - All required parameters must be populated in order to send to server. - - :ivar service_name: Name of the service. Required. "WAC" - :vartype service_name: str or ~azure.mgmt.azurestackhci.models.ServiceName - :ivar port: The port on which service is enabled. Required. - :vartype port: int - """ - - _validation = { - "service_name": {"required": True}, - "port": {"required": True}, - } - - _attribute_map = { - "service_name": {"key": "serviceName", "type": "str"}, - "port": {"key": "port", "type": "int"}, - } - - def __init__(self, *, service_name: Union[str, "_models.ServiceName"], port: int, **kwargs: Any) -> None: - """ - :keyword service_name: Name of the service. Required. "WAC" - :paramtype service_name: str or ~azure.mgmt.azurestackhci.models.ServiceName - :keyword port: The port on which service is enabled. Required. - :paramtype port: int - """ - super().__init__(**kwargs) - self.service_name = service_name - self.port = port - - -class Sku(ProxyResource): - """Sku details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar provisioning_state: Provisioning State. - :vartype provisioning_state: str - :ivar publisher_id: Identifier of the Publisher for the offer. - :vartype publisher_id: str - :ivar offer_id: Identifier of the Offer for the sku. - :vartype offer_id: str - :ivar content: JSON serialized catalog content of the sku offer. - :vartype content: str - :ivar content_version: The API version of the catalog service used to serve the catalog - content. - :vartype content_version: str - :ivar sku_mappings: Array of SKU mappings. - :vartype sku_mappings: list[~azure.mgmt.azurestackhci.models.SkuMappings] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "publisher_id": {"key": "properties.publisherId", "type": "str"}, - "offer_id": {"key": "properties.offerId", "type": "str"}, - "content": {"key": "properties.content", "type": "str"}, - "content_version": {"key": "properties.contentVersion", "type": "str"}, - "sku_mappings": {"key": "properties.skuMappings", "type": "[SkuMappings]"}, - } - - def __init__( - self, - *, - publisher_id: Optional[str] = None, - offer_id: Optional[str] = None, - content: Optional[str] = None, - content_version: Optional[str] = None, - sku_mappings: Optional[List["_models.SkuMappings"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword publisher_id: Identifier of the Publisher for the offer. - :paramtype publisher_id: str - :keyword offer_id: Identifier of the Offer for the sku. - :paramtype offer_id: str - :keyword content: JSON serialized catalog content of the sku offer. - :paramtype content: str - :keyword content_version: The API version of the catalog service used to serve the catalog - content. - :paramtype content_version: str - :keyword sku_mappings: Array of SKU mappings. - :paramtype sku_mappings: list[~azure.mgmt.azurestackhci.models.SkuMappings] - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.publisher_id = publisher_id - self.offer_id = offer_id - self.content = content - self.content_version = content_version - self.sku_mappings = sku_mappings - - -class SkuList(_serialization.Model): - """List of SKU proxy resources for the HCI cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of SKU proxy resources. - :vartype value: list[~azure.mgmt.azurestackhci.models.Sku] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Sku]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class SkuMappings(_serialization.Model): - """SKU Mapping details. - - :ivar catalog_plan_id: Identifier of the CatalogPlan for the sku. - :vartype catalog_plan_id: str - :ivar marketplace_sku_id: Identifier for the sku. - :vartype marketplace_sku_id: str - :ivar marketplace_sku_versions: Array of SKU versions available. - :vartype marketplace_sku_versions: list[str] - """ - - _attribute_map = { - "catalog_plan_id": {"key": "catalogPlanId", "type": "str"}, - "marketplace_sku_id": {"key": "marketplaceSkuId", "type": "str"}, - "marketplace_sku_versions": {"key": "marketplaceSkuVersions", "type": "[str]"}, - } - - def __init__( - self, - *, - catalog_plan_id: Optional[str] = None, - marketplace_sku_id: Optional[str] = None, - marketplace_sku_versions: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword catalog_plan_id: Identifier of the CatalogPlan for the sku. - :paramtype catalog_plan_id: str - :keyword marketplace_sku_id: Identifier for the sku. - :paramtype marketplace_sku_id: str - :keyword marketplace_sku_versions: Array of SKU versions available. - :paramtype marketplace_sku_versions: list[str] - """ - super().__init__(**kwargs) - self.catalog_plan_id = catalog_plan_id - self.marketplace_sku_id = marketplace_sku_id - self.marketplace_sku_versions = marketplace_sku_versions - - -class SoftwareAssuranceChangeRequest(_serialization.Model): - """SoftwareAssuranceChangeRequest. - - :ivar properties: - :vartype properties: ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequestProperties - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "SoftwareAssuranceChangeRequestProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.SoftwareAssuranceChangeRequestProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequestProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class SoftwareAssuranceChangeRequestProperties(_serialization.Model): - """SoftwareAssuranceChangeRequestProperties. - - :ivar software_assurance_intent: Customer Intent for Software Assurance Benefit. Known values - are: "Enable" and "Disable". - :vartype software_assurance_intent: str or - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceIntent - """ - - _attribute_map = { - "software_assurance_intent": {"key": "softwareAssuranceIntent", "type": "str"}, - } - - def __init__( - self, - *, - software_assurance_intent: Optional[Union[str, "_models.SoftwareAssuranceIntent"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword software_assurance_intent: Customer Intent for Software Assurance Benefit. Known - values are: "Enable" and "Disable". - :paramtype software_assurance_intent: str or - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceIntent - """ - super().__init__(**kwargs) - self.software_assurance_intent = software_assurance_intent - - -class SoftwareAssuranceProperties(_serialization.Model): - """Software Assurance properties of the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar software_assurance_status: Status of the Software Assurance for the cluster. Known values - are: "Enabled" and "Disabled". - :vartype software_assurance_status: str or - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceStatus - :ivar software_assurance_intent: Customer Intent for Software Assurance Benefit. Known values - are: "Enable" and "Disable". - :vartype software_assurance_intent: str or - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceIntent - :ivar last_updated: TimeStamp denoting the latest SA benefit applicability is validated. - :vartype last_updated: ~datetime.datetime - """ - - _validation = { - "software_assurance_status": {"readonly": True}, - "last_updated": {"readonly": True}, - } - - _attribute_map = { - "software_assurance_status": {"key": "softwareAssuranceStatus", "type": "str"}, - "software_assurance_intent": {"key": "softwareAssuranceIntent", "type": "str"}, - "last_updated": {"key": "lastUpdated", "type": "iso-8601"}, - } - - def __init__( - self, - *, - software_assurance_intent: Optional[Union[str, "_models.SoftwareAssuranceIntent"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword software_assurance_intent: Customer Intent for Software Assurance Benefit. Known - values are: "Enable" and "Disable". - :paramtype software_assurance_intent: str or - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceIntent - """ - super().__init__(**kwargs) - self.software_assurance_status = None - self.software_assurance_intent = software_assurance_intent - self.last_updated = None - - -class Step(_serialization.Model): - """Progress representation of the update run steps. - - :ivar name: Name of the step. - :vartype name: str - :ivar description: More detailed description of the step. - :vartype description: str - :ivar error_message: Error message, specified if the step is in a failed state. - :vartype error_message: str - :ivar status: Status of the step, bubbled up from the ECE action plan for installation - attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. - :vartype status: str - :ivar start_time_utc: When the step started, or empty if it has not started executing. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: When the step reached a terminal state. - :vartype end_time_utc: ~datetime.datetime - :ivar last_updated_time_utc: Completion time of this step or the last completed sub-step. - :vartype last_updated_time_utc: ~datetime.datetime - :ivar expected_execution_time: Expected execution time of a given step. This is optionally - authored in the update action plan and can be empty. - :vartype expected_execution_time: str - :ivar steps: Recursive model for child steps of this step. - :vartype steps: list[~azure.mgmt.azurestackhci.models.Step] - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "error_message": {"key": "errorMessage", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "start_time_utc": {"key": "startTimeUtc", "type": "iso-8601"}, - "end_time_utc": {"key": "endTimeUtc", "type": "iso-8601"}, - "last_updated_time_utc": {"key": "lastUpdatedTimeUtc", "type": "iso-8601"}, - "expected_execution_time": {"key": "expectedExecutionTime", "type": "str"}, - "steps": {"key": "steps", "type": "[Step]"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - description: Optional[str] = None, - error_message: Optional[str] = None, - status: Optional[str] = None, - start_time_utc: Optional[datetime.datetime] = None, - end_time_utc: Optional[datetime.datetime] = None, - last_updated_time_utc: Optional[datetime.datetime] = None, - expected_execution_time: Optional[str] = None, - steps: Optional[List["_models.Step"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the step. - :paramtype name: str - :keyword description: More detailed description of the step. - :paramtype description: str - :keyword error_message: Error message, specified if the step is in a failed state. - :paramtype error_message: str - :keyword status: Status of the step, bubbled up from the ECE action plan for installation - attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. - :paramtype status: str - :keyword start_time_utc: When the step started, or empty if it has not started executing. - :paramtype start_time_utc: ~datetime.datetime - :keyword end_time_utc: When the step reached a terminal state. - :paramtype end_time_utc: ~datetime.datetime - :keyword last_updated_time_utc: Completion time of this step or the last completed sub-step. - :paramtype last_updated_time_utc: ~datetime.datetime - :keyword expected_execution_time: Expected execution time of a given step. This is optionally - authored in the update action plan and can be empty. - :paramtype expected_execution_time: str - :keyword steps: Recursive model for child steps of this step. - :paramtype steps: list[~azure.mgmt.azurestackhci.models.Step] - """ - super().__init__(**kwargs) - self.name = name - self.description = description - self.error_message = error_message - self.status = status - self.start_time_utc = start_time_utc - self.end_time_utc = end_time_utc - self.last_updated_time_utc = last_updated_time_utc - self.expected_execution_time = expected_execution_time - self.steps = steps - - -class Storage(_serialization.Model): - """The Storage config of AzureStackHCI Cluster. - - :ivar configuration_mode: By default, this mode is set to Express and your storage is - configured as per best practices based on the number of nodes in the cluster. Allowed values - are 'Express','InfraOnly', 'KeepStorage'. - :vartype configuration_mode: str - """ - - _attribute_map = { - "configuration_mode": {"key": "configurationMode", "type": "str"}, - } - - def __init__(self, *, configuration_mode: str = "Express", **kwargs: Any) -> None: - """ - :keyword configuration_mode: By default, this mode is set to Express and your storage is - configured as per best practices based on the number of nodes in the cluster. Allowed values - are 'Express','InfraOnly', 'KeepStorage'. - :paramtype configuration_mode: str - """ - super().__init__(**kwargs) - self.configuration_mode = configuration_mode - - -class SwitchDetail(_serialization.Model): - """List of switch details for edge device. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar switch_name: The name of the switch. - :vartype switch_name: str - :ivar switch_type: The type of the switch. e.g. external, internal. - :vartype switch_type: str - :ivar extensions: This represents extensions installed on virtualSwitch. - :vartype extensions: list[~azure.mgmt.azurestackhci.models.SwitchExtension] - """ - - _validation = { - "switch_name": {"readonly": True}, - "switch_type": {"readonly": True}, - "extensions": {"readonly": True}, - } - - _attribute_map = { - "switch_name": {"key": "switchName", "type": "str"}, - "switch_type": {"key": "switchType", "type": "str"}, - "extensions": {"key": "extensions", "type": "[SwitchExtension]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.switch_name = None - self.switch_type = None - self.extensions = None - - -class SwitchExtension(_serialization.Model): - """This represents extensions installed on virtualSwitch. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar switch_id: Unique identifier for virtualSwitch. - :vartype switch_id: str - :ivar extension_name: This will show extension name for virtualSwitch. - :vartype extension_name: str - :ivar extension_enabled: This represents whether extension is enabled on virtualSwitch. - :vartype extension_enabled: bool - """ - - _validation = { - "switch_id": {"readonly": True}, - "extension_name": {"readonly": True}, - "extension_enabled": {"readonly": True}, - } - - _attribute_map = { - "switch_id": {"key": "switchId", "type": "str"}, - "extension_name": {"key": "extensionName", "type": "str"}, - "extension_enabled": {"key": "extensionEnabled", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.switch_id = None - self.extension_name = None - self.extension_enabled = None - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or ~azure.mgmt.azurestackhci.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class Update(ProxyResource): # pylint: disable=too-many-instance-attributes - """Update details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: Provisioning state of the Updates proxy resource. Known values are: - "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar installed_date: Date that the update was installed. - :vartype installed_date: ~datetime.datetime - :ivar description: Description of the update. - :vartype description: str - :ivar min_sbe_version_required: Minimum Sbe Version of the update. - :vartype min_sbe_version_required: str - :ivar state: State of the update as it relates to this stamp. Known values are: - "HasPrerequisite", "Obsolete", "Ready", "NotApplicableBecauseAnotherUpdateIsInProgress", - "Preparing", "Installing", "Installed", "PreparationFailed", "InstallationFailed", "Invalid", - "Recalled", "Downloading", "DownloadFailed", "HealthChecking", "HealthCheckFailed", - "ReadyToInstall", "ScanInProgress", "ScanFailed", and "AdditionalContentRequired". - :vartype state: str or ~azure.mgmt.azurestackhci.models.State - :ivar prerequisites: If update State is HasPrerequisite, this property contains an array of - objects describing prerequisite updates before installing this update. Otherwise, it is empty. - :vartype prerequisites: list[~azure.mgmt.azurestackhci.models.UpdatePrerequisite] - :ivar component_versions: An array of component versions for a Solution Bundle update, and an - empty array otherwise. - :vartype component_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] - :ivar reboot_required: Known values are: "Unknown", "True", and "False". - :vartype reboot_required: str or ~azure.mgmt.azurestackhci.models.RebootRequirement - :ivar health_state: Overall health state for update-specific health checks. Known values are: - "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". - :vartype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState - :ivar health_check_result: An array of PrecheckResult objects. - :vartype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] - :ivar health_check_date: Last time the package-specific checks were run. - :vartype health_check_date: ~datetime.datetime - :ivar package_path: Path where the update package is available. - :vartype package_path: str - :ivar package_size_in_mb: Size of the package. This value is a combination of the size from - update metadata and size of the payload that results from the live scan operation for OS update - content. - :vartype package_size_in_mb: float - :ivar display_name: Display name of the Update. - :vartype display_name: str - :ivar version: Version of the update. - :vartype version: str - :ivar publisher: Publisher of the update package. - :vartype publisher: str - :ivar release_link: Link to release notes for the update. - :vartype release_link: str - :ivar availability_type: Indicates the way the update content can be downloaded. Known values - are: "Local", "Online", and "Notify". - :vartype availability_type: str or ~azure.mgmt.azurestackhci.models.AvailabilityType - :ivar package_type: Customer-visible type of the update. - :vartype package_type: str - :ivar additional_properties: Extensible KV pairs serialized as a string. This is currently used - to report the stamp OEM family and hardware model information when an update is flagged as - Invalid for the stamp based on OEM type. - :vartype additional_properties: str - :ivar progress_percentage: Progress percentage of ongoing operation. Currently this property is - only valid when the update is in the Downloading state, where it maps to how much of the update - content has been downloaded. - :vartype progress_percentage: float - :ivar notify_message: Brief message with instructions for updates of AvailabilityType Notify. - :vartype notify_message: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "location": {"key": "location", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "installed_date": {"key": "properties.installedDate", "type": "iso-8601"}, - "description": {"key": "properties.description", "type": "str"}, - "min_sbe_version_required": {"key": "properties.minSbeVersionRequired", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "prerequisites": {"key": "properties.prerequisites", "type": "[UpdatePrerequisite]"}, - "component_versions": {"key": "properties.componentVersions", "type": "[PackageVersionInfo]"}, - "reboot_required": {"key": "properties.rebootRequired", "type": "str"}, - "health_state": {"key": "properties.healthState", "type": "str"}, - "health_check_result": {"key": "properties.healthCheckResult", "type": "[PrecheckResult]"}, - "health_check_date": {"key": "properties.healthCheckDate", "type": "iso-8601"}, - "package_path": {"key": "properties.packagePath", "type": "str"}, - "package_size_in_mb": {"key": "properties.packageSizeInMb", "type": "float"}, - "display_name": {"key": "properties.displayName", "type": "str"}, - "version": {"key": "properties.version", "type": "str"}, - "publisher": {"key": "properties.publisher", "type": "str"}, - "release_link": {"key": "properties.releaseLink", "type": "str"}, - "availability_type": {"key": "properties.availabilityType", "type": "str"}, - "package_type": {"key": "properties.packageType", "type": "str"}, - "additional_properties": {"key": "properties.additionalProperties", "type": "str"}, - "progress_percentage": {"key": "properties.updateStateProperties.progressPercentage", "type": "float"}, - "notify_message": {"key": "properties.updateStateProperties.notifyMessage", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: Optional[str] = None, - installed_date: Optional[datetime.datetime] = None, - description: Optional[str] = None, - min_sbe_version_required: Optional[str] = None, - state: Optional[Union[str, "_models.State"]] = None, - prerequisites: Optional[List["_models.UpdatePrerequisite"]] = None, - component_versions: Optional[List["_models.PackageVersionInfo"]] = None, - reboot_required: Optional[Union[str, "_models.RebootRequirement"]] = None, - health_state: Optional[Union[str, "_models.HealthState"]] = None, - health_check_result: Optional[List["_models.PrecheckResult"]] = None, - health_check_date: Optional[datetime.datetime] = None, - package_path: Optional[str] = None, - package_size_in_mb: Optional[float] = None, - display_name: Optional[str] = None, - version: Optional[str] = None, - publisher: Optional[str] = None, - release_link: Optional[str] = None, - availability_type: Optional[Union[str, "_models.AvailabilityType"]] = None, - package_type: Optional[str] = None, - additional_properties: Optional[str] = None, - progress_percentage: Optional[float] = None, - notify_message: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword installed_date: Date that the update was installed. - :paramtype installed_date: ~datetime.datetime - :keyword description: Description of the update. - :paramtype description: str - :keyword min_sbe_version_required: Minimum Sbe Version of the update. - :paramtype min_sbe_version_required: str - :keyword state: State of the update as it relates to this stamp. Known values are: - "HasPrerequisite", "Obsolete", "Ready", "NotApplicableBecauseAnotherUpdateIsInProgress", - "Preparing", "Installing", "Installed", "PreparationFailed", "InstallationFailed", "Invalid", - "Recalled", "Downloading", "DownloadFailed", "HealthChecking", "HealthCheckFailed", - "ReadyToInstall", "ScanInProgress", "ScanFailed", and "AdditionalContentRequired". - :paramtype state: str or ~azure.mgmt.azurestackhci.models.State - :keyword prerequisites: If update State is HasPrerequisite, this property contains an array of - objects describing prerequisite updates before installing this update. Otherwise, it is empty. - :paramtype prerequisites: list[~azure.mgmt.azurestackhci.models.UpdatePrerequisite] - :keyword component_versions: An array of component versions for a Solution Bundle update, and - an empty array otherwise. - :paramtype component_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] - :keyword reboot_required: Known values are: "Unknown", "True", and "False". - :paramtype reboot_required: str or ~azure.mgmt.azurestackhci.models.RebootRequirement - :keyword health_state: Overall health state for update-specific health checks. Known values - are: "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". - :paramtype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState - :keyword health_check_result: An array of PrecheckResult objects. - :paramtype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] - :keyword health_check_date: Last time the package-specific checks were run. - :paramtype health_check_date: ~datetime.datetime - :keyword package_path: Path where the update package is available. - :paramtype package_path: str - :keyword package_size_in_mb: Size of the package. This value is a combination of the size from - update metadata and size of the payload that results from the live scan operation for OS update - content. - :paramtype package_size_in_mb: float - :keyword display_name: Display name of the Update. - :paramtype display_name: str - :keyword version: Version of the update. - :paramtype version: str - :keyword publisher: Publisher of the update package. - :paramtype publisher: str - :keyword release_link: Link to release notes for the update. - :paramtype release_link: str - :keyword availability_type: Indicates the way the update content can be downloaded. Known - values are: "Local", "Online", and "Notify". - :paramtype availability_type: str or ~azure.mgmt.azurestackhci.models.AvailabilityType - :keyword package_type: Customer-visible type of the update. - :paramtype package_type: str - :keyword additional_properties: Extensible KV pairs serialized as a string. This is currently - used to report the stamp OEM family and hardware model information when an update is flagged as - Invalid for the stamp based on OEM type. - :paramtype additional_properties: str - :keyword progress_percentage: Progress percentage of ongoing operation. Currently this property - is only valid when the update is in the Downloading state, where it maps to how much of the - update content has been downloaded. - :paramtype progress_percentage: float - :keyword notify_message: Brief message with instructions for updates of AvailabilityType - Notify. - :paramtype notify_message: str - """ - super().__init__(**kwargs) - self.location = location - self.provisioning_state = None - self.installed_date = installed_date - self.description = description - self.min_sbe_version_required = min_sbe_version_required - self.state = state - self.prerequisites = prerequisites - self.component_versions = component_versions - self.reboot_required = reboot_required - self.health_state = health_state - self.health_check_result = health_check_result - self.health_check_date = health_check_date - self.package_path = package_path - self.package_size_in_mb = package_size_in_mb - self.display_name = display_name - self.version = version - self.publisher = publisher - self.release_link = release_link - self.availability_type = availability_type - self.package_type = package_type - self.additional_properties = additional_properties - self.progress_percentage = progress_percentage - self.notify_message = notify_message - - -class UpdateList(_serialization.Model): - """List of Updates. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Updates. - :vartype value: list[~azure.mgmt.azurestackhci.models.Update] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Update]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.Update"]] = None, **kwargs: Any) -> None: - """ - :keyword value: List of Updates. - :paramtype value: list[~azure.mgmt.azurestackhci.models.Update] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class UpdatePrerequisite(_serialization.Model): - """If update State is HasPrerequisite, this property contains an array of objects describing - prerequisite updates before installing this update. Otherwise, it is empty. - - :ivar update_type: Updatable component type. - :vartype update_type: str - :ivar version: Version of the prerequisite. - :vartype version: str - :ivar package_name: Friendly name of the prerequisite. - :vartype package_name: str - """ - - _attribute_map = { - "update_type": {"key": "updateType", "type": "str"}, - "version": {"key": "version", "type": "str"}, - "package_name": {"key": "packageName", "type": "str"}, - } - - def __init__( - self, - *, - update_type: Optional[str] = None, - version: Optional[str] = None, - package_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword update_type: Updatable component type. - :paramtype update_type: str - :keyword version: Version of the prerequisite. - :paramtype version: str - :keyword package_name: Friendly name of the prerequisite. - :paramtype package_name: str - """ - super().__init__(**kwargs) - self.update_type = update_type - self.version = version - self.package_name = package_name - - -class UpdateRun(ProxyResource): # pylint: disable=too-many-instance-attributes - """Details of an Update run. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: Provisioning state of the UpdateRuns proxy resource. Known values - are: "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", "Disconnected", - "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar time_started: Timestamp of the update run was started. - :vartype time_started: ~datetime.datetime - :ivar last_updated_time: Timestamp of the most recently completed step in the update run. - :vartype last_updated_time: ~datetime.datetime - :ivar duration: Duration of the update run. - :vartype duration: str - :ivar state: State of the update run. Known values are: "Unknown", "Succeeded", "InProgress", - and "Failed". - :vartype state: str or ~azure.mgmt.azurestackhci.models.UpdateRunPropertiesState - :ivar name_properties_progress_name: Name of the step. - :vartype name_properties_progress_name: str - :ivar description: More detailed description of the step. - :vartype description: str - :ivar error_message: Error message, specified if the step is in a failed state. - :vartype error_message: str - :ivar status: Status of the step, bubbled up from the ECE action plan for installation - attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. - :vartype status: str - :ivar start_time_utc: When the step started, or empty if it has not started executing. - :vartype start_time_utc: ~datetime.datetime - :ivar end_time_utc: When the step reached a terminal state. - :vartype end_time_utc: ~datetime.datetime - :ivar last_updated_time_utc: Completion time of this step or the last completed sub-step. - :vartype last_updated_time_utc: ~datetime.datetime - :ivar expected_execution_time: Expected execution time of a given step. This is optionally - authored in the update action plan and can be empty. - :vartype expected_execution_time: str - :ivar steps: Recursive model for child steps of this step. - :vartype steps: list[~azure.mgmt.azurestackhci.models.Step] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "location": {"key": "location", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "time_started": {"key": "properties.timeStarted", "type": "iso-8601"}, - "last_updated_time": {"key": "properties.lastUpdatedTime", "type": "iso-8601"}, - "duration": {"key": "properties.duration", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "name_properties_progress_name": {"key": "properties.progress.name", "type": "str"}, - "description": {"key": "properties.progress.description", "type": "str"}, - "error_message": {"key": "properties.progress.errorMessage", "type": "str"}, - "status": {"key": "properties.progress.status", "type": "str"}, - "start_time_utc": {"key": "properties.progress.startTimeUtc", "type": "iso-8601"}, - "end_time_utc": {"key": "properties.progress.endTimeUtc", "type": "iso-8601"}, - "last_updated_time_utc": {"key": "properties.progress.lastUpdatedTimeUtc", "type": "iso-8601"}, - "expected_execution_time": {"key": "properties.progress.expectedExecutionTime", "type": "str"}, - "steps": {"key": "properties.progress.steps", "type": "[Step]"}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - time_started: Optional[datetime.datetime] = None, - last_updated_time: Optional[datetime.datetime] = None, - duration: Optional[str] = None, - state: Optional[Union[str, "_models.UpdateRunPropertiesState"]] = None, - name_properties_progress_name: Optional[str] = None, - description: Optional[str] = None, - error_message: Optional[str] = None, - status: Optional[str] = None, - start_time_utc: Optional[datetime.datetime] = None, - end_time_utc: Optional[datetime.datetime] = None, - last_updated_time_utc: Optional[datetime.datetime] = None, - expected_execution_time: Optional[str] = None, - steps: Optional[List["_models.Step"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword time_started: Timestamp of the update run was started. - :paramtype time_started: ~datetime.datetime - :keyword last_updated_time: Timestamp of the most recently completed step in the update run. - :paramtype last_updated_time: ~datetime.datetime - :keyword duration: Duration of the update run. - :paramtype duration: str - :keyword state: State of the update run. Known values are: "Unknown", "Succeeded", - "InProgress", and "Failed". - :paramtype state: str or ~azure.mgmt.azurestackhci.models.UpdateRunPropertiesState - :keyword name_properties_progress_name: Name of the step. - :paramtype name_properties_progress_name: str - :keyword description: More detailed description of the step. - :paramtype description: str - :keyword error_message: Error message, specified if the step is in a failed state. - :paramtype error_message: str - :keyword status: Status of the step, bubbled up from the ECE action plan for installation - attempts. Values are: 'Success', 'Error', 'InProgress', and 'Unknown status'. - :paramtype status: str - :keyword start_time_utc: When the step started, or empty if it has not started executing. - :paramtype start_time_utc: ~datetime.datetime - :keyword end_time_utc: When the step reached a terminal state. - :paramtype end_time_utc: ~datetime.datetime - :keyword last_updated_time_utc: Completion time of this step or the last completed sub-step. - :paramtype last_updated_time_utc: ~datetime.datetime - :keyword expected_execution_time: Expected execution time of a given step. This is optionally - authored in the update action plan and can be empty. - :paramtype expected_execution_time: str - :keyword steps: Recursive model for child steps of this step. - :paramtype steps: list[~azure.mgmt.azurestackhci.models.Step] - """ - super().__init__(**kwargs) - self.location = location - self.provisioning_state = None - self.time_started = time_started - self.last_updated_time = last_updated_time - self.duration = duration - self.state = state - self.name_properties_progress_name = name_properties_progress_name - self.description = description - self.error_message = error_message - self.status = status - self.start_time_utc = start_time_utc - self.end_time_utc = end_time_utc - self.last_updated_time_utc = last_updated_time_utc - self.expected_execution_time = expected_execution_time - self.steps = steps - - -class UpdateRunList(_serialization.Model): - """List of Update runs. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Update runs. - :vartype value: list[~azure.mgmt.azurestackhci.models.UpdateRun] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[UpdateRun]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.UpdateRun"]] = None, **kwargs: Any) -> None: - """ - :keyword value: List of Update runs. - :paramtype value: list[~azure.mgmt.azurestackhci.models.UpdateRun] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class UpdateSummaries(ProxyResource): # pylint: disable=too-many-instance-attributes - """Get the update summaries for the cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: Provisioning state of the UpdateSummaries proxy resource. Known - values are: "NotSpecified", "Error", "Succeeded", "Failed", "Canceled", "Connected", - "Disconnected", "Deleted", "Creating", "Updating", "Deleting", "Moving", "PartiallySucceeded", - "PartiallyConnected", "InProgress", "Accepted", "Provisioning", and "DisableInProgress". - :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState - :ivar oem_family: OEM family name. - :vartype oem_family: str - :ivar current_oem_version: Current OEM Version. - :vartype current_oem_version: str - :ivar hardware_model: Name of the hardware model. - :vartype hardware_model: str - :ivar package_versions: Current version of each updatable component. - :vartype package_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] - :ivar current_version: Current Solution Bundle version of the stamp. - :vartype current_version: str - :ivar current_sbe_version: Current Sbe version of the stamp. - :vartype current_sbe_version: str - :ivar last_updated: Last time an update installation completed successfully. - :vartype last_updated: ~datetime.datetime - :ivar last_checked: Last time the update service successfully checked for updates. - :vartype last_checked: ~datetime.datetime - :ivar health_state: Overall health state for update-specific health checks. Known values are: - "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". - :vartype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState - :ivar health_check_result: An array of pre-check result objects. - :vartype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] - :ivar health_check_date: Last time the package-specific checks were run. - :vartype health_check_date: ~datetime.datetime - :ivar state: Overall update state of the stamp. Known values are: "Unknown", - "AppliedSuccessfully", "UpdateAvailable", "UpdateInProgress", "UpdateFailed", "NeedsAttention", - "PreparationInProgress", and "PreparationFailed". - :vartype state: str or ~azure.mgmt.azurestackhci.models.UpdateSummariesPropertiesState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "location": {"key": "location", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "oem_family": {"key": "properties.oemFamily", "type": "str"}, - "current_oem_version": {"key": "properties.currentOemVersion", "type": "str"}, - "hardware_model": {"key": "properties.hardwareModel", "type": "str"}, - "package_versions": {"key": "properties.packageVersions", "type": "[PackageVersionInfo]"}, - "current_version": {"key": "properties.currentVersion", "type": "str"}, - "current_sbe_version": {"key": "properties.currentSbeVersion", "type": "str"}, - "last_updated": {"key": "properties.lastUpdated", "type": "iso-8601"}, - "last_checked": {"key": "properties.lastChecked", "type": "iso-8601"}, - "health_state": {"key": "properties.healthState", "type": "str"}, - "health_check_result": {"key": "properties.healthCheckResult", "type": "[PrecheckResult]"}, - "health_check_date": {"key": "properties.healthCheckDate", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - oem_family: Optional[str] = None, - current_oem_version: Optional[str] = None, - hardware_model: Optional[str] = None, - package_versions: Optional[List["_models.PackageVersionInfo"]] = None, - current_version: Optional[str] = None, - current_sbe_version: Optional[str] = None, - last_updated: Optional[datetime.datetime] = None, - last_checked: Optional[datetime.datetime] = None, - health_state: Optional[Union[str, "_models.HealthState"]] = None, - health_check_result: Optional[List["_models.PrecheckResult"]] = None, - health_check_date: Optional[datetime.datetime] = None, - state: Optional[Union[str, "_models.UpdateSummariesPropertiesState"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The geo-location where the resource lives. - :paramtype location: str - :keyword oem_family: OEM family name. - :paramtype oem_family: str - :keyword current_oem_version: Current OEM Version. - :paramtype current_oem_version: str - :keyword hardware_model: Name of the hardware model. - :paramtype hardware_model: str - :keyword package_versions: Current version of each updatable component. - :paramtype package_versions: list[~azure.mgmt.azurestackhci.models.PackageVersionInfo] - :keyword current_version: Current Solution Bundle version of the stamp. - :paramtype current_version: str - :keyword current_sbe_version: Current Sbe version of the stamp. - :paramtype current_sbe_version: str - :keyword last_updated: Last time an update installation completed successfully. - :paramtype last_updated: ~datetime.datetime - :keyword last_checked: Last time the update service successfully checked for updates. - :paramtype last_checked: ~datetime.datetime - :keyword health_state: Overall health state for update-specific health checks. Known values - are: "Unknown", "Success", "Failure", "Warning", "Error", and "InProgress". - :paramtype health_state: str or ~azure.mgmt.azurestackhci.models.HealthState - :keyword health_check_result: An array of pre-check result objects. - :paramtype health_check_result: list[~azure.mgmt.azurestackhci.models.PrecheckResult] - :keyword health_check_date: Last time the package-specific checks were run. - :paramtype health_check_date: ~datetime.datetime - :keyword state: Overall update state of the stamp. Known values are: "Unknown", - "AppliedSuccessfully", "UpdateAvailable", "UpdateInProgress", "UpdateFailed", "NeedsAttention", - "PreparationInProgress", and "PreparationFailed". - :paramtype state: str or ~azure.mgmt.azurestackhci.models.UpdateSummariesPropertiesState - """ - super().__init__(**kwargs) - self.location = location - self.provisioning_state = None - self.oem_family = oem_family - self.current_oem_version = current_oem_version - self.hardware_model = hardware_model - self.package_versions = package_versions - self.current_version = current_version - self.current_sbe_version = current_sbe_version - self.last_updated = last_updated - self.last_checked = last_checked - self.health_state = health_state - self.health_check_result = health_check_result - self.health_check_date = health_check_date - self.state = state - - -class UpdateSummariesList(_serialization.Model): - """List of Update Summaries. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Update Summaries. - :vartype value: list[~azure.mgmt.azurestackhci.models.UpdateSummaries] - :ivar next_link: Link to the next set of results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[UpdateSummaries]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[List["_models.UpdateSummaries"]] = None, **kwargs: Any) -> None: - """ - :keyword value: List of Update Summaries. - :paramtype value: list[~azure.mgmt.azurestackhci.models.UpdateSummaries] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class UploadCertificateRequest(_serialization.Model): - """UploadCertificateRequest. - - :ivar properties: - :vartype properties: ~azure.mgmt.azurestackhci.models.RawCertificateData - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "RawCertificateData"}, - } - - def __init__(self, *, properties: Optional["_models.RawCertificateData"] = None, **kwargs: Any) -> None: - """ - :keyword properties: - :paramtype properties: ~azure.mgmt.azurestackhci.models.RawCertificateData - """ - super().__init__(**kwargs) - self.properties = properties - - -class UserAssignedIdentity(_serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class ValidateRequest(_serialization.Model): - """The validate request for Edge Device. - - All required parameters must be populated in order to send to server. - - :ivar edge_device_ids: Node Ids against which, current node has to be validated. Required. - :vartype edge_device_ids: list[str] - :ivar additional_info: Additional info required for validation. - :vartype additional_info: str - """ - - _validation = { - "edge_device_ids": {"required": True}, - } - - _attribute_map = { - "edge_device_ids": {"key": "edgeDeviceIds", "type": "[str]"}, - "additional_info": {"key": "additionalInfo", "type": "str"}, - } - - def __init__(self, *, edge_device_ids: List[str], additional_info: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword edge_device_ids: Node Ids against which, current node has to be validated. Required. - :paramtype edge_device_ids: list[str] - :keyword additional_info: Additional info required for validation. - :paramtype additional_info: str - """ - super().__init__(**kwargs) - self.edge_device_ids = edge_device_ids - self.additional_info = additional_info - - -class ValidateResponse(_serialization.Model): - """An Accepted response with an Operation-Location header. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: edge device validation status. - :vartype status: str - """ - - _validation = { - "status": {"readonly": True}, - } - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.status = None diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/models/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py index 0cfd35e48b6b..97db2a0489f3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/__init__.py @@ -2,42 +2,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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._arc_settings_operations import ArcSettingsOperations -from ._clusters_operations import ClustersOperations -from ._deployment_settings_operations import DeploymentSettingsOperations -from ._edge_devices_operations import EdgeDevicesOperations -from ._extensions_operations import ExtensionsOperations -from ._offers_operations import OffersOperations -from ._operations import Operations -from ._publishers_operations import PublishersOperations -from ._security_settings_operations import SecuritySettingsOperations -from ._skus_operations import SkusOperations -from ._update_runs_operations import UpdateRunsOperations -from ._update_summaries_operations import UpdateSummariesOperations -from ._updates_operations import UpdatesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import KubernetesVersionsOperations # type: ignore +from ._operations import PlatformUpdatesOperations # type: ignore +from ._operations import OsImagesOperations # type: ignore +from ._operations import UpdateContentsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._operations import ArcSettingsOperations # type: ignore +from ._operations import OffersOperations # type: ignore +from ._operations import ClustersOperations # type: ignore +from ._operations import DeploymentSettingsOperations # type: ignore +from ._operations import EdgeDeviceJobsOperations # type: ignore +from ._operations import EdgeDevicesOperations # type: ignore +from ._operations import ExtensionsOperations # type: ignore +from ._operations import PublishersOperations # type: ignore +from ._operations import SecuritySettingsOperations # type: ignore +from ._operations import SkusOperations # type: ignore +from ._operations import UpdateRunsOperations # type: ignore +from ._operations import UpdatesOperations # type: ignore +from ._operations import ValidatedSolutionRecipesOperations # type: ignore +from ._operations import EdgeMachinesOperations # type: ignore +from ._operations import EdgeMachineJobsOperations # type: ignore +from ._operations import OwnershipVouchersOperations # type: ignore +from ._operations import UpdateSummariesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "KubernetesVersionsOperations", + "PlatformUpdatesOperations", + "OsImagesOperations", + "UpdateContentsOperations", + "Operations", "ArcSettingsOperations", + "OffersOperations", "ClustersOperations", "DeploymentSettingsOperations", + "EdgeDeviceJobsOperations", "EdgeDevicesOperations", "ExtensionsOperations", - "OffersOperations", - "Operations", "PublishersOperations", "SecuritySettingsOperations", "SkusOperations", "UpdateRunsOperations", - "UpdateSummariesOperations", "UpdatesOperations", + "ValidatedSolutionRecipesOperations", + "EdgeMachinesOperations", + "EdgeMachineJobsOperations", + "OwnershipVouchersOperations", + "UpdateSummariesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_arc_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_arc_settings_operations.py deleted file mode 100644 index 3bb5c547ac00..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_arc_settings_operations.py +++ /dev/null @@ -1,1279 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_cluster_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, cluster_name: str, arc_setting_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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_create_request( - resource_group_name: str, cluster_name: str, arc_setting_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, cluster_name: str, arc_setting_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, cluster_name: str, arc_setting_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_generate_password_request( - resource_group_name: str, cluster_name: str, arc_setting_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_identity_request( - resource_group_name: str, cluster_name: str, arc_setting_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_consent_and_install_default_extensions_request( # pylint: disable=name-too-long - resource_group_name: str, cluster_name: str, arc_setting_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/consentAndInstallDefaultExtensions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_initialize_disable_process_request( - resource_group_name: str, cluster_name: str, arc_setting_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/initializeDisableProcess", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ArcSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`arc_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.ArcSetting"]: - """Get ArcSetting resources of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either ArcSetting or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ArcSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ArcSettingList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ArcSettingList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.ArcSetting: - """Get ArcSetting resource details of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArcSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: _models.ArcSetting, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Required. - :type arc_setting: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: Union[_models.ArcSetting, IO[bytes]], - **kwargs: Any - ) -> _models.ArcSetting: - """Create ArcSetting for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. - Is either a ArcSetting type or a IO[bytes] type. Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting or IO[bytes] - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(arc_setting, (IOBase, bytes)): - _content = arc_setting - else: - _json = self._serialize.body(arc_setting, "ArcSetting") - - _request = build_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArcSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: _models.ArcSettingsPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Required. - :type arc_setting: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - arc_setting: Union[_models.ArcSettingsPatch, IO[bytes]], - **kwargs: Any - ) -> _models.ArcSetting: - """Update ArcSettings for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param arc_setting: ArcSettings parameters that needs to be updated. Is either a - ArcSettingsPatch type or a IO[bytes] type. Required. - :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch or IO[bytes] - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(arc_setting, (IOBase, bytes)): - _content = arc_setting - else: - _json = self._serialize.body(arc_setting, "ArcSettingsPatch") - - _request = build_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArcSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete ArcSetting resource details of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def generate_password( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.PasswordCredential: - """Generate password for arc settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: PasswordCredential or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) - - _request = build_generate_password_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PasswordCredential", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_identity_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_identity_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_create_identity( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> LROPoller[_models.ArcIdentityResponse]: - """Create Aad identity for arc settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of LROPoller that returns either ArcIdentityResponse or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_identity_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - api_version=api_version, - 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): - deserialized = self._deserialize("ArcIdentityResponse", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ArcIdentityResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ArcIdentityResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def consent_and_install_default_extensions( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> _models.ArcSetting: - """Add consent time for default extensions and initiate extensions installation. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: ArcSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) - - _request = build_consent_and_install_default_extensions_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ArcSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _initialize_disable_process_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_initialize_disable_process_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_initialize_disable_process( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Initializes ARC Disable process on the cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._initialize_disable_process_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_clusters_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_clusters_operations.py deleted file mode 100644 index 11118ad65e70..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_clusters_operations.py +++ /dev/null @@ -1,1889 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_request(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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _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_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_upload_certificate_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_identity_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_extend_software_assurance_benefit_request( # pylint: disable=name-too-long - 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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/extendSoftwareAssuranceBenefit", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_trigger_log_collection_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/triggerLogCollection", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_configure_remote_support_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/configureRemoteSupport", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ClustersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Cluster"]: - """List all HCI clusters in a subscription. - - :return: An iterator like instance of either Cluster or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Cluster"]: - """List all HCI clusters in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either Cluster or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ClusterList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: - """Get HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: _models.Cluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: ~azure.mgmt.azurestackhci.models.Cluster - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - cluster_name: str, - cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create( - self, resource_group_name: str, cluster_name: str, cluster: Union[_models.Cluster, IO[bytes]], **kwargs: Any - ) -> _models.Cluster: - """Create an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Is either a Cluster type or a IO[bytes] type. - Required. - :type cluster: ~azure.mgmt.azurestackhci.models.Cluster or IO[bytes] - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster, (IOBase, bytes)): - _content = cluster - else: - _json = self._serialize.body(cluster, "Cluster") - - _request = build_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: _models.ClusterPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Required. - :type cluster: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - cluster_name: str, - cluster: Union[_models.ClusterPatch, IO[bytes]], - **kwargs: Any - ) -> _models.Cluster: - """Update an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param cluster: Details of the HCI cluster. Is either a ClusterPatch type or a IO[bytes] type. - Required. - :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch or IO[bytes] - :return: Cluster or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Cluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(cluster, (IOBase, bytes)): - _content = cluster - else: - _json = self._serialize.body(cluster, "ClusterPatch") - - _request = build_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete an HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _upload_certificate_initial( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: Union[_models.UploadCertificateRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(upload_certificate_request, (IOBase, bytes)): - _content = upload_certificate_request - else: - _json = self._serialize.body(upload_certificate_request, "UploadCertificateRequest") - - _request = build_upload_certificate_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: _models.UploadCertificateRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Required. - :type upload_certificate_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_upload_certificate( - self, - resource_group_name: str, - cluster_name: str, - upload_certificate_request: Union[_models.UploadCertificateRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Upload certificate. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param upload_certificate_request: Upload certificate request. Is either a - UploadCertificateRequest type or a IO[bytes] type. Required. - :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest or - IO[bytes] - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._upload_certificate_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - upload_certificate_request=upload_certificate_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _create_identity_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_identity_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_create_identity( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> LROPoller[_models.ClusterIdentityResponse]: - """Create cluster identity. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of LROPoller that returns either ClusterIdentityResponse or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_identity_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - api_version=api_version, - 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): - deserialized = self._deserialize("ClusterIdentityResponse", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ClusterIdentityResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ClusterIdentityResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _extend_software_assurance_benefit_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(software_assurance_change_request, (IOBase, bytes)): - _content = software_assurance_change_request - else: - _json = self._serialize.body(software_assurance_change_request, "SoftwareAssuranceChangeRequest") - - _request = build_extend_software_assurance_benefit_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: _models.SoftwareAssuranceChangeRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Required. - :type software_assurance_change_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_extend_software_assurance_benefit( - self, - resource_group_name: str, - cluster_name: str, - software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Extends Software Assurance Benefit to a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param software_assurance_change_request: Software Assurance Change Request Payload. Is either - a SoftwareAssuranceChangeRequest type or a IO[bytes] type. Required. - :type software_assurance_change_request: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest or IO[bytes] - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._extend_software_assurance_benefit_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - software_assurance_change_request=software_assurance_change_request, - api_version=api_version, - 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): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _trigger_log_collection_initial( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: Union[_models.LogCollectionRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(log_collection_request, (IOBase, bytes)): - _content = log_collection_request - else: - _json = self._serialize.body(log_collection_request, "LogCollectionRequest") - - _request = build_trigger_log_collection_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: _models.LogCollectionRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Required. - :type log_collection_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_trigger_log_collection( - self, - resource_group_name: str, - cluster_name: str, - log_collection_request: Union[_models.LogCollectionRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Trigger Log Collection on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param log_collection_request: Trigger Log Collection Request Payload. Is either a - LogCollectionRequest type or a IO[bytes] type. Required. - :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest or - IO[bytes] - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._trigger_log_collection_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - log_collection_request=log_collection_request, - api_version=api_version, - 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): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _configure_remote_support_initial( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: Union[_models.RemoteSupportRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(remote_support_request, (IOBase, bytes)): - _content = remote_support_request - else: - _json = self._serialize.body(remote_support_request, "RemoteSupportRequest") - - _request = build_configure_remote_support_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: _models.RemoteSupportRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Required. - :type remote_support_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_configure_remote_support( - self, - resource_group_name: str, - cluster_name: str, - remote_support_request: Union[_models.RemoteSupportRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Cluster]: - """Configure RemoteSupport on a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param remote_support_request: Configure Remote Support Request Payload. Is either a - RemoteSupportRequest type or a IO[bytes] type. Required. - :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest or - IO[bytes] - :return: An instance of LROPoller that returns either Cluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._configure_remote_support_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - remote_support_request=remote_support_request, - api_version=api_version, - 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): - deserialized = self._deserialize("Cluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Cluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Cluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_deployment_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_deployment_settings_operations.py deleted file mode 100644 index c2e131079977..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_deployment_settings_operations.py +++ /dev/null @@ -1,693 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_clusters_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - deployment_settings_name: str = "default", - **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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "deploymentSettingsName": _SERIALIZER.url( - "deployment_settings_name", deployment_settings_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$" - ), - } - - _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_create_or_update_request( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - deployment_settings_name: str = "default", - **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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "deploymentSettingsName": _SERIALIZER.url( - "deployment_settings_name", deployment_settings_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$" - ), - } - - _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_delete_request( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - deployment_settings_name: str = "default", - **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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "deploymentSettingsName": _SERIALIZER.url( - "deployment_settings_name", deployment_settings_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$" - ), - } - - _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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DeploymentSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`deployment_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.DeploymentSetting"]: - """List DeploymentSetting resources by Clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either DeploymentSetting or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DeploymentSettingListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DeploymentSettingListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> _models.DeploymentSetting: - """Get a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: DeploymentSetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.DeploymentSetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DeploymentSetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.DeploymentSetting, IO[bytes]], - deployment_settings_name: str = "default", - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "DeploymentSetting") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: _models.DeploymentSetting, - deployment_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either DeploymentSetting or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: IO[bytes], - deployment_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either DeploymentSetting or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.DeploymentSetting, IO[bytes]], - deployment_settings_name: str = "default", - **kwargs: Any - ) -> LROPoller[_models.DeploymentSetting]: - """Create a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Is either a DeploymentSetting type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting or IO[bytes] - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: An instance of LROPoller that returns either DeploymentSetting or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - resource=resource, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - 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): - deserialized = self._deserialize("DeploymentSetting", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DeploymentSetting].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DeploymentSetting]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_name: str, deployment_settings_name: str = "default", **kwargs: Any - ) -> LROPoller[None]: - """Delete a DeploymentSetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param deployment_settings_name: Name of Deployment Setting. Default value is "default". - :type deployment_settings_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - deployment_settings_name=deployment_settings_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_edge_devices_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_edge_devices_operations.py deleted file mode 100644 index 0024b796a4e7..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_edge_devices_operations.py +++ /dev/null @@ -1,831 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(resource_uri: 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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices") - path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), - } - - _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_get_request(resource_uri: str, edge_device_name: str = "default", **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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}") - path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), - "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$"), - } - - _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_create_or_update_request(resource_uri: str, edge_device_name: str = "default", **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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}") - path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), - "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$"), - } - - _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_delete_request(resource_uri: str, edge_device_name: str = "default", **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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}") - path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), - "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$"), - } - - _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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_validate_request(resource_uri: str, edge_device_name: str = "default", **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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}/validate" - ) # pylint: disable=line-too-long - path_format_arguments = { - "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), - "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class EdgeDevicesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`edge_devices` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.EdgeDevice"]: - """List EdgeDevice resources by parent. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :return: An iterator like instance of either EdgeDevice or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.EdgeDeviceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_request( - resource_uri=resource_uri, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EdgeDeviceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> _models.EdgeDevice: - """Get a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: EdgeDevice or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.EdgeDevice - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("EdgeDevice", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_uri: str, - resource: Union[_models.EdgeDevice, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "EdgeDevice") - - _request = build_create_or_update_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_uri: str, - resource: _models.EdgeDevice, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either EdgeDevice or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_uri: str, - resource: IO[bytes], - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either EdgeDevice or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_uri: str, - resource: Union[_models.EdgeDevice, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> LROPoller[_models.EdgeDevice]: - """Create a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param resource: Resource create parameters. Is either a EdgeDevice type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of LROPoller that returns either EdgeDevice or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_uri=resource_uri, - resource=resource, - edge_device_name=edge_device_name, - api_version=api_version, - 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): - deserialized = self._deserialize("EdgeDevice", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.EdgeDevice].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EdgeDevice]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_uri: str, edge_device_name: str = "default", **kwargs: Any) -> LROPoller[None]: - """Delete a EdgeDevice. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _validate_initial( - self, - resource_uri: str, - validate_request: Union[_models.ValidateRequest, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(validate_request, (IOBase, bytes)): - _content = validate_request - else: - _json = self._serialize.body(validate_request, "ValidateRequest") - - _request = build_validate_request( - resource_uri=resource_uri, - edge_device_name=edge_device_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_validate( - self, - resource_uri: str, - validate_request: _models.ValidateRequest, - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ValidateResponse or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_validate( - self, - resource_uri: str, - validate_request: IO[bytes], - edge_device_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Required. - :type validate_request: IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ValidateResponse or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_validate( - self, - resource_uri: str, - validate_request: Union[_models.ValidateRequest, IO[bytes]], - edge_device_name: str = "default", - **kwargs: Any - ) -> LROPoller[_models.ValidateResponse]: - """A long-running resource action. - - :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. - Required. - :type resource_uri: str - :param validate_request: The content of the action request. Is either a ValidateRequest type or - a IO[bytes] type. Required. - :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest or IO[bytes] - :param edge_device_name: Name of Device. Default value is "default". - :type edge_device_name: str - :return: An instance of LROPoller that returns either ValidateResponse or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ValidateResponse] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._validate_initial( - resource_uri=resource_uri, - validate_request=validate_request, - edge_device_name=edge_device_name, - api_version=api_version, - 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): - deserialized = self._deserialize("ValidateResponse", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ValidateResponse].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ValidateResponse]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_extensions_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_extensions_operations.py deleted file mode 100644 index 347c045fd2b9..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_extensions_operations.py +++ /dev/null @@ -1,1233 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_arc_setting_request( - resource_group_name: str, cluster_name: str, arc_setting_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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_get_request( - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), - "extensionName": _SERIALIZER.url("extension_name", extension_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_create_request( - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), - "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), - "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), - "extensionName": _SERIALIZER.url("extension_name", extension_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_upgrade_request( - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}/upgrade", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), - "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ExtensionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`extensions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_arc_setting( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any - ) -> Iterable["_models.Extension"]: - """List all Extensions under ArcSetting resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :return: An iterator like instance of either Extension or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExtensionList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_arc_setting_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ExtensionList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> _models.Extension: - """Get particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :return: Extension or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Extension - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Extension", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.Extension, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(extension, (IOBase, bytes)): - _content = extension - else: - _json = self._serialize.body(extension, "Extension") - - _request = build_create_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: _models.Extension, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Create Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: ~azure.mgmt.azurestackhci.models.Extension - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Create Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: 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 either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.Extension, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Create Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Is either a Extension type or - a IO[bytes] type. Required. - :type extension: ~azure.mgmt.azurestackhci.models.Extension or IO[bytes] - :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension=extension, - api_version=api_version, - 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): - deserialized = self._deserialize("Extension", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Extension].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Extension]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.ExtensionPatch, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(extension, (IOBase, bytes)): - _content = extension - else: - _json = self._serialize.body(extension, "ExtensionPatch") - - _request = build_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: _models.ExtensionPatch, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Required. - :type extension: 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 either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension: Union[_models.ExtensionPatch, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Extension]: - """Update Extension for HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension: Details of the Machine Extension to be created. Is either a ExtensionPatch - type or a IO[bytes] type. Required. - :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch or IO[bytes] - :return: An instance of LROPoller that returns either Extension or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Extension] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension=extension, - api_version=api_version, - 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): - deserialized = self._deserialize("Extension", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "original-uri"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Extension].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Extension]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _upgrade_initial( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(extension_upgrade_parameters, (IOBase, bytes)): - _content = extension_upgrade_parameters - else: - _json = self._serialize.body(extension_upgrade_parameters, "ExtensionUpgradeParameters") - - _request = build_upgrade_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_upgrade( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: _models.ExtensionUpgradeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_upgrade( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Required. - :type extension_upgrade_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_upgrade( - self, - resource_group_name: str, - cluster_name: str, - arc_setting_name: str, - extension_name: str, - extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Upgrade a particular Arc Extension of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting - information. Required. - :type arc_setting_name: str - :param extension_name: The name of the machine extension. Required. - :type extension_name: str - :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. - Is either a ExtensionUpgradeParameters type or a IO[bytes] type. Required. - :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters - or IO[bytes] - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._upgrade_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - arc_setting_name=arc_setting_name, - extension_name=extension_name, - extension_upgrade_parameters=extension_upgrade_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_offers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_offers_operations.py deleted file mode 100644 index 245a00461fa3..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_offers_operations.py +++ /dev/null @@ -1,438 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_publisher_request( - resource_group_name: str, - cluster_name: str, - publisher_name: str, - subscription_id: str, - *, - expand: 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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_cluster_request( - resource_group_name: str, cluster_name: str, subscription_id: str, *, expand: 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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/offers", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - subscription_id: str, - *, - expand: 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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), - "offerName": _SERIALIZER.url("offer_name", offer_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class OffersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`offers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_publisher( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.Offer"]: - """List Offers available for a publisher within the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: An iterator like instance of either Offer or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Offer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OfferList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_publisher_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OfferList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.Offer"]: - """List Offers available across publishers for the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: An iterator like instance of either Offer or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Offer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OfferList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OfferList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.Offer: - """Get Offer resource details within a publisher of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: Offer or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Offer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Offer] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Offer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py index f52d1b8c662e..ac756c5ff435 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_operations.py @@ -1,89 +1,14371 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from collections.abc import MutableMapping +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse +from azure.core import PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._serialization import Serializer +from .._configuration import AzureStackHCIClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._validation import api_version_validation -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_request(**kwargs: Any) -> HttpRequest: +def build_kubernetes_versions_list_by_subscription_location_resource_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.AzureStackHCI/operations") + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/kubernetesVersions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_platform_updates_get_request( + location: str, platform_update_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/platformUpdates/{platformUpdateName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "platformUpdateName": _SERIALIZER.url("platform_update_name", platform_update_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_platform_updates_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/platformUpdates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_os_images_get_request(location: str, os_image_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/osImages/{osImageName}" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "osImageName": _SERIALIZER.url("os_image_name", os_image_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_os_images_list_by_subscription_location_resource_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/osImages" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_contents_get_request( + location: str, update_content_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/updateContents/{updateContentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "updateContentName": _SERIALIZER.url("update_content_name", update_content_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_contents_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/updateContents" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_operations_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.AzureStackHCI/operations" + + # 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_arc_settings_get_request( + resource_group_name: str, cluster_name: str, arc_setting_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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_arc_settings_create_request( + resource_group_name: str, cluster_name: str, arc_setting_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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_arc_settings_update_request( + resource_group_name: str, cluster_name: str, arc_setting_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_arc_settings_delete_request( + resource_group_name: str, cluster_name: str, arc_setting_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_arc_settings_list_by_cluster_request( # pylint: disable=name-too-long + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_arc_settings_generate_password_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, arc_setting_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/generatePassword" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_arc_settings_create_identity_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, arc_setting_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/createArcIdentity" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_arc_settings_reconcile_request( + resource_group_name: str, cluster_name: str, arc_setting_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/reconcile" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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") + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_arc_settings_consent_and_install_default_extensions_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, arc_setting_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/consentAndInstallDefaultExtensions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_arc_settings_initialize_disable_process_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, arc_setting_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/initializeDisableProcess" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_offers_get_request( + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + subscription_id: str, + *, + expand: 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", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), + "offerName": _SERIALIZER.url("offer_name", offer_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_offers_list_by_publisher_request( + resource_group_name: str, + cluster_name: str, + publisher_name: str, + subscription_id: str, + *, + expand: 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", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_offers_list_by_cluster_request( + resource_group_name: str, cluster_name: str, subscription_id: str, *, expand: 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", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/offers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_create_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_update_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_delete_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_clusters_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/clusters" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_update_secrets_locations_request( # pylint: disable=name-too-long + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSecretsLocations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_upload_certificate_request( # pylint: disable=name-too-long + 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-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/uploadCertificate" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_create_identity_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/createClusterIdentity" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_extend_software_assurance_benefit_request( # pylint: disable=name-too-long + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/extendSoftwareAssuranceBenefit" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_change_ring_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/changeRing" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_trigger_log_collection_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/triggerLogCollection" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_clusters_configure_remote_support_request( # pylint: disable=name-too-long + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/configureRemoteSupport" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_deployment_settings_get_request( + resource_group_name: str, cluster_name: str, deployment_settings_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "deploymentSettingsName": _SERIALIZER.url("deployment_settings_name", deployment_settings_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_deployment_settings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, deployment_settings_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "deploymentSettingsName": _SERIALIZER.url("deployment_settings_name", deployment_settings_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_deployment_settings_delete_request( + resource_group_name: str, cluster_name: str, deployment_settings_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings/{deploymentSettingsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "deploymentSettingsName": _SERIALIZER.url("deployment_settings_name", deployment_settings_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_deployment_settings_list_by_clusters_request( # pylint: disable=name-too-long + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/deploymentSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_edge_device_jobs_get_request( + resource_uri: str, edge_device_name: str, jobs_name: 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}/jobs/{jobsName}" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_name, "str"), + "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_edge_device_jobs_create_or_update_request( # pylint: disable=name-too-long + resource_uri: str, edge_device_name: str, jobs_name: 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}/jobs/{jobsName}" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_name, "str"), + "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_edge_device_jobs_delete_request( + resource_uri: str, edge_device_name: str, jobs_name: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}/jobs/{jobsName}" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_name, "str"), + "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_edge_device_jobs_list_by_edge_device_request( # pylint: disable=name-too-long + resource_uri: str, edge_device_name: 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}/jobs" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_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_edge_devices_get_request(resource_uri: str, edge_device_name: 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_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_edge_devices_create_or_update_request( # pylint: disable=name-too-long + resource_uri: str, edge_device_name: 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_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_edge_devices_delete_request(resource_uri: str, edge_device_name: str, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_edge_devices_list_request(resource_uri: 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + } + + _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_edge_devices_validate_request(resource_uri: str, edge_device_name: 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/{resourceUri}/providers/Microsoft.AzureStackHCI/edgeDevices/{edgeDeviceName}/validate" + path_format_arguments = { + "resourceUri": _SERIALIZER.url("resource_uri", resource_uri, "str", skip_quote=True), + "edgeDeviceName": _SERIALIZER.url("edge_device_name", edge_device_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_extensions_get_request( + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_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_extensions_create_request( + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_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_extensions_update_request( + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_extensions_delete_request( + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_extensions_list_by_arc_setting_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, arc_setting_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_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_extensions_upgrade_request( + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_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-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/arcSettings/{arcSettingName}/extensions/{extensionName}/upgrade" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "arcSettingName": _SERIALIZER.url("arc_setting_name", arc_setting_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_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_publishers_get_request( + resource_group_name: str, cluster_name: str, publisher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_publishers_list_by_cluster_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_settings_get_request( + resource_group_name: str, cluster_name: str, security_settings_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "securitySettingsName": _SERIALIZER.url("security_settings_name", security_settings_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_security_settings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, cluster_name: str, security_settings_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "securitySettingsName": _SERIALIZER.url("security_settings_name", security_settings_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_security_settings_delete_request( + resource_group_name: str, cluster_name: str, security_settings_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "securitySettingsName": _SERIALIZER.url("security_settings_name", security_settings_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_security_settings_list_by_clusters_request( # pylint: disable=name-too-long + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_skus_get_request( + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + sku_name: str, + subscription_id: str, + *, + expand: 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", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus/{skuName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), + "offerName": _SERIALIZER.url("offer_name", offer_name, "str"), + "skuName": _SERIALIZER.url("sku_name", sku_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_skus_list_by_offer_request( + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + subscription_id: str, + *, + expand: 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", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), + "offerName": _SERIALIZER.url("offer_name", offer_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_runs_get_request( + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + "updateRunName": _SERIALIZER.url("update_run_name", update_run_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_runs_put_request( + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + "updateRunName": _SERIALIZER.url("update_run_name", update_run_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_runs_delete_request( + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + "updateRunName": _SERIALIZER.url("update_run_name", update_run_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_update_runs_list_request( + resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_updates_get_request( + resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_updates_put_request( + resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + 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_updates_delete_request( + resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_updates_list_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_updates_post_request( + resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/apply" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + "updateName": _SERIALIZER.url("update_name", update_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_validated_solution_recipes_get_request( # pylint: disable=name-too-long + location: str, validated_solution_recipe_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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/validatedSolutionRecipes/{validatedSolutionRecipeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "validatedSolutionRecipeName": _SERIALIZER.url( + "validated_solution_recipe_name", validated_solution_recipe_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_validated_solution_recipes_list_by_subscription_location_resource_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/locations/{location}/validatedSolutionRecipes" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_edge_machines_get_request( + resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + } + + _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_edge_machines_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + } + + _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_edge_machines_update_request( + resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_edge_machines_delete_request( + resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_edge_machines_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_edge_machines_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/edgeMachines" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_edge_machine_jobs_get_request( + resource_group_name: str, edge_machine_name: str, jobs_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}/jobs/{jobsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), + } + + _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_edge_machine_jobs_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, edge_machine_name: str, jobs_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + 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-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}/jobs/{jobsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), + } + + _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_edge_machine_jobs_delete_request( + resource_group_name: str, edge_machine_name: str, jobs_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}/jobs/{jobsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + "jobsName": _SERIALIZER.url("jobs_name", jobs_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_edge_machine_jobs_list_request( + resource_group_name: str, edge_machine_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/edgeMachines/{edgeMachineName}/jobs" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "edgeMachineName": _SERIALIZER.url("edge_machine_name", edge_machine_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ownership_vouchers_validate_request( # pylint: disable=name-too-long + resource_group_name: str, location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/locations/{location}/validateOwnershipVouchers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_summaries_get_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_summaries_put_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_summaries_delete_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_update_summaries_list_request( + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class KubernetesVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`kubernetes_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription_location_resource( + self, location: str, **kwargs: Any + ) -> ItemPaged["_models.KubernetesVersion"]: + """List all kubernetes versions. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of KubernetesVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.KubernetesVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.KubernetesVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_kubernetes_versions_list_by_subscription_location_resource_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.KubernetesVersion], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PlatformUpdatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`platform_updates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, platform_update_name: str, **kwargs: Any) -> _models.PlatformUpdate: + """Get a platform update. + + :param location: The name of the Azure region. Required. + :type location: str + :param platform_update_name: The name of the PlatformUpdate. Required. + :type platform_update_name: str + :return: PlatformUpdate. The PlatformUpdate is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.PlatformUpdate + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PlatformUpdate] = kwargs.pop("cls", None) + + _request = build_platform_updates_get_request( + location=location, + platform_update_name=platform_update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.PlatformUpdate, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.PlatformUpdate"]: + """List all platform updates. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of PlatformUpdate + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.PlatformUpdate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PlatformUpdate]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_platform_updates_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.PlatformUpdate], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class OsImagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`os_images` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, os_image_name: str, **kwargs: Any) -> _models.OsImage: + """Get a os image. + + :param location: The name of the Azure region. Required. + :type location: str + :param os_image_name: The name of the OsImage. Required. + :type os_image_name: str + :return: OsImage. The OsImage is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.OsImage + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OsImage] = kwargs.pop("cls", None) + + _request = build_os_images_get_request( + location=location, + os_image_name=os_image_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.OsImage, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription_location_resource(self, location: str, **kwargs: Any) -> ItemPaged["_models.OsImage"]: + """List all os images. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of OsImage + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.OsImage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OsImage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_os_images_list_by_subscription_location_resource_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.OsImage], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class UpdateContentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`update_contents` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, update_content_name: str, **kwargs: Any) -> _models.UpdateContent: + """Gets content for an update. + + :param location: The name of the Azure region. Required. + :type location: str + :param update_content_name: The name of the UpdateContent. Required. + :type update_content_name: str + :return: UpdateContent. The UpdateContent is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateContent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.UpdateContent] = kwargs.pop("cls", None) + + _request = build_update_contents_get_request( + location=location, + update_content_name=update_content_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.UpdateContent, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.UpdateContent"]: + """List all update contents. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of UpdateContent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.UpdateContent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UpdateContent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_update_contents_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.UpdateContent], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """List the operations for the provider. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ArcSettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`arc_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.ArcSetting: + """Get ArcSetting resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + + _request = build_arc_settings_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: _models.ArcSetting, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Required. + :type arc_setting: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: Union[_models.ArcSetting, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ArcSetting: + """Create ArcSetting for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: Parameters supplied to the Create ArcSetting resource for this HCI cluster. + Is one of the following types: ArcSetting, JSON, IO[bytes] Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSetting or JSON or IO[bytes] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(arc_setting, (IOBase, bytes)): + _content = arc_setting + else: + _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_arc_settings_create_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: _models.ArcSettingsPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Required. + :type arc_setting: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + arc_setting: Union[_models.ArcSettingsPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ArcSetting: + """Update ArcSettings for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param arc_setting: ArcSettings parameters that needs to be updated. Is one of the following + types: ArcSettingsPatch, JSON, IO[bytes] Required. + :type arc_setting: ~azure.mgmt.azurestackhci.models.ArcSettingsPatch or JSON or IO[bytes] + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(arc_setting, (IOBase, bytes)): + _content = arc_setting + else: + _content = json.dumps(arc_setting, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_arc_settings_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_arc_settings_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete ArcSetting resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.ArcSetting"]: + """Get ArcSetting resources of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of ArcSetting + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ArcSetting]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_arc_settings_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ArcSetting], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def generate_password( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.PasswordCredential: + """Generate password for arc settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: PasswordCredential. The PasswordCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.PasswordCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PasswordCredential] = kwargs.pop("cls", None) + + _request = build_arc_settings_generate_password_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.PasswordCredential, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_identity_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_arc_settings_create_identity_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create_identity( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> LROPoller[_models.ArcIdentityResponse]: + """Create Aad identity for arc settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An instance of LROPoller that returns ArcIdentityResponse. The ArcIdentityResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcIdentityResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArcIdentityResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ArcIdentityResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ArcIdentityResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ArcIdentityResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _reconcile_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(reconcile_arc_settings_request, (IOBase, bytes)): + _content = reconcile_arc_settings_request + else: + _content = json.dumps(reconcile_arc_settings_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_arc_settings_reconcile_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: _models.ReconcileArcSettingsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: + ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Required. + :type reconcile_arc_settings_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_reconcile( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + reconcile_arc_settings_request: Union[_models.ReconcileArcSettingsRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ArcSetting]: + """Reconcile Arc Settings with information related to all nodes. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param reconcile_arc_settings_request: Request for reconciling Arc Settings. Is one of the + following types: ReconcileArcSettingsRequest, JSON, IO[bytes] Required. + :type reconcile_arc_settings_request: + ~azure.mgmt.azurestackhci.models.ReconcileArcSettingsRequest or JSON or IO[bytes] + :return: An instance of LROPoller that returns ArcSetting. The ArcSetting is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ArcSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reconcile_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + reconcile_arc_settings_request=reconcile_arc_settings_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ArcSetting, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ArcSetting].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ArcSetting]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def consent_and_install_default_extensions( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> _models.ArcSetting: + """Add consent time for default extensions and initiate extensions installation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: ArcSetting. The ArcSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ArcSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArcSetting] = kwargs.pop("cls", None) + + _request = build_arc_settings_consent_and_install_default_extensions_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ArcSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _initialize_disable_process_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_arc_settings_initialize_disable_process_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_initialize_disable_process( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Initializes ARC Disable process on the cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._initialize_disable_process_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class OffersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`offers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.Offer: + """Get Offer resource details within a publisher of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: Offer. The Offer is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Offer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Offer] = kwargs.pop("cls", None) + + _request = build_offers_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Offer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_publisher( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.Offer"]: + """List Offers available for a publisher within the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Offer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Offer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_offers_list_by_publisher_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Offer], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Offer"]: + """List Offers available across publishers for the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Offer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Offer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Offer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_offers_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Offer], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ClustersOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.Cluster: + """Get HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + + _request = build_clusters_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Cluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: _models.Cluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, + resource_group_name: str, + cluster_name: str, + cluster: Union[_models.Cluster, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Cluster: + """Create an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Is one of the following types: Cluster, JSON, + IO[bytes] Required. + :type cluster: ~azure.mgmt.azurestackhci.models.Cluster or JSON or IO[bytes] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(cluster, (IOBase, bytes)): + _content = cluster + else: + _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_create_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Cluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + cluster_name: str, + cluster: _models.ClusterPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + cluster_name: str, + cluster: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + cluster_name: str, + cluster: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Cluster: + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Required. + :type cluster: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + cluster_name: str, + cluster: Union[_models.ClusterPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Cluster: + """Update an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param cluster: Details of the HCI cluster. Is one of the following types: ClusterPatch, JSON, + IO[bytes] Required. + :type cluster: ~azure.mgmt.azurestackhci.models.ClusterPatch or JSON or IO[bytes] + :return: Cluster. The Cluster is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Cluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(cluster, (IOBase, bytes)): + _content = cluster + else: + _content = json.dumps(cluster, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Cluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_clusters_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete an HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Cluster"]: + """List all HCI clusters in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Cluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Cluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Cluster"]: + """List all HCI clusters in a subscription. + + :return: An iterator like instance of Cluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Cluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_clusters_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Cluster], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _update_secrets_locations_initial( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_update_secrets_locations_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: _models.SecretsLocationsChangeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Update cluster secrets locations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Update cluster secrets locations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Update cluster secrets locations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_secrets_locations( + self, + resource_group_name: str, + cluster_name: str, + body: Union[_models.SecretsLocationsChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Update cluster secrets locations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param body: The content of the action request. Is one of the following types: + SecretsLocationsChangeRequest, JSON, IO[bytes] Required. + :type body: ~azure.mgmt.azurestackhci.models.SecretsLocationsChangeRequest or JSON or IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_secrets_locations_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _upload_certificate_initial( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(upload_certificate_request, (IOBase, bytes)): + _content = upload_certificate_request + else: + _content = json.dumps(upload_certificate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_upload_certificate_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: _models.UploadCertificateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Upload certificate. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Upload certificate. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Upload certificate. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param upload_certificate_request: Upload certificate request. Required. + :type upload_certificate_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_upload_certificate( + self, + resource_group_name: str, + cluster_name: str, + upload_certificate_request: Union[_models.UploadCertificateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Upload certificate. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param upload_certificate_request: Upload certificate request. Is one of the following types: + UploadCertificateRequest, JSON, IO[bytes] Required. + :type upload_certificate_request: ~azure.mgmt.azurestackhci.models.UploadCertificateRequest or + JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._upload_certificate_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + upload_certificate_request=upload_certificate_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _create_identity_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_clusters_create_identity_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create_identity( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> LROPoller[_models.ClusterIdentityResponse]: + """Create cluster identity. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An instance of LROPoller that returns ClusterIdentityResponse. The + ClusterIdentityResponse is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ClusterIdentityResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ClusterIdentityResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_identity_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ClusterIdentityResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ClusterIdentityResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ClusterIdentityResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _extend_software_assurance_benefit_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(software_assurance_change_request, (IOBase, bytes)): + _content = software_assurance_change_request + else: + _content = json.dumps(software_assurance_change_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_extend_software_assurance_benefit_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: _models.SoftwareAssuranceChangeRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Required. + :type software_assurance_change_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_extend_software_assurance_benefit( + self, + resource_group_name: str, + cluster_name: str, + software_assurance_change_request: Union[_models.SoftwareAssuranceChangeRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Extends Software Assurance Benefit to a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param software_assurance_change_request: Software Assurance Change Request Payload. Is one of + the following types: SoftwareAssuranceChangeRequest, JSON, IO[bytes] Required. + :type software_assurance_change_request: + ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequest or JSON or IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._extend_software_assurance_benefit_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + software_assurance_change_request=software_assurance_change_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _change_ring_initial( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: Union[_models.ChangeRingRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(change_ring_request, (IOBase, bytes)): + _content = change_ring_request + else: + _content = json.dumps(change_ring_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_change_ring_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_change_ring( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: _models.ChangeRingRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Changes ring of a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param change_ring_request: Change ring request payload. Required. + :type change_ring_request: ~azure.mgmt.azurestackhci.models.ChangeRingRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_ring( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Changes ring of a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param change_ring_request: Change ring request payload. Required. + :type change_ring_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_ring( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Changes ring of a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param change_ring_request: Change ring request payload. Required. + :type change_ring_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_change_ring( + self, + resource_group_name: str, + cluster_name: str, + change_ring_request: Union[_models.ChangeRingRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Changes ring of a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param change_ring_request: Change ring request payload. Is one of the following types: + ChangeRingRequest, JSON, IO[bytes] Required. + :type change_ring_request: ~azure.mgmt.azurestackhci.models.ChangeRingRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._change_ring_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + change_ring_request=change_ring_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _trigger_log_collection_initial( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(log_collection_request, (IOBase, bytes)): + _content = log_collection_request + else: + _content = json.dumps(log_collection_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_trigger_log_collection_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_trigger_log_collection( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: _models.LogCollectionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_trigger_log_collection( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_trigger_log_collection( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Required. + :type log_collection_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_trigger_log_collection( + self, + resource_group_name: str, + cluster_name: str, + log_collection_request: Union[_models.LogCollectionRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Trigger Log Collection on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param log_collection_request: Trigger Log Collection Request Payload. Is one of the following + types: LogCollectionRequest, JSON, IO[bytes] Required. + :type log_collection_request: ~azure.mgmt.azurestackhci.models.LogCollectionRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._trigger_log_collection_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + log_collection_request=log_collection_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _configure_remote_support_initial( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(remote_support_request, (IOBase, bytes)): + _content = remote_support_request + else: + _content = json.dumps(remote_support_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_clusters_configure_remote_support_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: _models.RemoteSupportRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Required. + :type remote_support_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_configure_remote_support( + self, + resource_group_name: str, + cluster_name: str, + remote_support_request: Union[_models.RemoteSupportRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Cluster]: + """Configure RemoteSupport on a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param remote_support_request: Configure Remote Support Request Payload. Is one of the + following types: RemoteSupportRequest, JSON, IO[bytes] Required. + :type remote_support_request: ~azure.mgmt.azurestackhci.models.RemoteSupportRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns Cluster. The Cluster is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Cluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._configure_remote_support_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + remote_support_request=remote_support_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Cluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Cluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Cluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DeploymentSettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`deployment_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str, **kwargs: Any + ) -> _models.DeploymentSetting: + """Get a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :return: DeploymentSetting. The DeploymentSetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.DeploymentSetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) + + _request = build_deployment_settings_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_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) + + _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() + else: + deserialized = _deserialize(_models.DeploymentSetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_deployment_settings_create_or_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: _models.DeploymentSetting, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + deployment_settings_name: str, + resource: Union[_models.DeploymentSetting, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DeploymentSetting]: + """Create a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :param resource: Resource create parameters. Is one of the following types: DeploymentSetting, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.DeploymentSetting or JSON or IO[bytes] + :return: An instance of LROPoller that returns DeploymentSetting. The DeploymentSetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DeploymentSetting] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DeploymentSetting, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DeploymentSetting].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DeploymentSetting]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_deployment_settings_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, deployment_settings_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a DeploymentSetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param deployment_settings_name: Name of Deployment Setting. Required. + :type deployment_settings_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + deployment_settings_name=deployment_settings_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.DeploymentSetting"]: + """List DeploymentSetting resources by Clusters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of DeploymentSetting + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.DeploymentSetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DeploymentSetting]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_deployment_settings_list_by_clusters_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.DeploymentSetting], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class EdgeDeviceJobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`edge_device_jobs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_uri: str, edge_device_name: str, jobs_name: str, **kwargs: Any) -> _models.EdgeDeviceJob: + """Get a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :return: EdgeDeviceJob. The EdgeDeviceJob is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) + + _request = build_edge_device_jobs_get_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_device_jobs_create_or_update_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: _models.EdgeDeviceJob, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + jobs_name: str, + resource: Union[_models.EdgeDeviceJob, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EdgeDeviceJob]: + """Create a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeDeviceJob, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDeviceJob or JSON or IO[bytes] + :return: An instance of LROPoller that returns EdgeDeviceJob. The EdgeDeviceJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeDeviceJob] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeDeviceJob, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: 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.EdgeDeviceJob].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EdgeDeviceJob]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_uri: str, edge_device_name: str, jobs_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_edge_device_jobs_delete_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_uri: str, edge_device_name: str, jobs_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a EdgeDeviceJob. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param jobs_name: Name of EdgeDevice Job. Required. + :type jobs_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + jobs_name=jobs_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_edge_device( + self, resource_uri: str, edge_device_name: str, **kwargs: Any + ) -> ItemPaged["_models.EdgeDeviceJob"]: + """List EdgeDeviceJob resources by EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :return: An iterator like instance of EdgeDeviceJob + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeDeviceJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeDeviceJob]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_device_jobs_list_by_edge_device_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.EdgeDeviceJob], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, 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 EdgeDevicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`edge_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_uri: str, edge_device_name: str, **kwargs: Any) -> _models.EdgeDevice: + """Get a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :return: EdgeDevice. The EdgeDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) + + _request = build_edge_devices_get_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.EdgeDevice, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_uri: str, + edge_device_name: str, + resource: Union[_models.EdgeDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_devices_create_or_update_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + resource: _models.EdgeDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_uri: str, + edge_device_name: str, + resource: Union[_models.EdgeDevice, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EdgeDevice]: + """Create a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeDevice, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeDevice or JSON or IO[bytes] + :return: An instance of LROPoller that returns EdgeDevice. The EdgeDevice is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeDevice] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: 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.EdgeDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EdgeDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_uri: str, edge_device_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_edge_devices_delete_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_uri: str, edge_device_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a EdgeDevice. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.EdgeDevice"]: + """List EdgeDevice resources by parent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :return: An iterator like instance of EdgeDevice + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_devices_list_request( + resource_uri=resource_uri, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.EdgeDevice], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _validate_initial( + self, + resource_uri: str, + edge_device_name: str, + validate_request: Union[_models.ValidateRequest, 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(validate_request, (IOBase, bytes)): + _content = validate_request + else: + _content = json.dumps(validate_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_devices_validate_request( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_validate( + self, + resource_uri: str, + edge_device_name: str, + validate_request: _models.ValidateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param validate_request: The content of the action request. Required. + :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate( + self, + resource_uri: str, + edge_device_name: str, + validate_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param validate_request: The content of the action request. Required. + :type validate_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate( + self, + resource_uri: str, + edge_device_name: str, + validate_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param validate_request: The content of the action request. Required. + :type validate_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_validate( + self, + resource_uri: str, + edge_device_name: str, + validate_request: Union[_models.ValidateRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ValidateResponse]: + """A long-running resource action. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. + Required. + :type resource_uri: str + :param edge_device_name: Name of Device. Required. + :type edge_device_name: str + :param validate_request: The content of the action request. Is one of the following types: + ValidateRequest, JSON, IO[bytes] Required. + :type validate_request: ~azure.mgmt.azurestackhci.models.ValidateRequest or JSON or IO[bytes] + :return: An instance of LROPoller that returns ValidateResponse. The ValidateResponse is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.ValidateResponse] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateResponse] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._validate_initial( + resource_uri=resource_uri, + edge_device_name=edge_device_name, + validate_request=validate_request, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ValidateResponse, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ValidateResponse].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ValidateResponse]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ExtensionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`extensions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> _models.Extension: + """Get particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :return: Extension. The Extension is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Extension + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Extension] = kwargs.pop("cls", None) + + _request = build_extensions_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Extension, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.Extension, JSON, IO[bytes]], + **kwargs: Any + ) -> 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(extension, (IOBase, bytes)): + _content = extension + else: + _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extensions_create_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: _models.Extension, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: ~azure.mgmt.azurestackhci.models.Extension + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.Extension, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Create Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Is one of the following + types: Extension, JSON, IO[bytes] Required. + :type extension: ~azure.mgmt.azurestackhci.models.Extension or JSON or IO[bytes] + :return: An instance of LROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :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.Extension] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Extension, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + 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.Extension].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Extension]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + 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(extension, (IOBase, bytes)): + _content = extension + else: + _content = json.dumps(extension, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extensions_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: _models.ExtensionPatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Required. + :type extension: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension: Union[_models.ExtensionPatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Extension]: + """Update Extension for HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension: Details of the Machine Extension to be created. Is one of the following + types: ExtensionPatch, JSON, IO[bytes] Required. + :type extension: ~azure.mgmt.azurestackhci.models.ExtensionPatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns Extension. The Extension is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.Extension] + :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.Extension] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension=extension, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Extension, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + 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.Extension].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Extension]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_extensions_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + 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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["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 cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, extension_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_arc_setting( + self, resource_group_name: str, cluster_name: str, arc_setting_name: str, **kwargs: Any + ) -> ItemPaged["_models.Extension"]: + """List all Extensions under ArcSetting resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :return: An iterator like instance of Extension + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Extension] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Extension]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_extensions_list_by_arc_setting_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Extension], deserialized.get("value", [])) + 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 _upgrade_initial( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 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(extension_upgrade_parameters, (IOBase, bytes)): + _content = extension_upgrade_parameters + else: + _content = json.dumps(extension_upgrade_parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extensions_upgrade_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: _models.ExtensionUpgradeParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Required. + :type extension_upgrade_parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_upgrade( + self, + resource_group_name: str, + cluster_name: str, + arc_setting_name: str, + extension_name: str, + extension_upgrade_parameters: Union[_models.ExtensionUpgradeParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Upgrade a particular Arc Extension of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param arc_setting_name: The name of the proxy resource holding details of HCI ArcSetting + information. Required. + :type arc_setting_name: str + :param extension_name: The name of the machine extension. Required. + :type extension_name: str + :param extension_upgrade_parameters: Parameters supplied to the Upgrade Extensions operation. + Is one of the following types: ExtensionUpgradeParameters, JSON, IO[bytes] Required. + :type extension_upgrade_parameters: ~azure.mgmt.azurestackhci.models.ExtensionUpgradeParameters + or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._upgrade_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + arc_setting_name=arc_setting_name, + extension_name=extension_name, + extension_upgrade_parameters=extension_upgrade_parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class PublishersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`publishers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, cluster_name: str, publisher_name: str, **kwargs: Any) -> _models.Publisher: + """Get Publisher resource details of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :return: Publisher. The Publisher is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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.Publisher] = kwargs.pop("cls", None) + + _request = build_publishers_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_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) + + _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() + else: + deserialized = _deserialize(_models.Publisher, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_cluster( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.Publisher"]: + """List Publishers available for the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Publisher + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Publisher]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_publishers_list_by_cluster_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Publisher], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SecuritySettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`security_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, security_settings_name: str, **kwargs: Any + ) -> _models.SecuritySetting: + """Get a SecuritySetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :return: SecuritySetting. The SecuritySetting is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.SecuritySetting + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.SecuritySetting] = kwargs.pop("cls", None) + + _request = build_security_settings_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_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) + + _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() + else: + deserialized = _deserialize(_models.SecuritySetting, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + cluster_name: str, + security_settings_name: str, + resource: Union[_models.SecuritySetting, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_security_settings_create_or_update_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + security_settings_name: str, + resource: _models.SecuritySetting, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecuritySetting]: + """Create a security setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + security_settings_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecuritySetting]: + """Create a security setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + security_settings_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SecuritySetting]: + """Create a security setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + cluster_name: str, + security_settings_name: str, + resource: Union[_models.SecuritySetting, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SecuritySetting]: + """Create a security setting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :param resource: Resource create parameters. Is one of the following types: SecuritySetting, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting or JSON or IO[bytes] + :return: An instance of LROPoller that returns SecuritySetting. The SecuritySetting is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SecuritySetting, 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.SecuritySetting].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SecuritySetting]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, cluster_name: str, security_settings_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_security_settings_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, security_settings_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a SecuritySetting. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param security_settings_name: Name of security setting. Required. + :type security_settings_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + security_settings_name=security_settings_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_clusters( + self, resource_group_name: str, cluster_name: str, **kwargs: Any + ) -> ItemPaged["_models.SecuritySetting"]: + """List SecuritySetting resources by Clusters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of SecuritySetting + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.SecuritySetting] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SecuritySetting]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_security_settings_list_by_clusters_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.SecuritySetting], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + 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 SkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`skus` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + sku_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> _models.Sku: + """Get SKU resource details within a offer of HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :param sku_name: The name of the SKU available within HCI cluster. Required. + :type sku_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: Sku. The Sku is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Sku + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.Sku] = kwargs.pop("cls", None) + + _request = build_skus_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + sku_name=sku_name, + subscription_id=self._config.subscription_id, + expand=expand, + 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) + + _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() + else: + deserialized = _deserialize(_models.Sku, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_offer( + self, + resource_group_name: str, + cluster_name: str, + publisher_name: str, + offer_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.Sku"]: + """List Skus available for a offer within the HCI Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param publisher_name: The name of the publisher available within HCI cluster. Required. + :type publisher_name: str + :param offer_name: The name of the offer available within HCI cluster. Required. + :type offer_name: str + :keyword expand: Specify $expand=content,contentVersion to populate additional fields related + to the marketplace offer. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Sku + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Sku] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Sku]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_skus_list_by_offer_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + publisher_name=publisher_name, + offer_name=offer_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Sku], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class UpdateRunsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`update_runs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any + ) -> _models.UpdateRun: + """Get the Update run for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + 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.UpdateRun] = kwargs.pop("cls", None) + + _request = build_update_runs_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + 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) + + _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() + else: + deserialized = _deserialize(_models.UpdateRun, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: _models.UpdateRun, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Required. + :type update_runs_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_run_name: str, + update_runs_properties: Union[_models.UpdateRun, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.UpdateRun: + """Put Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :param update_runs_properties: Properties of the updateRuns object. Is one of the following + types: UpdateRun, JSON, IO[bytes] Required. + :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or JSON or IO[bytes] + :return: UpdateRun. The UpdateRun is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(update_runs_properties, (IOBase, bytes)): + _content = update_runs_properties + else: + _content = json.dumps(update_runs_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_update_runs_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.UpdateRun, 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, update_name: str, update_run_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_update_runs_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + subscription_id=self._config.subscription_id, + 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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, update_name: str, update_run_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete specified Update Run. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_run_name: The name of the Update Run. Required. + :type update_run_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + update_run_name=update_run_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> ItemPaged["_models.UpdateRun"]: + """List all Update runs for a specified update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An iterator like instance of UpdateRun + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.UpdateRun] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UpdateRun]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_update_runs_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + 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.UpdateRun], 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 UpdatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`updates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: + """Get specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 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.Update] = kwargs.pop("cls", None) + + _request = build_updates_get_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + 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) + + _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() + else: + deserialized = _deserialize(_models.Update, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: _models.Update, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Required. + :type update_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def put( + self, + resource_group_name: str, + cluster_name: str, + update_name: str, + update_properties: Union[_models.Update, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Update: + """Put specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :param update_properties: Properties of the Updates object. Is one of the following types: + Update, JSON, IO[bytes] Required. + :type update_properties: ~azure.mgmt.azurestackhci.models.Update or JSON or IO[bytes] + :return: Update. The Update is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.Update + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Update] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(update_properties, (IOBase, bytes)): + _content = update_properties + else: + _content = json.dumps(update_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_updates_put_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.Update, 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, update_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_updates_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, update_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete specified Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.Update"]: + """List all Updates. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of Update + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Update] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Update]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_updates_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.Update], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _post_initial( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_updates_post_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_post( + self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Apply Update. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_name: The name of the Update. Required. + :type update_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._post_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + update_name=update_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ValidatedSolutionRecipesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`validated_solution_recipes` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, validated_solution_recipe_name: str, **kwargs: Any) -> _models.ValidatedSolutionRecipe: + """Get a validated solution recipe. + + :param location: The name of the Azure region. Required. + :type location: str + :param validated_solution_recipe_name: The name of the ValidatedSolutionRecipe. Required. + :type validated_solution_recipe_name: str + :return: ValidatedSolutionRecipe. The ValidatedSolutionRecipe is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ValidatedSolutionRecipe] = kwargs.pop("cls", None) + + _request = build_validated_solution_recipes_get_request( + location=location, + validated_solution_recipe_name=validated_solution_recipe_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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() + else: + deserialized = _deserialize(_models.ValidatedSolutionRecipe, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_subscription_location_resource( + self, location: str, **kwargs: Any + ) -> ItemPaged["_models.ValidatedSolutionRecipe"]: + """List all validated solution recipes. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of ValidatedSolutionRecipe + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.ValidatedSolutionRecipe] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ValidatedSolutionRecipe]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_validated_solution_recipes_list_by_subscription_location_resource_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.ValidatedSolutionRecipe], deserialized.get("value", [])) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class EdgeMachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`edge_machines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def get(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) -> _models.EdgeMachine: + """Get an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :return: EdgeMachine. The EdgeMachine is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeMachine + :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.EdgeMachine] = kwargs.pop("cls", None) + + _request = build_edge_machines_get_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_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) + + _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() + else: + deserialized = _deserialize(_models.EdgeMachine, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + edge_machine_name: str, + resource: Union[_models.EdgeMachine, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_machines_create_or_update_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, + edge_machine_name: str, + resource: _models.EdgeMachine, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeMachine]: + """Create or update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachine + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeMachine]: + """Create or update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeMachine]: + """Create or update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + resource: Union[_models.EdgeMachine, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EdgeMachine]: + """Create or update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeMachine, JSON, + IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachine or JSON or IO[bytes] + :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeMachine, 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.EdgeMachine].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EdgeMachine]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def _update_initial( + self, + resource_group_name: str, + edge_machine_name: str, + properties: Union[_models.EdgeMachinePatch, 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(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_machines_update_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + edge_machine_name: str, + properties: _models.EdgeMachinePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeMachine]: + """Update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.azurestackhci.models.EdgeMachinePatch + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + edge_machine_name: str, + properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeMachine]: + """Update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + edge_machine_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeMachine]: + """Update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def begin_update( + self, + resource_group_name: str, + edge_machine_name: str, + properties: Union[_models.EdgeMachinePatch, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EdgeMachine]: + """Update an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param properties: The resource properties to be updated. Is one of the following types: + EdgeMachinePatch, JSON, IO[bytes] Required. + :type properties: ~azure.mgmt.azurestackhci.models.EdgeMachinePatch or JSON or IO[bytes] + :return: An instance of LROPoller that returns EdgeMachine. The EdgeMachine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeMachine] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + properties=properties, + 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.EdgeMachine, 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.EdgeMachine].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EdgeMachine]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "edge_machine_name"] + }, + api_versions_list=["2025-12-01-preview"], + ) + def _delete_initial(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_edge_machines_delete_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "edge_machine_name"] + }, + api_versions_list=["2025-12-01-preview"], + ) + def begin_delete(self, resource_group_name: str, edge_machine_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete an edge machine. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_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): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={"2025-12-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=["2025-12-01-preview"], + ) + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.EdgeMachine"]: + """List all edge machines in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of EdgeMachine + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeMachine]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_machines_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.EdgeMachine], 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 + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={"2025-12-01-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2025-12-01-preview"], + ) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.EdgeMachine"]: + """List all edge machines in a subscription. + + :return: An iterator like instance of EdgeMachine + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeMachine]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_machines_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + 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.EdgeMachine], 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 EdgeMachineJobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`edge_machine_jobs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def get( + self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + ) -> _models.EdgeMachineJob: + """Get a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :return: EdgeMachineJob. The EdgeMachineJob is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.EdgeMachineJob + :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.EdgeMachineJob] = kwargs.pop("cls", None) + + _request = build_edge_machine_jobs_get_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_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) + + _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() + else: + deserialized = _deserialize(_models.EdgeMachineJob, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + edge_machine_name: str, + jobs_name: str, + resource: Union[_models.EdgeMachineJob, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_edge_machine_jobs_create_or_update_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if 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, + edge_machine_name: str, + jobs_name: str, + resource: _models.EdgeMachineJob, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeMachineJob]: + """Create a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachineJob + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeMachineJob. The EdgeMachineJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + jobs_name: str, + resource: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeMachineJob]: + """Create a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: 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 EdgeMachineJob. The EdgeMachineJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + @overload + def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + jobs_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.EdgeMachineJob]: + """Create a EdgeMachineJob. + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns EdgeMachineJob. The EdgeMachineJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ -class Operations: + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + edge_machine_name: str, + jobs_name: str, + resource: Union[_models.EdgeMachineJob, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.EdgeMachineJob]: + """Create a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :param resource: Resource create parameters. Is one of the following types: EdgeMachineJob, + JSON, IO[bytes] Required. + :type resource: ~azure.mgmt.azurestackhci.models.EdgeMachineJob or JSON or IO[bytes] + :return: An instance of LROPoller that returns EdgeMachineJob. The EdgeMachineJob is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.EdgeMachineJob] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EdgeMachineJob, 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.EdgeMachineJob].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EdgeMachineJob]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def _delete_initial( + self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_edge_machine_jobs_delete_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_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) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "jobs_name", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def begin_delete( + self, resource_group_name: str, edge_machine_name: str, jobs_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a EdgeMachineJob. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :param jobs_name: Name of EdgeMachineJob. Required. + :type jobs_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + edge_machine_name=edge_machine_name, + jobs_name=jobs_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "edge_machine_name", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def list( + self, resource_group_name: str, edge_machine_name: str, **kwargs: Any + ) -> ItemPaged["_models.EdgeMachineJob"]: + """List EdgeMachineJob resources by EdgeMachines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param edge_machine_name: Name of Device. Required. + :type edge_machine_name: str + :return: An iterator like instance of EdgeMachineJob + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.EdgeMachineJob] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EdgeMachineJob]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_edge_machine_jobs_list_request( + resource_group_name=resource_group_name, + edge_machine_name=edge_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) + + 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.EdgeMachineJob], 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 OwnershipVouchersOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`operations` attribute. + :attr:`ownership_vouchers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def validate( + self, + resource_group_name: str, + location: str, + validation_request: _models.ValidateOwnershipVouchersRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidateOwnershipVouchersResponse: + """Validates ownership vouchers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Ownership vouchers to be validated. Required. + :type validation_request: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate( + self, + resource_group_name: str, + location: str, + validation_request: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidateOwnershipVouchersResponse: + """Validates ownership vouchers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Ownership vouchers to be validated. Required. + :type validation_request: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate( + self, + resource_group_name: str, + location: str, + validation_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ValidateOwnershipVouchersResponse: + """Validates ownership vouchers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Ownership vouchers to be validated. Required. + :type validation_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-12-01-preview", + params_added_on={ + "2025-12-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "location", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-12-01-preview"], + ) + def validate( + self, + resource_group_name: str, + location: str, + validation_request: Union[_models.ValidateOwnershipVouchersRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ValidateOwnershipVouchersResponse: + """Validates ownership vouchers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location: The name of the Azure region. Required. + :type location: str + :param validation_request: Ownership vouchers to be validated. Is one of the following types: + ValidateOwnershipVouchersRequest, JSON, IO[bytes] Required. + :type validation_request: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersRequest or + JSON or IO[bytes] + :return: ValidateOwnershipVouchersResponse. The ValidateOwnershipVouchersResponse is compatible + with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.ValidateOwnershipVouchersResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ValidateOwnershipVouchersResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(validation_request, (IOBase, bytes)): + _content = validation_request + else: + _content = json.dumps(validation_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ownership_vouchers_validate_request( + resource_group_name=resource_group_name, + location=location, + 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) + + _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() + else: + deserialized = _deserialize(_models.ValidateOwnershipVouchersResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class UpdateSummariesOperations: """ + .. warning:: + **DO NOT** instantiate this class directly. - models = _models + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`update_summaries` attribute. + """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AzureStackHCIClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> _models.OperationListResult: - """List all available Microsoft.AzureStackHCI provider operations. + def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.UpdateSummaries: + """Get all Update summaries under the HCI cluster. - :return: OperationListResult or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.OperationListResult + :param resource_group_name: The name of the resource group. 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: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -92,19 +14374,194 @@ def list(self, **kwargs: Any) -> _models.OperationListResult: error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) + + _request = build_update_summaries_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) + + _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() + else: + deserialized = _deserialize(_models.UpdateSummaries, response.json()) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: _models.UpdateSummaries, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Required. + :type update_location_properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ - _request = build_list_request( - api_version=api_version, + @distributed_trace + def put( + self, + resource_group_name: str, + cluster_name: str, + update_location_properties: Union[_models.UpdateSummaries, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.UpdateSummaries: + """Put Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :param update_location_properties: Properties of the UpdateSummaries resource. Is one of the + following types: UpdateSummaries, JSON, IO[bytes] Required. + :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries or JSON or + IO[bytes] + :return: UpdateSummaries. The UpdateSummaries is compatible with MutableMapping + :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(update_location_properties, (IOBase, bytes)): + _content = update_location_properties + else: + _content = json.dumps(update_location_properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_update_summaries_put_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, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _stream = False + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) @@ -112,13 +14569,235 @@ def list(self, **kwargs: Any) -> _models.OperationListResult: 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OperationListResult", pipeline_response.http_response) + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.UpdateSummaries, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_update_summaries_delete_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete Update Summaries. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> ItemPaged["_models.UpdateSummaries"]: + """List all Update summaries under the HCI cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param cluster_name: The name of the cluster. Required. + :type cluster_name: str + :return: An iterator like instance of UpdateSummaries + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.UpdateSummaries] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UpdateSummaries]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_update_summaries_list_request( + resource_group_name=resource_group_name, + cluster_name=cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), 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.UpdateSummaries], 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_patch.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_patch.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_publishers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_publishers_operations.py deleted file mode 100644 index 80c1cb9f78be..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_publishers_operations.py +++ /dev/null @@ -1,269 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_cluster_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, cluster_name: str, publisher_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class PublishersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`publishers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_cluster( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.Publisher"]: - """List Publishers available for the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either Publisher or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Publisher] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PublisherList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_cluster_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PublisherList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, cluster_name: str, publisher_name: str, **kwargs: Any) -> _models.Publisher: - """Get Publisher resource details of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :return: Publisher or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Publisher - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Publisher", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_security_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_security_settings_operations.py deleted file mode 100644 index 50cdaf9b7be6..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_security_settings_operations.py +++ /dev/null @@ -1,693 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_clusters_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - security_settings_name: str = "default", - **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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "securitySettingsName": _SERIALIZER.url( - "security_settings_name", security_settings_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$" - ), - } - - _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_create_or_update_request( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - security_settings_name: str = "default", - **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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "securitySettingsName": _SERIALIZER.url( - "security_settings_name", security_settings_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$" - ), - } - - _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_delete_request( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - security_settings_name: str = "default", - **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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/securitySettings/{securitySettingsName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "securitySettingsName": _SERIALIZER.url( - "security_settings_name", security_settings_name, "str", pattern=r"^[a-zA-Z0-9-]{3,24}$" - ), - } - - _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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class SecuritySettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`security_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_clusters( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.SecuritySetting"]: - """List SecuritySetting resources by Clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either SecuritySetting or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.SecuritySetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SecuritySettingListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_clusters_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SecuritySettingListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any - ) -> _models.SecuritySetting: - """Get a SecuritySetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: SecuritySetting or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.SecuritySetting - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SecuritySetting", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.SecuritySetting, IO[bytes]], - security_settings_name: str = "default", - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "SecuritySetting") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: _models.SecuritySetting, - security_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SecuritySetting]: - """Create a security setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :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 either SecuritySetting or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: IO[bytes], - security_settings_name: str = "default", - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SecuritySetting]: - """Create a security setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SecuritySetting or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - cluster_name: str, - resource: Union[_models.SecuritySetting, IO[bytes]], - security_settings_name: str = "default", - **kwargs: Any - ) -> LROPoller[_models.SecuritySetting]: - """Create a security setting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param resource: Resource create parameters. Is either a SecuritySetting type or a IO[bytes] - type. Required. - :type resource: ~azure.mgmt.azurestackhci.models.SecuritySetting or IO[bytes] - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: An instance of LROPoller that returns either SecuritySetting or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.SecuritySetting] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SecuritySetting] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - resource=resource, - security_settings_name=security_settings_name, - api_version=api_version, - 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): - deserialized = self._deserialize("SecuritySetting", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SecuritySetting].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SecuritySetting]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, cluster_name: str, security_settings_name: str = "default", **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - security_settings_name=security_settings_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, security_settings_name: str = "default", **kwargs: Any - ) -> LROPoller[None]: - """Delete a SecuritySetting. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param security_settings_name: Name of security setting. Default value is "default". - :type security_settings_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - security_settings_name=security_settings_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_skus_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_skus_operations.py deleted file mode 100644 index 952c762fb280..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_skus_operations.py +++ /dev/null @@ -1,327 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_offer_request( - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - subscription_id: str, - *, - expand: 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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), - "offerName": _SERIALIZER.url("offer_name", offer_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - sku_name: str, - subscription_id: str, - *, - expand: 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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/publishers/{publisherName}/offers/{offerName}/skus/{skuName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, "str"), - "offerName": _SERIALIZER.url("offer_name", offer_name, "str"), - "skuName": _SERIALIZER.url("sku_name", sku_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SkusOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`skus` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_offer( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.Sku"]: - """List Skus available for a offer within the HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: An iterator like instance of either Sku or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Sku] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SkuList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_by_offer_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SkuList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - cluster_name: str, - publisher_name: str, - offer_name: str, - sku_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> _models.Sku: - """Get SKU resource details within a offer of HCI Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param publisher_name: The name of the publisher available within HCI cluster. Required. - :type publisher_name: str - :param offer_name: The name of the offer available within HCI cluster. Required. - :type offer_name: str - :param sku_name: The name of the SKU available within HCI cluster. Required. - :type sku_name: str - :param expand: Specify $expand=content,contentVersion to populate additional fields related to - the marketplace offer. Default value is None. - :type expand: str - :return: Sku or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Sku - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Sku] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - publisher_name=publisher_name, - offer_name=offer_name, - sku_name=sku_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Sku", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_runs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_runs_operations.py deleted file mode 100644 index 7137c3a98f09..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_runs_operations.py +++ /dev/null @@ -1,645 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "updateName": _SERIALIZER.url("update_name", update_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - cluster_name: str, - update_name: str, - update_run_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "updateName": _SERIALIZER.url("update_name", update_name, "str"), - "updateRunName": _SERIALIZER.url("update_run_name", update_run_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_put_request( - resource_group_name: str, - cluster_name: str, - update_name: str, - update_run_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", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "updateName": _SERIALIZER.url("update_name", update_name, "str"), - "updateRunName": _SERIALIZER.url("update_run_name", update_run_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_get_request( - resource_group_name: str, - cluster_name: str, - update_name: str, - update_run_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/updateRuns/{updateRunName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "updateName": _SERIALIZER.url("update_name", update_name, "str"), - "updateRunName": _SERIALIZER.url("update_run_name", update_run_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class UpdateRunsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`update_runs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> Iterable["_models.UpdateRun"]: - """List all Update runs for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An iterator like instance of either UpdateRun or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.UpdateRun] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateRunList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("UpdateRunList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _delete_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, update_name: str, update_run_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete specified Update Run. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: _models.UpdateRun, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateRun or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Required. - :type update_runs_properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateRun or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_run_name: str, - update_runs_properties: Union[_models.UpdateRun, IO[bytes]], - **kwargs: Any - ) -> _models.UpdateRun: - """Put Update runs for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :param update_runs_properties: Properties of the updateRuns object. Is either a UpdateRun type - or a IO[bytes] type. Required. - :type update_runs_properties: ~azure.mgmt.azurestackhci.models.UpdateRun or IO[bytes] - :return: UpdateRun or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_runs_properties, (IOBase, bytes)): - _content = update_runs_properties - else: - _json = self._serialize.body(update_runs_properties, "UpdateRun") - - _request = build_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateRun", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, cluster_name: str, update_name: str, update_run_name: str, **kwargs: Any - ) -> _models.UpdateRun: - """Get the Update run for a specified update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_run_name: The name of the Update Run. Required. - :type update_run_name: str - :return: UpdateRun or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateRun - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateRun] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - update_run_name=update_run_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateRun", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_summaries_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_summaries_operations.py deleted file mode 100644 index e3d799cf5430..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_update_summaries_operations.py +++ /dev/null @@ -1,572 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_put_request(resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_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", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updateSummaries/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class UpdateSummariesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`update_summaries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterable["_models.UpdateSummaries"]: - """List all Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either UpdateSummaries or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.UpdateSummaries] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateSummariesList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("UpdateSummariesList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete Update Summaries. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - def put( - self, - resource_group_name: str, - cluster_name: str, - update_location_properties: _models.UpdateSummaries, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateSummaries: - """Put Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_location_properties: Properties of the UpdateSummaries resource. Required. - :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateSummaries or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def put( - self, - resource_group_name: str, - cluster_name: str, - update_location_properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.UpdateSummaries: - """Put Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_location_properties: Properties of the UpdateSummaries resource. Required. - :type update_location_properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: UpdateSummaries or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def put( - self, - resource_group_name: str, - cluster_name: str, - update_location_properties: Union[_models.UpdateSummaries, IO[bytes]], - **kwargs: Any - ) -> _models.UpdateSummaries: - """Put Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_location_properties: Properties of the UpdateSummaries resource. Is either a - UpdateSummaries type or a IO[bytes] type. Required. - :type update_location_properties: ~azure.mgmt.azurestackhci.models.UpdateSummaries or IO[bytes] - :return: UpdateSummaries or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_location_properties, (IOBase, bytes)): - _content = update_location_properties - else: - _json = self._serialize.body(update_location_properties, "UpdateSummaries") - - _request = build_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateSummaries", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _models.UpdateSummaries: - """Get all Update summaries under the HCI cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: UpdateSummaries or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.UpdateSummaries - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateSummaries] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("UpdateSummaries", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_updates_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_updates_operations.py deleted file mode 100644 index 8932dff5387c..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_updates_operations.py +++ /dev/null @@ -1,752 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_post_request( - resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}/apply", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "updateName": _SERIALIZER.url("update_name", update_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_request(resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "updateName": _SERIALIZER.url("update_name", update_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_put_request( - resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "updateName": _SERIALIZER.url("update_name", update_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - 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_get_request( - resource_group_name: str, cluster_name: str, update_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters/{clusterName}/updates/{updateName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url("cluster_name", cluster_name, "str"), - "updateName": _SERIALIZER.url("update_name", update_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class UpdatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s - :attr:`updates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _post_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_post_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_post( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Apply Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._post_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterable["_models.Update"]: - """List all Updates. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :return: An iterator like instance of either Update or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.Update] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.UpdateList] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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_list_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - 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 - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("UpdateList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link 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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _delete_initial( - self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_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") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, update_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: _models.Update, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Update: - """Put specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: ~azure.mgmt.azurestackhci.models.Update - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Update or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Update - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Update: - """Put specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Required. - :type update_properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Update or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Update - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def put( - self, - resource_group_name: str, - cluster_name: str, - update_name: str, - update_properties: Union[_models.Update, IO[bytes]], - **kwargs: Any - ) -> _models.Update: - """Put specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :param update_properties: Properties of the Updates object. Is either a Update type or a - IO[bytes] type. Required. - :type update_properties: ~azure.mgmt.azurestackhci.models.Update or IO[bytes] - :return: Update or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Update - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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 = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Update] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_properties, (IOBase, bytes)): - _content = update_properties - else: - _json = self._serialize.body(update_properties, "Update") - - _request = build_put_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Update", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, cluster_name: str, update_name: str, **kwargs: Any) -> _models.Update: - """Get specified Update. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: The name of the cluster. Required. - :type cluster_name: str - :param update_name: The name of the Update. Required. - :type update_name: str - :return: Update or the result of cls(response) - :rtype: ~azure.mgmt.azurestackhci.models.Update - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Update] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - update_name=update_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _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 = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Update", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/change_cluster_ring.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/change_cluster_ring.py new file mode 100644 index 000000000000..1ea17dce69ad --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/change_cluster_ring.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python change_cluster_ring.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_change_ring( + resource_group_name="test-rg", + cluster_name="myCluster", + change_ring_request={"properties": {"targetRing": "Insider"}}, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/ChangeClusterRing.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/clusters_update_secrets_locations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/clusters_update_secrets_locations.py new file mode 100644 index 000000000000..3897e2da92ac --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/clusters_update_secrets_locations.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python clusters_update_secrets_locations.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.clusters.begin_update_secrets_locations( + resource_group_name="test-rg", + cluster_name="myCluster", + body={"properties": [{"secretsLocation": "https://kvname.vault.azure.net/", "secretsType": "BackupSecrets"}]}, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/Clusters_UpdateSecretsLocations.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py index 55dacc4e72f1..e5e776bc666f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.clusters.begin_configure_remote_support( @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ConfigureRemoteSupport.json +# x-ms-original-file: 2025-12-01-preview/ConfigureRemoteSupport.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py index f3eede4c2e11..3ef6a307ae92 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.arc_settings.consent_and_install_default_extensions( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ConsentAndInstallDefaultExtensions.json +# x-ms-original-file: 2025-12-01-preview/ConsentAndInstallDefaultExtensions.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py index 83b1b60a04c2..75ce8b7ba752 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.arc_settings.begin_create_identity( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/CreateArcIdentity.json +# x-ms-original-file: 2025-12-01-preview/CreateArcIdentity.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py index 7a0d8cc6bc07..7936df9822c1 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.clusters.create( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/CreateCluster.json +# x-ms-original-file: 2025-12-01-preview/CreateCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py index 8c860dc1c374..2b8c7b53f860 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.clusters.begin_create_identity( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/CreateClusterIdentity.json +# x-ms-original-file: 2025-12-01-preview/CreateClusterIdentity.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py index 9fe8a6f3be8a..24a7cac2707e 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py @@ -1,8 +1,9 @@ +# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -32,6 +33,7 @@ def main(): response = client.edge_devices.begin_create_or_update( resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + edge_device_name="default", resource={ "kind": "HCI", "properties": { @@ -57,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/CreateHciEdgeDevice.json +# x-ms-original-file: 2025-12-01-preview/CreateHciEdgeDevice.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py index 443cd4288438..fd4d242b3cfe 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) client.arc_settings.begin_delete( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteArcSetting.json +# x-ms-original-file: 2025-12-01-preview/DeleteArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py index 21247f1eaaad..9c5523483336 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) client.clusters.begin_delete( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteCluster.json +# x-ms-original-file: 2025-12-01-preview/DeleteCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py index cd236f46286a..d3184630bf6b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,15 +27,16 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) client.deployment_settings.begin_delete( resource_group_name="test-rg", cluster_name="myCluster", + deployment_settings_name="default", ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteDeploymentSettings.json +# x-ms-original-file: 2025-12-01-preview/DeleteDeploymentSettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_edge_devices.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_edge_devices.py index f261eaf32072..2cec7b0e10c0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_edge_devices.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_edge_devices.py @@ -1,8 +1,9 @@ +# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -32,9 +33,10 @@ def main(): client.edge_devices.begin_delete( resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + edge_device_name="default", ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteEdgeDevices.json +# x-ms-original-file: 2025-12-01-preview/DeleteEdgeDevices.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py index 99799fbf7001..fe7f70ba8532 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) client.extensions.begin_delete( @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteExtension.json +# x-ms-original-file: 2025-12-01-preview/DeleteExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py index aecefe991245..9bd51470b154 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,15 +27,16 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) client.security_settings.begin_delete( resource_group_name="test-rg", cluster_name="myCluster", + security_settings_name="default", ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteSecuritySettings.json +# x-ms-original-file: 2025-12-01-preview/DeleteSecuritySettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py index 162d7cc3d707..b8820caf82d3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) client.update_runs.begin_delete( @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteUpdateRuns.json +# x-ms-original-file: 2025-12-01-preview/DeleteUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py index 0deeeaade7fe..0bbc254c7197 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) client.update_summaries.begin_delete( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteUpdateSummaries.json +# x-ms-original-file: 2025-12-01-preview/DeleteUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py index abb71feef3ad..b07ffd0e9b2f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) client.updates.begin_delete( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteUpdates.json +# x-ms-original-file: 2025-12-01-preview/DeleteUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_collect_log.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_collect_log.py new file mode 100644 index 000000000000..f13db7ccfe54 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_collect_log.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_device_jobs_create_or_update_collect_log.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_device_jobs.begin_create_or_update( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + edge_device_name="default", + jobs_name="collectLog", + resource={ + "kind": "HCI", + "properties": { + "fromDate": "2024-01-29T10:43:27.9471574Z", + "jobType": "CollectLog", + "toDate": "2024-01-29T10:43:27.9471574Z", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeDeviceJobs_CreateOrUpdate_CollectLog.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_remote_support.py new file mode 100644 index 000000000000..1d3861912258 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_create_or_update_remote_support.py @@ -0,0 +1,53 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_device_jobs_create_or_update_remote_support.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_device_jobs.begin_create_or_update( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + edge_device_name="default", + jobs_name="collectLog", + resource={ + "kind": "HCI", + "properties": { + "accessLevel": "Diagnostics", + "expirationTimestamp": "2024-01-29T10:43:27.9471574Z", + "jobType": "RemoteSupport", + "type": "Enable", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeDeviceJobs_CreateOrUpdate_RemoteSupport.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_delete.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_delete.py new file mode 100644 index 000000000000..ad2066dd0788 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_delete.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_device_jobs_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.edge_device_jobs.begin_delete( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + edge_device_name="lAq", + jobs_name="Ihlm3R-bZ4vTC4ABA456", + ).result() + + +# x-ms-original-file: 2025-12-01-preview/EdgeDeviceJobs_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_get_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_get_remote_support.py new file mode 100644 index 000000000000..22a15350a064 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_get_remote_support.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_device_jobs_get_remote_support.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_device_jobs.get( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + edge_device_name="-5M1G7G10OZ-o5b-HS3-c72", + jobs_name="-oUxs", + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeDeviceJobs_Get_RemoteSupport.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_list_by_edge_device.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_list_by_edge_device.py new file mode 100644 index 000000000000..597cf2f2e42a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_device_jobs_list_by_edge_device.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_device_jobs_list_by_edge_device.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_device_jobs.list_by_edge_device( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + edge_device_name="YE-855IEIN585-", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-12-01-preview/EdgeDeviceJobs_ListByEdgeDevice.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_collect_log.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_collect_log.py new file mode 100644 index 000000000000..e5313ed9760b --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_collect_log.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_create_or_update_collect_log.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machine_jobs.begin_create_or_update( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + jobs_name="triggerLogCollection", + resource={"properties": {"deploymentMode": "Validate", "jobType": "EdgeMachineJobProperties"}}, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_CreateOrUpdate_CollectLog.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_download_os.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_download_os.py new file mode 100644 index 000000000000..a5b7632ad79b --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_download_os.py @@ -0,0 +1,62 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_create_or_update_download_os.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machine_jobs.begin_create_or_update( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + jobs_name="DownloadOs", + resource={ + "properties": { + "deploymentMode": "Deploy", + "downloadRequest": { + "osProfile": { + "gpgPubKey": "LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tXG5WZXJzaW9uOiBHbnVQRyB2MlxuXG5tUUVOQkZYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYXG4tLS0tLUVORCBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0t", + "imageHash": "sha256:a8b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1", + "osImageLocation": "https://aka.ms/aep/azlinux3.0", + "osName": "AzureLinux", + "osType": "AzureLinux", + "osVersion": "3.0", + "vsrVersion": "1.0.0", + }, + "target": "AzureLinux", + }, + "jobType": "DownloadOs", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_CreateOrUpdate_DownloadOs.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_provision_os.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_provision_os.py new file mode 100644 index 000000000000..36af9babd482 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_provision_os.py @@ -0,0 +1,98 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_create_or_update_provision_os.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machine_jobs.begin_create_or_update( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + jobs_name="ProvisionOs", + resource={ + "properties": { + "deploymentMode": "Deploy", + "jobType": "ProvisionOs", + "provisioningRequest": { + "customConfiguration": "eyJjdXN0b21Db25maWciOiAiZXhhbXBsZSBiYXNlNjQgZW5jb2RlZCBjb25maWcifQ==", + "deviceConfiguration": { + "hostName": "634b9db8-83e1-46ed-b391-c1614e2d0097", + "network": { + "networkAdapters": [ + { + "dnsAddressArray": ["8.8.8.8"], + "gateway": "", + "ipAddress": "", + "ipAddressRange": {"endIp": "", "startIp": ""}, + "ipAssignmentType": "Automatic", + "subnetMask": "", + "vlanId": "0", + } + ] + }, + "storage": {"partitionSize": "30GB"}, + "time": {"primaryTimeServer": "", "secondaryTimeServer": "", "timeZone": "UTC"}, + "webProxy": {"bypassList": [], "connectionUri": "https://microsoft.com/a", "port": ""}, + }, + "onboardingConfiguration": { + "arcVirtualMachineId": "634b9db8-83e1-46ed-b391-c1614e2d0097", + "location": "eastus", + "resourceId": "/subscriptions/ff0aa6da-20f8-44fe-9aee-381c8e8a4aeb/resourceGroups/bhukumar-test-rg/providers/Microsoft.HybridCompute/machines/bkumar-t1", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "type": "HybridComputeMachine", + }, + "osProfile": { + "gpgPubKey": "LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tXG5WZXJzaW9uOiBHbnVQRyB2MlxuXG5tUUVOQkZYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYXG4tLS0tLUVORCBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0t", + "imageHash": "sha256:a1b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef123456", + "operationType": "Provision", + "osImageLocation": "https://aka.ms/aep/azlinux3.0", + "osName": "AzureLinux", + "osType": "AzureLinux", + "osVersion": "3.0", + "vsrVersion": "1.0.0", + }, + "target": "AzureLinux", + "userDetails": [ + { + "secretLocation": "https://bhukumar-test-kv.vault.azure.net/secrets/edgeuser/7b2d7db11bad4e1599cb6a0f4d2b2e00", + "secretType": "KeyVault", + "sshPubKey": ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7... edgeuser@example.com"], + "userName": "edgeuser", + } + ], + }, + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_CreateOrUpdate_ProvisionOs.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_remote_support.py new file mode 100644 index 000000000000..bf28e5c9d1d7 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_remote_support.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_create_or_update_remote_support.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machine_jobs.begin_create_or_update( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + jobs_name="RemoteSupport", + resource={ + "properties": { + "accessLevel": "Diagnostics", + "expirationTimestamp": "2024-01-29T10:43:27.9471574Z", + "jobType": "RemoteSupport", + "type": "Enable", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_CreateOrUpdate_RemoteSupport.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_update_os.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_update_os.py new file mode 100644 index 000000000000..aef9af33703a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_create_or_update_update_os.py @@ -0,0 +1,97 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_create_or_update_update_os.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machine_jobs.begin_create_or_update( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + jobs_name="UpdateOs", + resource={ + "properties": { + "deploymentMode": "Deploy", + "jobType": "ProvisionOs", + "provisioningRequest": { + "customConfiguration": "eyJjdXN0b21Db25maWciOiAiZXhhbXBsZSBiYXNlNjQgZW5jb2RlZCBjb25maWcifQ==", + "deviceConfiguration": { + "hostName": "634b9db8-83e1-46ed-b391-c1614e2d0097", + "network": { + "networkAdapters": [ + { + "dnsAddressArray": ["8.8.8.8"], + "gateway": "", + "ipAddress": "", + "ipAddressRange": {"endIp": "", "startIp": ""}, + "ipAssignmentType": "Automatic", + "subnetMask": "", + "vlanId": "0", + } + ] + }, + "time": {"primaryTimeServer": "", "secondaryTimeServer": "", "timeZone": "UTC"}, + "webProxy": {"bypassList": [], "connectionUri": "https://microsoft.com/a", "port": ""}, + }, + "onboardingConfiguration": { + "arcVirtualMachineId": "634b9db8-83e1-46ed-b391-c1614e2d0097", + "location": "eastus", + "resourceId": "/subscriptions/ff0aa6da-20f8-44fe-9aee-381c8e8a4aeb/resourceGroups/bhukumar-test-rg/providers/Microsoft.HybridCompute/machines/bkumar-t1", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "type": "HybridComputeMachine", + }, + "osProfile": { + "gpgPubKey": "LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tXG5WZXJzaW9uOiBHbnVQRyB2MlxuXG5tUUVOQkZYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYXG4tLS0tLUVORCBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0t", + "imageHash": "sha256:b2c3d4e5f6789012345678901234567890abcdef1234567890abcdef12345678", + "operationType": "Update", + "osImageLocation": "https://aka.ms/aep/azlinux3.1", + "osName": "AzureLinux", + "osType": "AzureLinux", + "osVersion": "3.1", + "vsrVersion": "1.1.0", + }, + "target": "AzureLinux", + "userDetails": [ + { + "secretLocation": "https://bhukumar-test-kv.vault.azure.net/secrets/edgeuser/7b2d7db11bad4e1599cb6a0f4d2b2e00", + "secretType": "KeyVault", + "sshPubKey": ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7... edgeuser@example.com"], + "userName": "edgeuser", + } + ], + }, + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_CreateOrUpdate_UpdateOs.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_delete_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_delete_maximum_set_gen.py new file mode 100644 index 000000000000..8e63069e1f99 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_delete_maximum_set_gen.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.edge_machine_jobs.begin_delete( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + jobs_name="triggerLogCollection", + ).result() + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_collect_log.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_collect_log.py new file mode 100644 index 000000000000..284047223c81 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_collect_log.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_get_collect_log.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machine_jobs.get( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + jobs_name="collectLog", + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_Get_CollectLog.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_provision_os.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_provision_os.py new file mode 100644 index 000000000000..9fa796edf6c3 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_provision_os.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_get_provision_os.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machine_jobs.get( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + jobs_name="ProvisionOs", + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_Get_ProvisionOs.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_remote_support.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_remote_support.py new file mode 100644 index 000000000000..710cded8cacd --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_get_remote_support.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_get_remote_support.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machine_jobs.get( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + jobs_name="RemoteSupport", + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_Get_RemoteSupport.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_list_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_list_maximum_set_gen.py new file mode 100644 index 000000000000..e334d55f5381 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machine_jobs_list_maximum_set_gen.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machine_jobs_list_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machine_jobs.list( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine1", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachineJobs_List_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_create_or_update.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_create_or_update.py new file mode 100644 index 000000000000..4c34787732d1 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_create_or_update.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machines_create_or_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machines.begin_create_or_update( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine-1", + resource={ + "location": "eastus", + "properties": { + "arcMachineResourceGroupId": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg", + "arcMachineResourceId": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachines_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_delete.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_delete.py new file mode 100644 index 000000000000..d4a589e47740 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_delete.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machines_delete.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.edge_machines.begin_delete( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine-1", + ).result() + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachines_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_get.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_get.py new file mode 100644 index 000000000000..e06560ed21c2 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machines_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machines.get( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine-1", + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachines_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_resource_group.py new file mode 100644 index 000000000000..116ca2d85e7a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machines_list_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machines.list_by_resource_group( + resource_group_name="ArcInstance-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachines_ListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_list_by_subscription.py new file mode 100644 index 000000000000..d18ee3cddbbf --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machines_list_by_subscription.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machines.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachines_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_update.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_update.py new file mode 100644 index 000000000000..7300ccf27176 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/edge_machines_update.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python edge_machines_update.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_machines.begin_update( + resource_group_name="ArcInstance-rg", + edge_machine_name="machine-1", + properties={"tags": {"key2335": "beth"}}, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/EdgeMachines_Update.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py index f78b41f451f2..9d891c1151a1 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.clusters.begin_extend_software_assurance_benefit( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ExtendSoftwareAssuranceBenefit.json +# x-ms-original-file: 2025-12-01-preview/ExtendSoftwareAssuranceBenefit.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py index bc0beaa7f892..1f141a4e9e0f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) client.extensions.begin_upgrade( @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/Extensions_Upgrade.json +# x-ms-original-file: 2025-12-01-preview/Extensions_Upgrade.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py index 80a13f7e3706..d4062c63d048 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.arc_settings.generate_password( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GeneratePassword.json +# x-ms-original-file: 2025-12-01-preview/GeneratePassword.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py index 1de26279bf60..e99a3553c31b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.arc_settings.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetArcSetting.json +# x-ms-original-file: 2025-12-01-preview/GetArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py index ff2e1f696352..b948c9ca72c0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.clusters.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetCluster.json +# x-ms-original-file: 2025-12-01-preview/GetCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py index 3b80950e5927..76efe9a6a4d6 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,16 +27,17 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.deployment_settings.get( resource_group_name="test-rg", cluster_name="myCluster", + deployment_settings_name="default", ) print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetDeploymentSettings.json +# x-ms-original-file: 2025-12-01-preview/GetDeploymentSettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_edge_devices.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_edge_devices.py index 228b23fc744c..67463a443b6d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_edge_devices.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_edge_devices.py @@ -1,8 +1,9 @@ +# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -32,10 +33,11 @@ def main(): response = client.edge_devices.get( resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + edge_device_name="default", ) print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetEdgeDevices.json +# x-ms-original-file: 2025-12-01-preview/GetEdgeDevices.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py index d9c88b1ef2d2..df3f8598283d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.extensions.get( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetExtension.json +# x-ms-original-file: 2025-12-01-preview/GetExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py index aeb7ca479b79..6dbd14c1e3c4 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.offers.get( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetOffer.json +# x-ms-original-file: 2025-12-01-preview/GetOffer.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py index 6a83931928f3..bd88964cf98b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.publishers.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetPublisher.json +# x-ms-original-file: 2025-12-01-preview/GetPublisher.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py index a29a0f1dedd3..4554e4e31e7f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,16 +27,17 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.security_settings.get( resource_group_name="test-rg", cluster_name="myCluster", + security_settings_name="default", ) print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetSecuritySettings.json +# x-ms-original-file: 2025-12-01-preview/GetSecuritySettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py index bc48dcf9b23c..9fcdcb65477a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.skus.get( @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetSku.json +# x-ms-original-file: 2025-12-01-preview/GetSku.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py index 85ebdd02311d..3a09eb9f8afb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) response = client.update_runs.get( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetUpdateRuns.json +# x-ms-original-file: 2025-12-01-preview/GetUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py index 086099879925..74e3f97ab639 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) response = client.update_summaries.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetUpdateSummaries.json +# x-ms-original-file: 2025-12-01-preview/GetUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py index 546864198087..38225080a407 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) response = client.updates.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetUpdates.json +# x-ms-original-file: 2025-12-01-preview/GetUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py index 0bd99fa93554..cbf6548a40b0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) client.arc_settings.begin_initialize_disable_process( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/InitializeDisableProcess.json +# x-ms-original-file: 2025-12-01-preview/InitializeDisableProcess.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/kubernetes_versions_list_by_subscription_location_resource_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/kubernetes_versions_list_by_subscription_location_resource_maximum_set_gen.py new file mode 100644 index 000000000000..93d0b8fdd36a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/kubernetes_versions_list_by_subscription_location_resource_maximum_set_gen.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python kubernetes_versions_list_by_subscription_location_resource_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.kubernetes_versions.list_by_subscription_location_resource( + location="westus2", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-12-01-preview/KubernetesVersions_ListBySubscriptionLocationResource_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py index 55f2ae18c3ce..10f48c833ece 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.arc_settings.list_by_cluster( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListArcSettingsByCluster.json +# x-ms-original-file: 2025-12-01-preview/ListArcSettingsByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py index 8b0b66000dea..f53267670089 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.clusters.list_by_resource_group( @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListClustersByResourceGroup.json +# x-ms-original-file: 2025-12-01-preview/ListClustersByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py index 9bcd269d531f..1237132e4e03 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.clusters.list_by_subscription() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListClustersBySubscription.json +# x-ms-original-file: 2025-12-01-preview/ListClustersBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py index fbc026bb9fd8..6f100a0a7c95 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.deployment_settings.list_by_clusters( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListDeploymentSettingsByCluster.json +# x-ms-original-file: 2025-12-01-preview/ListDeploymentSettingsByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_edge_devices.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_edge_devices.py index 1330a9e554bb..058ccf85dd1c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_edge_devices.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_edge_devices.py @@ -1,8 +1,9 @@ +# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -37,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListEdgeDevices.json +# x-ms-original-file: 2025-12-01-preview/ListEdgeDevices.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py index 1c864d52b153..79fcb189d5a0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.extensions.list_by_arc_setting( @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListExtensionsByArcSetting.json +# x-ms-original-file: 2025-12-01-preview/ListExtensionsByArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py index bd7e0723602e..8b5ba09ab796 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.offers.list_by_cluster( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListOffersByCluster.json +# x-ms-original-file: 2025-12-01-preview/ListOffersByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py index be27cc21e4b9..20a1ee59fe2c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.offers.list_by_publisher( @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListOffersByPublisher.json +# x-ms-original-file: 2025-12-01-preview/ListOffersByPublisher.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py index 77550dbbd3a8..b417692c6eaa 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_publishers_by_cluster.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.publishers.list_by_cluster( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListPublishersByCluster.json +# x-ms-original-file: 2025-12-01-preview/ListPublishersByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py index 2be2a2fc7e13..bf1ae1df34bd 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.security_settings.list_by_clusters( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListSecuritySettingsByCluster.json +# x-ms-original-file: 2025-12-01-preview/ListSecuritySettingsByCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py index d130a53b57c1..f9bbcb0ac20d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.skus.list_by_offer( @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListSkusByOffer.json +# x-ms-original-file: 2025-12-01-preview/ListSkusByOffer.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py index 4bcc73bef2c1..38a461f61c17 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) response = client.update_runs.list( @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListUpdateRuns.json +# x-ms-original-file: 2025-12-01-preview/ListUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py index 50e3f08e336b..f053d4aa6b49 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) response = client.update_summaries.list( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListUpdateSummaries.json +# x-ms-original-file: 2025-12-01-preview/ListUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py index 25de657d5478..17ba20ece249 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) response = client.updates.list( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListUpdates.json +# x-ms-original-file: 2025-12-01-preview/ListUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/operations_list.py similarity index 82% rename from sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_operations.py rename to sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/operations_list.py index 299e0fbeebb1..d0ada3c758b3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/operations_list.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-azurestackhci # USAGE - python list_operations.py + python operations_list.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,9 +31,10 @@ def main(): ) response = client.operations.list() - print(response) + for item in response: + print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/operations/stable/2024-04-01/examples/ListOperations.json +# x-ms-original-file: 2025-12-01-preview/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_get_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_get_maximum_set_gen.py new file mode 100644 index 000000000000..c764cbc2a7af --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_get_maximum_set_gen.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python os_images_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.os_images.get( + location="arowdcr", + os_image_name="10.2408.0.1", + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/OsImages_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_list_by_subscription_location_resource_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_list_by_subscription_location_resource_maximum_set_gen.py new file mode 100644 index 000000000000..5c29b3091daa --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/os_images_list_by_subscription_location_resource_maximum_set_gen.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python os_images_list_by_subscription_location_resource_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.os_images.list_by_subscription_location_resource( + location="westus2", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-12-01-preview/OsImages_ListBySubscriptionLocationResource_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py index 9a0147936c40..e583578a410d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.arc_settings.update( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PatchArcSetting.json +# x-ms-original-file: 2025-12-01-preview/PatchArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py index e89b82104399..d571d064eb71 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.extensions.begin_update( @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PatchExtension.json +# x-ms-original-file: 2025-12-01-preview/PatchExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_get_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_get_maximum_set_gen.py new file mode 100644 index 000000000000..b6dca6591bf9 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_get_maximum_set_gen.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python platform_updates_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.platform_updates.get( + location="westus2", + platform_update_name="10.2408.0.1", + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/PlatformUpdates_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_list_by_location_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_list_by_location_maximum_set_gen.py new file mode 100644 index 000000000000..0454f62743f9 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/platform_updates_list_by_location_maximum_set_gen.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python platform_updates_list_by_location_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.platform_updates.list( + location="westus2", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-12-01-preview/PlatformUpdates_ListByLocation_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py index 327d1fe498b7..6cf3e32b41c6 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) client.updates.begin_post( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PostUpdates.json +# x-ms-original-file: 2025-12-01-preview/PostUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings.py index bf66a48952af..728027e39fbd 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings.py @@ -1,8 +1,9 @@ +# 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,12 +28,13 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.deployment_settings.begin_create_or_update( resource_group_name="test-rg", cluster_name="myCluster", + deployment_settings_name="default", resource={ "properties": { "arcNodeResourceIds": [ @@ -96,12 +98,14 @@ def main(): }, "infrastructureNetwork": [ { + "dnsServerConfig": "UseDnsServer", "dnsServers": ["10.57.50.90"], "gateway": "255.255.248.0", "ipPools": [{"endingAddress": "10.57.48.66", "startingAddress": "10.57.48.60"}], "subnetMask": "255.255.248.0", } ], + "isManagementCluster": True, "namingPrefix": "ms169", "observability": { "episodicDataUpload": True, @@ -180,6 +184,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutDeploymentSettings.json +# x-ms-original-file: 2025-12-01-preview/PutDeploymentSettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_with_ad_less.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_with_ad_less.py new file mode 100644 index 000000000000..262211ebd22e --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_deployment_settings_with_ad_less.py @@ -0,0 +1,188 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_deployment_settings_with_ad_less.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.deployment_settings.begin_create_or_update( + resource_group_name="test-rg", + cluster_name="myCluster", + deployment_settings_name="default", + resource={ + "properties": { + "arcNodeResourceIds": [ + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2", + ], + "deploymentConfiguration": { + "scaleUnits": [ + { + "deploymentData": { + "adouPath": "OU=ms169,DC=ASZ1PLab8,DC=nttest,DC=microsoft,DC=com", + "cluster": { + "azureServiceEndpoint": "core.windows.net", + "cloudAccountName": "myasestoragacct", + "name": "testHCICluster", + "witnessPath": "Cloud", + "witnessType": "Cloud", + }, + "domainFqdn": "ASZ1PLab8.nttest.microsoft.com", + "hostNetwork": { + "enableStorageAutoIp": False, + "intents": [ + { + "adapter": ["Port2"], + "adapterPropertyOverrides": { + "jumboPacket": "1514", + "networkDirect": "Enabled", + "networkDirectTechnology": "iWARP", + }, + "name": "Compute_Management", + "overrideAdapterProperty": False, + "overrideQosPolicy": False, + "overrideVirtualSwitchConfiguration": False, + "qosPolicyOverrides": { + "bandwidthPercentage_SMB": "50", + "priorityValue8021Action_Cluster": "7", + "priorityValue8021Action_SMB": "3", + }, + "trafficType": ["Compute", "Management"], + "virtualSwitchConfigurationOverrides": { + "enableIov": "True", + "loadBalancingAlgorithm": "HyperVPort", + }, + } + ], + "storageConnectivitySwitchless": True, + "storageNetworks": [ + { + "name": "Storage1Network", + "networkAdapterName": "Port3", + "storageAdapterIPInfo": [ + { + "ipv4Address": "10.57.48.60", + "physicalNode": "string", + "subnetMask": "255.255.248.0", + } + ], + "vlanId": "5", + } + ], + }, + "identityProvider": "LocalIdentity", + "infrastructureNetwork": [ + { + "dnsZones": [{"dnsForwarder": ["192.168.1.1"], "dnsZoneName": "contoso.com"}], + "gateway": "255.255.248.0", + "ipPools": [{"endingAddress": "10.57.48.66", "startingAddress": "10.57.48.60"}], + "subnetMask": "255.255.248.0", + } + ], + "namingPrefix": "ms169", + "observability": { + "episodicDataUpload": True, + "euLocation": False, + "streamingDataClient": True, + }, + "optionalServices": {"customLocation": "customLocationName"}, + "physicalNodes": [ + {"ipv4Address": "10.57.51.224", "name": "ms169host"}, + {"ipv4Address": "10.57.53.236", "name": "ms154host"}, + ], + "sdnIntegration": { + "networkController": { + "macAddressPoolStart": "00-0D-3A-1B-C7-21", + "macAddressPoolStop": "00-0D-3A-1B-C7-29", + "networkVirtualizationEnabled": True, + } + }, + "secrets": [ + { + "eceSecretName": "BMCAdminUserCred", + "secretLocation": "https://sclusterkvnirhci35.vault.azure.net/secrets/cluster-34232342-BmcAdminUser-f5bcc1d9-23af-4ae9-aca1-041d0f593a63/9276354aabfc492fa9b2cdbefb54ae4b", + "secretName": "cluster1-BmcAdminUser-f5bcc1d9-23af-4ae9-aca1-041d0f593a63", + }, + { + "eceSecretName": "AzureStackLCMUserCredential", + "secretLocation": "https://sclusterkvnirhci35.vault.azure.net/secrets/cluster-34232342-AzureStackLCMUserCredential-f5bcc1d9-23af-4ae9-aca1-041d0f593a63/9276354aabfc492fa9b2cdbefb54ae4c", + "secretName": "cluster2-AzureStackLCMUserCredential-f5bcc1d9-23af-4ae9-aca1-041d0f593a63", + }, + ], + "secretsLocation": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-xxxxxxx/resourceGroups/test-rg/providers/Microsoft.KeyVault/vaults/abcd123", + "securitySettings": { + "bitlockerBootVolume": True, + "bitlockerDataVolumes": True, + "credentialGuardEnforced": False, + "driftControlEnforced": True, + "drtmProtection": True, + "hvciProtection": True, + "sideChannelMitigationEnforced": True, + "smbClusterEncryption": False, + "smbSigningEnforced": True, + "wdacEnforced": True, + }, + "storage": {"configurationMode": "Express"}, + }, + "sbePartnerInfo": { + "credentialList": [ + { + "eceSecretName": "DownloadConnectorCred", + "secretLocation": "https://sclusterkvnirhci35.vault.azure.net/secrets/cluster-34232342-DownloadConnectorCred-f5bcc1d9-23af-4ae9-aca1-041d0f593a63/9276354aabfc492fa9b2cdbefb54ae4b", + "secretName": "cluster1-DownloadConnectorCred-f5bcc1d9-23af-4ae9-aca1-041d0f593a63", + } + ], + "partnerProperties": [ + {"name": "EnableBMCIpV6", "value": "false"}, + {"name": "PhoneHomePort", "value": "1653"}, + {"name": "BMCSecurityState", "value": "HighSecurity"}, + ], + "sbeDeploymentInfo": { + "family": "Gen5", + "publisher": "Contoso", + "sbeManifestCreationDate": "2023-07-25T02:40:33Z", + "sbeManifestSource": "default", + "version": "4.0.2309.13", + }, + }, + } + ], + "version": "string", + }, + "deploymentMode": "Deploy", + "operationType": "ClusterProvisioning", + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/PutDeploymentSettingsWithADLess.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py index 3cd16523fc9e..c06f3934a6ff 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.extensions.begin_create( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutExtension.json +# x-ms-original-file: 2025-12-01-preview/PutExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_security_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_security_settings.py index 127ab2d7eef3..04113ee61f1d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_security_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_security_settings.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,12 +27,13 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.security_settings.begin_create_or_update( resource_group_name="test-rg", cluster_name="myCluster", + security_settings_name="default", resource={ "properties": { "securedCoreComplianceAssignment": "Audit", @@ -44,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutSecuritySettings.json +# x-ms-original-file: 2025-12-01-preview/PutSecuritySettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py index bdcf92d50900..3bcf10829309 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) response = client.update_runs.put( @@ -64,6 +64,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutUpdateRuns.json +# x-ms-original-file: 2025-12-01-preview/PutUpdateRuns.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py index 22578e6fc752..fe748857b478 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) response = client.update_summaries.put( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutUpdateSummaries.json +# x-ms-original-file: 2025-12-01-preview/PutUpdateSummaries.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py index 80b39ee72db3..04edd6bd7859 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="b8d594e5-51f3-4c11-9c54-a7771b81c712", + subscription_id="SUBSCRIPTION_ID", ) response = client.updates.put( @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutUpdates.json +# x-ms-original-file: 2025-12-01-preview/PutUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/reconcile_arc_settings.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/reconcile_arc_settings.py new file mode 100644 index 000000000000..1f8dd8bb0d3a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/reconcile_arc_settings.py @@ -0,0 +1,51 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python reconcile_arc_settings.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.arc_settings.begin_reconcile( + resource_group_name="test-rg", + cluster_name="myCluster", + arc_setting_name="default", + reconcile_arc_settings_request={ + "properties": { + "clusterNodes": [ + "/subscriptions/sub1/resourceGroup/res1/providers/Microsoft.HybridCompute/machines/m1", + "/subscriptions/sub1/resourceGroup/res1/providers/Microsoft.HybridCompute/machines/m2", + ] + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/reconcileArcSettings.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py index 6b9f4c3fd3ab..095488ff98d3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.clusters.begin_trigger_log_collection( @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/TriggerLogCollection.json +# x-ms-original-file: 2025-12-01-preview/TriggerLogCollection.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py index 7c72f4ccb205..3a292fbcc760 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) response = client.clusters.update( @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/UpdateCluster.json +# x-ms-original-file: 2025-12-01-preview/UpdateCluster.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_get_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_get_maximum_set_gen.py new file mode 100644 index 000000000000..f63ddc169293 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_get_maximum_set_gen.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python update_contents_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.update_contents.get( + location="westus2", + update_content_name="12.2510.0.1", + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/UpdateContents_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_list_by_location_maximum_set_gen.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_list_by_location_maximum_set_gen.py new file mode 100644 index 000000000000..d3377b568519 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_contents_list_by_location_maximum_set_gen.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python update_contents_list_by_location_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.update_contents.list( + location="westus2", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-12-01-preview/UpdateContents_ListByLocation_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py index 70949ff15cf3..5176591f656a 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -27,7 +27,7 @@ def main(): client = AzureStackHCIClient( credential=DefaultAzureCredential(), - subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + subscription_id="SUBSCRIPTION_ID", ) client.clusters.begin_upload_certificate( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/UploadCertificate.json +# x-ms-original-file: 2025-12-01-preview/UploadCertificate.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_edge_devices.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_edge_devices.py new file mode 100644 index 000000000000..5773960bd827 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_edge_devices.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python validate_edge_devices.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.edge_devices.begin_validate( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1", + edge_device_name="default", + validate_request={ + "additionalInfo": "test", + "edgeDeviceIds": [ + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-1/edgeDevices/default", + "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/ArcInstance-rg/providers/Microsoft.HybridCompute/machines/Node-2/edgeDevices/default", + ], + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-12-01-preview/ValidateEdgeDevices.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_ownership_vouchers_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_ownership_vouchers_by_resource_group.py new file mode 100644 index 000000000000..3500bbbeab88 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validate_ownership_vouchers_by_resource_group.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python validate_ownership_vouchers_by_resource_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.ownership_vouchers.validate( + resource_group_name="ArcInstance-rg", + location="westus", + validation_request={ + "ownershipVoucherDetails": [ + {"ownerKeyType": "MicrosoftManaged", "ownershipVoucher": "Device Model Ownership content"} + ] + }, + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/ValidateOwnershipVouchers_ByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_get.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_get.py new file mode 100644 index 000000000000..070c5a6f6362 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python validated_solution_recipes_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.validated_solution_recipes.get( + location="westus2", + validated_solution_recipe_name="10.2408.0", + ) + print(response) + + +# x-ms-original-file: 2025-12-01-preview/ValidatedSolutionRecipes_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_list_by_subscription_location_resource.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_list_by_subscription_location_resource.py new file mode 100644 index 000000000000..4cc6bdbec1f9 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/validated_solution_recipes_list_by_subscription_location_resource.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.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python validated_solution_recipes_list_by_subscription_location_resource.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.validated_solution_recipes.list_by_subscription_location_resource( + location="westus2", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-12-01-preview/ValidatedSolutionRecipes_ListBySubscriptionLocationResource.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/conftest.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/conftest.py index 06f4bcf79e6c..3ff571d1a949 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/conftest.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/conftest.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): azurestackhci_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_arc_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_arc_settings_operations.py index 215715697c64..ffbf7e60f7f7 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_arc_settings_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_arc_settings_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,24 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_cluster(self, resource_group): - response = self.client.arc_settings.list_by_cluster( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): + def test_arc_settings_get(self, resource_group): response = self.client.arc_settings.get( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -45,26 +32,31 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create(self, resource_group): + def test_arc_settings_create(self, resource_group): response = self.client.arc_settings.create( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", arc_setting={ - "aggregateState": "str", - "arcApplicationClientId": "str", - "arcApplicationObjectId": "str", - "arcApplicationTenantId": "str", - "arcInstanceResourceGroup": "str", - "arcServicePrincipalObjectId": "str", - "connectivityProperties": {}, - "defaultExtensions": [{"category": "str", "consentTime": "2020-02-20 00:00:00"}], "id": "str", "name": "str", - "perNodeDetails": [ - {"arcInstance": "str", "arcNodeServicePrincipalObjectId": "str", "name": "str", "state": "str"} - ], - "provisioningState": "str", + "properties": { + "aggregateState": "str", + "arcApplicationClientId": "str", + "arcApplicationObjectId": "str", + "arcApplicationTenantId": "str", + "arcInstanceResourceGroup": "str", + "arcServicePrincipalObjectId": "str", + "connectivityProperties": { + "enabled": bool, + "serviceConfigurations": [{"port": 0, "serviceName": "str"}], + }, + "defaultExtensions": [{"category": "str", "consentTime": "2020-02-20 00:00:00"}], + "perNodeDetails": [ + {"arcInstance": "str", "arcNodeServicePrincipalObjectId": "str", "name": "str", "state": "str"} + ], + "provisioningState": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -75,7 +67,6 @@ def test_create(self, resource_group): }, "type": "str", }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -83,13 +74,20 @@ def test_create(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_arc_settings_update(self, resource_group): response = self.client.arc_settings.update( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - arc_setting={"connectivityProperties": {}, "tags": {"str": "str"}}, - api_version="2024-04-01", + arc_setting={ + "properties": { + "connectivityProperties": { + "enabled": bool, + "serviceConfigurations": [{"port": 0, "serviceName": "str"}], + } + }, + "tags": {"str": "str"}, + }, ) # please add some check logic here by yourself @@ -97,12 +95,11 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_arc_settings_begin_delete(self, resource_group): response = self.client.arc_settings.begin_delete( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -110,12 +107,22 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_generate_password(self, resource_group): + def test_arc_settings_list_by_cluster(self, resource_group): + response = self.client.arc_settings.list_by_cluster( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_arc_settings_generate_password(self, resource_group): response = self.client.arc_settings.generate_password( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -123,12 +130,11 @@ def test_generate_password(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_identity(self, resource_group): + def test_arc_settings_begin_create_identity(self, resource_group): response = self.client.arc_settings.begin_create_identity( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -136,12 +142,24 @@ def test_begin_create_identity(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_consent_and_install_default_extensions(self, resource_group): + def test_arc_settings_begin_reconcile(self, resource_group): + response = self.client.arc_settings.begin_reconcile( + resource_group_name=resource_group.name, + cluster_name="str", + arc_setting_name="str", + reconcile_arc_settings_request={"properties": {"clusterNodes": ["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_arc_settings_consent_and_install_default_extensions(self, resource_group): response = self.client.arc_settings.consent_and_install_default_extensions( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -149,12 +167,11 @@ def test_consent_and_install_default_extensions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_initialize_disable_process(self, resource_group): + def test_arc_settings_begin_initialize_disable_process(self, resource_group): response = self.client.arc_settings.begin_initialize_disable_process( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_arc_settings_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_arc_settings_operations_async.py index 5dec219037fb..c8d3d0747431 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_arc_settings_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_arc_settings_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,24 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_cluster(self, resource_group): - response = self.client.arc_settings.list_by_cluster( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-04-01", - ) - 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_get(self, resource_group): + async def test_arc_settings_get(self, resource_group): response = await self.client.arc_settings.get( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -46,26 +33,31 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create(self, resource_group): + async def test_arc_settings_create(self, resource_group): response = await self.client.arc_settings.create( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", arc_setting={ - "aggregateState": "str", - "arcApplicationClientId": "str", - "arcApplicationObjectId": "str", - "arcApplicationTenantId": "str", - "arcInstanceResourceGroup": "str", - "arcServicePrincipalObjectId": "str", - "connectivityProperties": {}, - "defaultExtensions": [{"category": "str", "consentTime": "2020-02-20 00:00:00"}], "id": "str", "name": "str", - "perNodeDetails": [ - {"arcInstance": "str", "arcNodeServicePrincipalObjectId": "str", "name": "str", "state": "str"} - ], - "provisioningState": "str", + "properties": { + "aggregateState": "str", + "arcApplicationClientId": "str", + "arcApplicationObjectId": "str", + "arcApplicationTenantId": "str", + "arcInstanceResourceGroup": "str", + "arcServicePrincipalObjectId": "str", + "connectivityProperties": { + "enabled": bool, + "serviceConfigurations": [{"port": 0, "serviceName": "str"}], + }, + "defaultExtensions": [{"category": "str", "consentTime": "2020-02-20 00:00:00"}], + "perNodeDetails": [ + {"arcInstance": "str", "arcNodeServicePrincipalObjectId": "str", "name": "str", "state": "str"} + ], + "provisioningState": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -76,7 +68,6 @@ async def test_create(self, resource_group): }, "type": "str", }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -84,13 +75,20 @@ async def test_create(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_arc_settings_update(self, resource_group): response = await self.client.arc_settings.update( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - arc_setting={"connectivityProperties": {}, "tags": {"str": "str"}}, - api_version="2024-04-01", + arc_setting={ + "properties": { + "connectivityProperties": { + "enabled": bool, + "serviceConfigurations": [{"port": 0, "serviceName": "str"}], + } + }, + "tags": {"str": "str"}, + }, ) # please add some check logic here by yourself @@ -98,13 +96,12 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_arc_settings_begin_delete(self, resource_group): response = await ( await self.client.arc_settings.begin_delete( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -113,12 +110,22 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_generate_password(self, resource_group): + async def test_arc_settings_list_by_cluster(self, resource_group): + response = self.client.arc_settings.list_by_cluster( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_arc_settings_generate_password(self, resource_group): response = await self.client.arc_settings.generate_password( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -126,13 +133,12 @@ async def test_generate_password(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_identity(self, resource_group): + async def test_arc_settings_begin_create_identity(self, resource_group): response = await ( await self.client.arc_settings.begin_create_identity( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -141,12 +147,26 @@ async def test_begin_create_identity(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_consent_and_install_default_extensions(self, resource_group): + async def test_arc_settings_begin_reconcile(self, resource_group): + response = await ( + await self.client.arc_settings.begin_reconcile( + resource_group_name=resource_group.name, + cluster_name="str", + arc_setting_name="str", + reconcile_arc_settings_request={"properties": {"clusterNodes": ["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_arc_settings_consent_and_install_default_extensions(self, resource_group): response = await self.client.arc_settings.consent_and_install_default_extensions( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -154,13 +174,12 @@ async def test_consent_and_install_default_extensions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_initialize_disable_process(self, resource_group): + async def test_arc_settings_begin_initialize_disable_process(self, resource_group): response = await ( await self.client.arc_settings.begin_initialize_disable_process( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations.py index 8c4c30e95932..528f5a88bacf 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,32 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): - response = self.client.clusters.list_by_subscription( - api_version="2024-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): - response = self.client.clusters.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2024-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): + def test_clusters_get(self, resource_group): response = self.client.clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -53,115 +31,144 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create(self, resource_group): + def test_clusters_create(self, resource_group): response = self.client.clusters.create( resource_group_name=resource_group.name, cluster_name="str", cluster={ "location": "str", - "aadApplicationObjectId": "str", - "aadClientId": "str", - "aadServicePrincipalObjectId": "str", - "aadTenantId": "str", - "billingModel": "str", - "cloudId": "str", - "cloudManagementEndpoint": "str", - "connectivityStatus": "str", - "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, "id": "str", - "isolatedVmAttestationConfiguration": { - "attestationResourceId": "str", - "attestationServiceEndpoint": "str", - "relyingPartyServiceEndpoint": "str", - }, - "lastBillingTimestamp": "2020-02-20 00:00:00", - "lastSyncTimestamp": "2020-02-20 00:00:00", - "logCollectionProperties": { - "fromDate": "2020-02-20 00:00:00", - "lastLogGenerated": "2020-02-20 00:00:00", - "logCollectionSessionDetails": [ - { - "correlationId": "str", - "endTimeCollected": "2020-02-20 00:00:00", - "logCollectionError": {"errorCode": "str", "errorMessage": "str"}, - "logCollectionJobType": "str", - "logCollectionStatus": "str", - "logEndTime": "2020-02-20 00:00:00", - "logSize": 0, - "logStartTime": "2020-02-20 00:00:00", - "timeCollected": "2020-02-20 00:00:00", - } - ], - "toDate": "2020-02-20 00:00:00", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, + "kind": "str", "name": "str", - "principalId": "str", - "provisioningState": "str", - "registrationTimestamp": "2020-02-20 00:00:00", - "remoteSupportProperties": { - "accessLevel": "str", - "expirationTimeStamp": "2020-02-20 00:00:00", - "remoteSupportNodeSettings": [ - { - "arcResourceId": "str", - "connectionErrorMessage": "str", - "connectionStatus": "str", - "createdAt": "2020-02-20 00:00:00", - "state": "str", - "transcriptLocation": "str", - "updatedAt": "2020-02-20 00:00:00", - } - ], - "remoteSupportSessionDetails": [ - { - "accessLevel": "str", - "duration": 0, - "nodeName": "str", - "sessionEndTime": "2020-02-20 00:00:00", - "sessionStartTime": "2020-02-20 00:00:00", - } - ], - "remoteSupportType": "str", - }, - "reportedProperties": { - "clusterId": "str", - "clusterName": "str", - "clusterType": "str", - "clusterVersion": "str", - "diagnosticLevel": "str", - "imdsAttestation": "str", - "lastUpdated": "2020-02-20 00:00:00", - "manufacturer": "str", - "nodes": [ - { - "coreCount": 0.0, - "ehcResourceId": "str", - "id": 0.0, - "lastLicensingTimestamp": "2020-02-20 00:00:00", - "manufacturer": "str", - "memoryInGiB": 0.0, - "model": "str", - "name": "str", - "nodeType": "str", - "oemActivation": "str", - "osDisplayVersion": "str", - "osName": "str", - "osVersion": "str", - "serialNumber": "str", - "windowsServerSubscription": "str", - } - ], - "oemActivation": "str", - "supportedCapabilities": ["str"], - }, - "resourceProviderObjectId": "str", - "serviceEndpoint": "str", - "softwareAssuranceProperties": { - "lastUpdated": "2020-02-20 00:00:00", - "softwareAssuranceIntent": "str", - "softwareAssuranceStatus": "str", + "properties": { + "aadApplicationObjectId": "str", + "aadClientId": "str", + "aadServicePrincipalObjectId": "str", + "aadTenantId": "str", + "billingModel": "str", + "cloudId": "str", + "cloudManagementEndpoint": "str", + "clusterPattern": "str", + "confidentialVmProperties": { + "confidentialVmIntent": "str", + "confidentialVmStatus": "str", + "confidentialVmStatusSummary": "str", + }, + "connectivityStatus": "str", + "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, + "identityProvider": "str", + "isManagementCluster": bool, + "isolatedVmAttestationConfiguration": { + "attestationResourceId": "str", + "attestationServiceEndpoint": "str", + "relyingPartyServiceEndpoint": "str", + }, + "lastBillingTimestamp": "2020-02-20 00:00:00", + "lastSyncTimestamp": "2020-02-20 00:00:00", + "localAvailabilityZones": [{"localAvailabilityZoneName": "str", "nodes": ["str"]}], + "logCollectionProperties": { + "fromDate": "2020-02-20 00:00:00", + "lastLogGenerated": "2020-02-20 00:00:00", + "logCollectionSessionDetails": [ + { + "correlationId": "str", + "endTimeCollected": "2020-02-20 00:00:00", + "logCollectionError": {"errorCode": "str", "errorMessage": "str"}, + "logCollectionJobType": "str", + "logCollectionStatus": "str", + "logEndTime": "2020-02-20 00:00:00", + "logSize": 0, + "logStartTime": "2020-02-20 00:00:00", + "timeCollected": "2020-02-20 00:00:00", + } + ], + "toDate": "2020-02-20 00:00:00", + }, + "provisioningState": "str", + "registrationTimestamp": "2020-02-20 00:00:00", + "remoteSupportProperties": { + "accessLevel": "str", + "expirationTimeStamp": "2020-02-20 00:00:00", + "remoteSupportNodeSettings": [ + { + "arcResourceId": "str", + "connectionErrorMessage": "str", + "connectionStatus": "str", + "createdAt": "2020-02-20 00:00:00", + "state": "str", + "transcriptLocation": "str", + "updatedAt": "2020-02-20 00:00:00", + } + ], + "remoteSupportSessionDetails": [ + { + "accessLevel": "str", + "duration": 0, + "nodeName": "str", + "sessionEndTime": "2020-02-20 00:00:00", + "sessionStartTime": "2020-02-20 00:00:00", + } + ], + "remoteSupportType": "str", + }, + "reportedProperties": { + "clusterId": "str", + "clusterName": "str", + "clusterType": "str", + "clusterVersion": "str", + "diagnosticLevel": "str", + "hardwareClass": "str", + "imdsAttestation": "str", + "lastUpdated": "2020-02-20 00:00:00", + "manufacturer": "str", + "msiExpirationTimeStamp": "2020-02-20 00:00:00", + "nodes": [ + { + "coreCount": 0.0, + "ehcResourceId": "str", + "id": 0.0, + "lastLicensingTimestamp": "2020-02-20 00:00:00", + "manufacturer": "str", + "memoryInGiB": 0.0, + "model": "str", + "name": "str", + "nodeType": "str", + "oemActivation": "str", + "osDisplayVersion": "str", + "osName": "str", + "osVersion": "str", + "serialNumber": "str", + "windowsServerSubscription": "str", + } + ], + "oemActivation": "str", + "supportedCapabilities": ["str"], + }, + "resourceProviderObjectId": "str", + "ring": "str", + "sdnProperties": { + "sdnApiAddress": "str", + "sdnDomainName": "str", + "sdnIntegrationIntent": "str", + "sdnStatus": "str", + }, + "secretsLocations": [{"secretsLocation": "str", "secretsType": "str"}], + "serviceEndpoint": "str", + "softwareAssuranceProperties": { + "lastUpdated": "2020-02-20 00:00:00", + "softwareAssuranceIntent": "str", + "softwareAssuranceStatus": "str", + }, + "status": "str", + "supportStatus": "str", + "trialDaysRemaining": 0.0, }, - "status": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -171,12 +178,8 @@ def test_create(self, resource_group): "lastModifiedByType": "str", }, "tags": {"str": "str"}, - "tenantId": "str", - "trialDaysRemaining": 0.0, "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -184,22 +187,25 @@ def test_create(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_clusters_update(self, resource_group): response = self.client.clusters.update( resource_group_name=resource_group.name, cluster_name="str", cluster={ - "aadClientId": "str", - "aadTenantId": "str", - "cloudManagementEndpoint": "str", - "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, - "principalId": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "aadClientId": "str", + "aadTenantId": "str", + "cloudManagementEndpoint": "str", + "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, + }, "tags": {"str": "str"}, - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -207,11 +213,10 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_clusters_begin_delete(self, resource_group): response = self.client.clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -219,12 +224,41 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_upload_certificate(self, resource_group): + def test_clusters_list_by_resource_group(self, resource_group): + response = self.client.clusters.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_clusters_list_by_subscription(self, resource_group): + response = self.client.clusters.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_begin_update_secrets_locations(self, resource_group): + response = self.client.clusters.begin_update_secrets_locations( + resource_group_name=resource_group.name, + cluster_name="str", + body={"properties": [{"secretsLocation": "str", "secretsType": "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_upload_certificate(self, resource_group): response = self.client.clusters.begin_upload_certificate( resource_group_name=resource_group.name, cluster_name="str", upload_certificate_request={"properties": {"certificates": ["str"]}}, - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -232,11 +266,10 @@ def test_begin_upload_certificate(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_identity(self, resource_group): + def test_clusters_begin_create_identity(self, resource_group): response = self.client.clusters.begin_create_identity( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -244,12 +277,11 @@ def test_begin_create_identity(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_extend_software_assurance_benefit(self, resource_group): + def test_clusters_begin_extend_software_assurance_benefit(self, resource_group): response = self.client.clusters.begin_extend_software_assurance_benefit( resource_group_name=resource_group.name, cluster_name="str", software_assurance_change_request={"properties": {"softwareAssuranceIntent": "str"}}, - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -257,12 +289,23 @@ def test_begin_extend_software_assurance_benefit(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_trigger_log_collection(self, resource_group): + def test_clusters_begin_change_ring(self, resource_group): + response = self.client.clusters.begin_change_ring( + resource_group_name=resource_group.name, + cluster_name="str", + change_ring_request={"properties": {"targetRing": "str"}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_clusters_begin_trigger_log_collection(self, resource_group): response = self.client.clusters.begin_trigger_log_collection( resource_group_name=resource_group.name, cluster_name="str", log_collection_request={"properties": {"fromDate": "2020-02-20 00:00:00", "toDate": "2020-02-20 00:00:00"}}, - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -270,7 +313,7 @@ def test_begin_trigger_log_collection(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_configure_remote_support(self, resource_group): + def test_clusters_begin_configure_remote_support(self, resource_group): response = self.client.clusters.begin_configure_remote_support( resource_group_name=resource_group.name, cluster_name="str", @@ -281,7 +324,6 @@ def test_begin_configure_remote_support(self, resource_group): "remoteSupportType": "str", } }, - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations_async.py index d3fd2e9c66c9..79f4b001e509 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_clusters_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,32 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): - response = self.client.clusters.list_by_subscription( - api_version="2024-04-01", - ) - 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_list_by_resource_group(self, resource_group): - response = self.client.clusters.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2024-04-01", - ) - 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_get(self, resource_group): + async def test_clusters_get(self, resource_group): response = await self.client.clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -54,115 +32,144 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create(self, resource_group): + async def test_clusters_create(self, resource_group): response = await self.client.clusters.create( resource_group_name=resource_group.name, cluster_name="str", cluster={ "location": "str", - "aadApplicationObjectId": "str", - "aadClientId": "str", - "aadServicePrincipalObjectId": "str", - "aadTenantId": "str", - "billingModel": "str", - "cloudId": "str", - "cloudManagementEndpoint": "str", - "connectivityStatus": "str", - "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, "id": "str", - "isolatedVmAttestationConfiguration": { - "attestationResourceId": "str", - "attestationServiceEndpoint": "str", - "relyingPartyServiceEndpoint": "str", - }, - "lastBillingTimestamp": "2020-02-20 00:00:00", - "lastSyncTimestamp": "2020-02-20 00:00:00", - "logCollectionProperties": { - "fromDate": "2020-02-20 00:00:00", - "lastLogGenerated": "2020-02-20 00:00:00", - "logCollectionSessionDetails": [ - { - "correlationId": "str", - "endTimeCollected": "2020-02-20 00:00:00", - "logCollectionError": {"errorCode": "str", "errorMessage": "str"}, - "logCollectionJobType": "str", - "logCollectionStatus": "str", - "logEndTime": "2020-02-20 00:00:00", - "logSize": 0, - "logStartTime": "2020-02-20 00:00:00", - "timeCollected": "2020-02-20 00:00:00", - } - ], - "toDate": "2020-02-20 00:00:00", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, + "kind": "str", "name": "str", - "principalId": "str", - "provisioningState": "str", - "registrationTimestamp": "2020-02-20 00:00:00", - "remoteSupportProperties": { - "accessLevel": "str", - "expirationTimeStamp": "2020-02-20 00:00:00", - "remoteSupportNodeSettings": [ - { - "arcResourceId": "str", - "connectionErrorMessage": "str", - "connectionStatus": "str", - "createdAt": "2020-02-20 00:00:00", - "state": "str", - "transcriptLocation": "str", - "updatedAt": "2020-02-20 00:00:00", - } - ], - "remoteSupportSessionDetails": [ - { - "accessLevel": "str", - "duration": 0, - "nodeName": "str", - "sessionEndTime": "2020-02-20 00:00:00", - "sessionStartTime": "2020-02-20 00:00:00", - } - ], - "remoteSupportType": "str", - }, - "reportedProperties": { - "clusterId": "str", - "clusterName": "str", - "clusterType": "str", - "clusterVersion": "str", - "diagnosticLevel": "str", - "imdsAttestation": "str", - "lastUpdated": "2020-02-20 00:00:00", - "manufacturer": "str", - "nodes": [ - { - "coreCount": 0.0, - "ehcResourceId": "str", - "id": 0.0, - "lastLicensingTimestamp": "2020-02-20 00:00:00", - "manufacturer": "str", - "memoryInGiB": 0.0, - "model": "str", - "name": "str", - "nodeType": "str", - "oemActivation": "str", - "osDisplayVersion": "str", - "osName": "str", - "osVersion": "str", - "serialNumber": "str", - "windowsServerSubscription": "str", - } - ], - "oemActivation": "str", - "supportedCapabilities": ["str"], - }, - "resourceProviderObjectId": "str", - "serviceEndpoint": "str", - "softwareAssuranceProperties": { - "lastUpdated": "2020-02-20 00:00:00", - "softwareAssuranceIntent": "str", - "softwareAssuranceStatus": "str", + "properties": { + "aadApplicationObjectId": "str", + "aadClientId": "str", + "aadServicePrincipalObjectId": "str", + "aadTenantId": "str", + "billingModel": "str", + "cloudId": "str", + "cloudManagementEndpoint": "str", + "clusterPattern": "str", + "confidentialVmProperties": { + "confidentialVmIntent": "str", + "confidentialVmStatus": "str", + "confidentialVmStatusSummary": "str", + }, + "connectivityStatus": "str", + "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, + "identityProvider": "str", + "isManagementCluster": bool, + "isolatedVmAttestationConfiguration": { + "attestationResourceId": "str", + "attestationServiceEndpoint": "str", + "relyingPartyServiceEndpoint": "str", + }, + "lastBillingTimestamp": "2020-02-20 00:00:00", + "lastSyncTimestamp": "2020-02-20 00:00:00", + "localAvailabilityZones": [{"localAvailabilityZoneName": "str", "nodes": ["str"]}], + "logCollectionProperties": { + "fromDate": "2020-02-20 00:00:00", + "lastLogGenerated": "2020-02-20 00:00:00", + "logCollectionSessionDetails": [ + { + "correlationId": "str", + "endTimeCollected": "2020-02-20 00:00:00", + "logCollectionError": {"errorCode": "str", "errorMessage": "str"}, + "logCollectionJobType": "str", + "logCollectionStatus": "str", + "logEndTime": "2020-02-20 00:00:00", + "logSize": 0, + "logStartTime": "2020-02-20 00:00:00", + "timeCollected": "2020-02-20 00:00:00", + } + ], + "toDate": "2020-02-20 00:00:00", + }, + "provisioningState": "str", + "registrationTimestamp": "2020-02-20 00:00:00", + "remoteSupportProperties": { + "accessLevel": "str", + "expirationTimeStamp": "2020-02-20 00:00:00", + "remoteSupportNodeSettings": [ + { + "arcResourceId": "str", + "connectionErrorMessage": "str", + "connectionStatus": "str", + "createdAt": "2020-02-20 00:00:00", + "state": "str", + "transcriptLocation": "str", + "updatedAt": "2020-02-20 00:00:00", + } + ], + "remoteSupportSessionDetails": [ + { + "accessLevel": "str", + "duration": 0, + "nodeName": "str", + "sessionEndTime": "2020-02-20 00:00:00", + "sessionStartTime": "2020-02-20 00:00:00", + } + ], + "remoteSupportType": "str", + }, + "reportedProperties": { + "clusterId": "str", + "clusterName": "str", + "clusterType": "str", + "clusterVersion": "str", + "diagnosticLevel": "str", + "hardwareClass": "str", + "imdsAttestation": "str", + "lastUpdated": "2020-02-20 00:00:00", + "manufacturer": "str", + "msiExpirationTimeStamp": "2020-02-20 00:00:00", + "nodes": [ + { + "coreCount": 0.0, + "ehcResourceId": "str", + "id": 0.0, + "lastLicensingTimestamp": "2020-02-20 00:00:00", + "manufacturer": "str", + "memoryInGiB": 0.0, + "model": "str", + "name": "str", + "nodeType": "str", + "oemActivation": "str", + "osDisplayVersion": "str", + "osName": "str", + "osVersion": "str", + "serialNumber": "str", + "windowsServerSubscription": "str", + } + ], + "oemActivation": "str", + "supportedCapabilities": ["str"], + }, + "resourceProviderObjectId": "str", + "ring": "str", + "sdnProperties": { + "sdnApiAddress": "str", + "sdnDomainName": "str", + "sdnIntegrationIntent": "str", + "sdnStatus": "str", + }, + "secretsLocations": [{"secretsLocation": "str", "secretsType": "str"}], + "serviceEndpoint": "str", + "softwareAssuranceProperties": { + "lastUpdated": "2020-02-20 00:00:00", + "softwareAssuranceIntent": "str", + "softwareAssuranceStatus": "str", + }, + "status": "str", + "supportStatus": "str", + "trialDaysRemaining": 0.0, }, - "status": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -172,12 +179,8 @@ async def test_create(self, resource_group): "lastModifiedByType": "str", }, "tags": {"str": "str"}, - "tenantId": "str", - "trialDaysRemaining": 0.0, "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -185,22 +188,25 @@ async def test_create(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_clusters_update(self, resource_group): response = await self.client.clusters.update( resource_group_name=resource_group.name, cluster_name="str", cluster={ - "aadClientId": "str", - "aadTenantId": "str", - "cloudManagementEndpoint": "str", - "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, - "principalId": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "aadClientId": "str", + "aadTenantId": "str", + "cloudManagementEndpoint": "str", + "desiredProperties": {"diagnosticLevel": "str", "windowsServerSubscription": "str"}, + }, "tags": {"str": "str"}, - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -208,12 +214,11 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_clusters_begin_delete(self, resource_group): response = await ( await self.client.clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -222,13 +227,44 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_upload_certificate(self, resource_group): + async def test_clusters_list_by_resource_group(self, resource_group): + response = self.client.clusters.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_clusters_list_by_subscription(self, resource_group): + response = self.client.clusters.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_begin_update_secrets_locations(self, resource_group): + response = await ( + await self.client.clusters.begin_update_secrets_locations( + resource_group_name=resource_group.name, + cluster_name="str", + body={"properties": [{"secretsLocation": "str", "secretsType": "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_upload_certificate(self, resource_group): response = await ( await self.client.clusters.begin_upload_certificate( resource_group_name=resource_group.name, cluster_name="str", upload_certificate_request={"properties": {"certificates": ["str"]}}, - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -237,12 +273,11 @@ async def test_begin_upload_certificate(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_identity(self, resource_group): + async def test_clusters_begin_create_identity(self, resource_group): response = await ( await self.client.clusters.begin_create_identity( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -251,13 +286,12 @@ async def test_begin_create_identity(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_extend_software_assurance_benefit(self, resource_group): + async def test_clusters_begin_extend_software_assurance_benefit(self, resource_group): response = await ( await self.client.clusters.begin_extend_software_assurance_benefit( resource_group_name=resource_group.name, cluster_name="str", software_assurance_change_request={"properties": {"softwareAssuranceIntent": "str"}}, - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -266,7 +300,21 @@ async def test_begin_extend_software_assurance_benefit(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_trigger_log_collection(self, resource_group): + async def test_clusters_begin_change_ring(self, resource_group): + response = await ( + await self.client.clusters.begin_change_ring( + resource_group_name=resource_group.name, + cluster_name="str", + change_ring_request={"properties": {"targetRing": "str"}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_clusters_begin_trigger_log_collection(self, resource_group): response = await ( await self.client.clusters.begin_trigger_log_collection( resource_group_name=resource_group.name, @@ -274,7 +322,6 @@ async def test_begin_trigger_log_collection(self, resource_group): log_collection_request={ "properties": {"fromDate": "2020-02-20 00:00:00", "toDate": "2020-02-20 00:00:00"} }, - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -283,7 +330,7 @@ async def test_begin_trigger_log_collection(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_configure_remote_support(self, resource_group): + async def test_clusters_begin_configure_remote_support(self, resource_group): response = await ( await self.client.clusters.begin_configure_remote_support( resource_group_name=resource_group.name, @@ -295,7 +342,6 @@ async def test_begin_configure_remote_support(self, resource_group): "remoteSupportType": "str", } }, - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_deployment_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_deployment_settings_operations.py index 8bc341e34ee8..f0faa9feeb10 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_deployment_settings_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_deployment_settings_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,24 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_clusters(self, resource_group): - response = self.client.deployment_settings.list_by_clusters( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): + def test_deployment_settings_get(self, resource_group): response = self.client.deployment_settings.get( resource_group_name=resource_group.name, cluster_name="str", - deployment_settings_name="default", - api_version="2024-04-01", + deployment_settings_name="str", ) # please add some check logic here by yourself @@ -45,155 +32,171 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_deployment_settings_begin_create_or_update(self, resource_group): response = self.client.deployment_settings.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", + deployment_settings_name="str", resource={ - "arcNodeResourceIds": ["str"], - "deploymentConfiguration": { - "scaleUnits": [ - { - "deploymentData": { - "adouPath": "str", - "cluster": { - "azureServiceEndpoint": "str", - "cloudAccountName": "str", - "name": "str", - "witnessPath": "str", - "witnessType": "str", - }, - "domainFqdn": "str", - "hostNetwork": { - "enableStorageAutoIp": False, - "intents": [ + "id": "str", + "name": "str", + "properties": { + "arcNodeResourceIds": ["str"], + "deploymentConfiguration": { + "scaleUnits": [ + { + "deploymentData": { + "adouPath": "str", + "assemblyInfo": { + "packageVersion": "str", + "payload": [ + {"fileName": "str", "hash": "str", "identifier": "str", "url": "str"} + ], + }, + "cluster": { + "azureServiceEndpoint": "str", + "cloudAccountName": "str", + "clusterPattern": "str", + "hardwareClass": "str", + "name": "str", + "witnessPath": "str", + "witnessType": "str", + }, + "domainFqdn": "str", + "hostNetwork": { + "enableStorageAutoIp": bool, + "intents": [ + { + "adapter": ["str"], + "adapterPropertyOverrides": { + "jumboPacket": "str", + "networkDirect": "str", + "networkDirectTechnology": "str", + }, + "name": "str", + "overrideAdapterProperty": bool, + "overrideQosPolicy": bool, + "overrideVirtualSwitchConfiguration": bool, + "qosPolicyOverrides": { + "bandwidthPercentage_SMB": "str", + "priorityValue8021Action_Cluster": "str", + "priorityValue8021Action_SMB": "str", + }, + "trafficType": ["str"], + "virtualSwitchConfigurationOverrides": { + "enableIov": "str", + "loadBalancingAlgorithm": "str", + }, + } + ], + "storageConnectivitySwitchless": bool, + "storageNetworks": [ + { + "name": "str", + "networkAdapterName": "str", + "storageAdapterIPInfo": [ + {"ipv4Address": "str", "physicalNode": "str", "subnetMask": "str"} + ], + "vlanId": "str", + } + ], + }, + "identityProvider": "str", + "infrastructureNetwork": [ { - "adapter": ["str"], - "adapterPropertyOverrides": { - "jumboPacket": "str", - "networkDirect": "str", - "networkDirectTechnology": "str", - }, - "name": "str", - "overrideAdapterProperty": False, - "overrideQosPolicy": False, - "overrideVirtualSwitchConfiguration": False, - "qosPolicyOverrides": { - "bandwidthPercentage_SMB": "str", - "priorityValue8021Action_Cluster": "str", - "priorityValue8021Action_SMB": "str", - }, - "trafficType": ["str"], - "virtualSwitchConfigurationOverrides": { - "enableIov": "str", - "loadBalancingAlgorithm": "str", - }, + "dnsServerConfig": "str", + "dnsServers": ["str"], + "dnsZones": [{"dnsForwarder": ["str"], "dnsZoneName": "str"}], + "gateway": "str", + "ipPools": [{"endingAddress": "str", "startingAddress": "str"}], + "subnetMask": "str", + "useDhcp": bool, } ], - "storageConnectivitySwitchless": False, - "storageNetworks": [ - { - "name": "str", - "networkAdapterName": "str", - "storageAdapterIPInfo": [ - {"ipv4Address": "str", "physicalNode": "str", "subnetMask": "str"} - ], - "vlanId": "str", + "isManagementCluster": bool, + "localAvailabilityZones": [{"localAvailabilityZoneName": "str", "nodes": ["str"]}], + "namingPrefix": "str", + "observability": { + "episodicDataUpload": bool, + "euLocation": bool, + "streamingDataClient": bool, + }, + "optionalServices": {"customLocation": "str"}, + "physicalNodes": [{"ipv4Address": "str", "name": "str"}], + "sdnIntegration": { + "networkController": { + "macAddressPoolStart": "str", + "macAddressPoolStop": "str", + "networkVirtualizationEnabled": bool, } - ], - }, - "infrastructureNetwork": [ - { - "dnsServers": ["str"], - "gateway": "str", - "ipPools": [{"endingAddress": "str", "startingAddress": "str"}], - "subnetMask": "str", - "useDhcp": bool, - } - ], - "namingPrefix": "str", - "observability": { - "episodicDataUpload": True, - "euLocation": False, - "streamingDataClient": True, - }, - "optionalServices": {"customLocation": "str"}, - "physicalNodes": [{"ipv4Address": "str", "name": "str"}], - "sdnIntegration": { - "networkController": { - "macAddressPoolStart": "str", - "macAddressPoolStop": "str", - "networkVirtualizationEnabled": bool, - } - }, - "secrets": [{"eceSecretName": "str", "secretLocation": "str", "secretName": "str"}], - "secretsLocation": "str", - "securitySettings": { - "bitlockerBootVolume": True, - "bitlockerDataVolumes": True, - "credentialGuardEnforced": False, - "driftControlEnforced": True, - "drtmProtection": True, - "hvciProtection": True, - "sideChannelMitigationEnforced": True, - "smbClusterEncryption": False, - "smbSigningEnforced": True, - "wdacEnforced": True, + }, + "secrets": [{"eceSecretName": "str", "secretLocation": "str", "secretName": "str"}], + "secretsLocation": "str", + "securitySettings": { + "bitlockerBootVolume": bool, + "bitlockerDataVolumes": bool, + "credentialGuardEnforced": bool, + "driftControlEnforced": bool, + "drtmProtection": bool, + "hvciProtection": bool, + "sideChannelMitigationEnforced": bool, + "smbClusterEncryption": bool, + "smbSigningEnforced": bool, + "wdacEnforced": bool, + }, + "storage": {"configurationMode": "str"}, }, - "storage": {"configurationMode": "Express"}, - }, - "sbePartnerInfo": { - "credentialList": [ - {"eceSecretName": "str", "secretLocation": "str", "secretName": "str"} - ], - "partnerProperties": [{"name": "str", "value": "str"}], - "sbeDeploymentInfo": { - "family": "str", - "publisher": "str", - "sbeManifestCreationDate": "2020-02-20 00:00:00", - "sbeManifestSource": "str", - "version": "str", + "sbePartnerInfo": { + "credentialList": [ + {"eceSecretName": "str", "secretLocation": "str", "secretName": "str"} + ], + "partnerProperties": [{"name": "str", "value": "str"}], + "sbeDeploymentInfo": { + "family": "str", + "publisher": "str", + "sbeManifestCreationDate": "2020-02-20 00:00:00", + "sbeManifestSource": "str", + "version": "str", + }, }, - }, - } - ], - "version": "str", - }, - "deploymentMode": "Deploy", - "id": "str", - "name": "str", - "operationType": "ClusterProvisioning", - "provisioningState": "str", - "reportedProperties": { - "deploymentStatus": { - "status": "str", - "steps": [ - { - "description": "str", - "endTimeUtc": "str", - "exception": ["str"], - "fullStepIndex": "str", - "name": "str", - "startTimeUtc": "str", - "status": "str", - "steps": [...], } ], + "version": "str", }, - "validationStatus": { - "status": "str", - "steps": [ - { - "description": "str", - "endTimeUtc": "str", - "exception": ["str"], - "fullStepIndex": "str", - "name": "str", - "startTimeUtc": "str", - "status": "str", - "steps": [...], - } - ], + "deploymentMode": "str", + "operationType": "str", + "provisioningState": "str", + "reportedProperties": { + "deploymentStatus": { + "status": "str", + "steps": [ + { + "description": "str", + "endTimeUtc": "str", + "exception": ["str"], + "fullStepIndex": "str", + "name": "str", + "startTimeUtc": "str", + "status": "str", + "steps": [...], + } + ], + }, + "validationStatus": { + "status": "str", + "steps": [ + { + "description": "str", + "endTimeUtc": "str", + "exception": ["str"], + "fullStepIndex": "str", + "name": "str", + "startTimeUtc": "str", + "status": "str", + "steps": [...], + } + ], + }, }, }, "systemData": { @@ -206,8 +209,6 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - deployment_settings_name="default", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -215,13 +216,23 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_deployment_settings_begin_delete(self, resource_group): response = self.client.deployment_settings.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - deployment_settings_name="default", - api_version="2024-04-01", + deployment_settings_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_deployment_settings_list_by_clusters(self, resource_group): + response = self.client.deployment_settings.list_by_clusters( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_deployment_settings_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_deployment_settings_operations_async.py index d2715c1f3951..5b219cb9f7b5 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_deployment_settings_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_deployment_settings_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,24 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_clusters(self, resource_group): - response = self.client.deployment_settings.list_by_clusters( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-04-01", - ) - 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_get(self, resource_group): + async def test_deployment_settings_get(self, resource_group): response = await self.client.deployment_settings.get( resource_group_name=resource_group.name, cluster_name="str", - deployment_settings_name="default", - api_version="2024-04-01", + deployment_settings_name="str", ) # please add some check logic here by yourself @@ -46,156 +33,180 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_deployment_settings_begin_create_or_update(self, resource_group): response = await ( await self.client.deployment_settings.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", + deployment_settings_name="str", resource={ - "arcNodeResourceIds": ["str"], - "deploymentConfiguration": { - "scaleUnits": [ - { - "deploymentData": { - "adouPath": "str", - "cluster": { - "azureServiceEndpoint": "str", - "cloudAccountName": "str", - "name": "str", - "witnessPath": "str", - "witnessType": "str", - }, - "domainFqdn": "str", - "hostNetwork": { - "enableStorageAutoIp": False, - "intents": [ + "id": "str", + "name": "str", + "properties": { + "arcNodeResourceIds": ["str"], + "deploymentConfiguration": { + "scaleUnits": [ + { + "deploymentData": { + "adouPath": "str", + "assemblyInfo": { + "packageVersion": "str", + "payload": [ + {"fileName": "str", "hash": "str", "identifier": "str", "url": "str"} + ], + }, + "cluster": { + "azureServiceEndpoint": "str", + "cloudAccountName": "str", + "clusterPattern": "str", + "hardwareClass": "str", + "name": "str", + "witnessPath": "str", + "witnessType": "str", + }, + "domainFqdn": "str", + "hostNetwork": { + "enableStorageAutoIp": bool, + "intents": [ + { + "adapter": ["str"], + "adapterPropertyOverrides": { + "jumboPacket": "str", + "networkDirect": "str", + "networkDirectTechnology": "str", + }, + "name": "str", + "overrideAdapterProperty": bool, + "overrideQosPolicy": bool, + "overrideVirtualSwitchConfiguration": bool, + "qosPolicyOverrides": { + "bandwidthPercentage_SMB": "str", + "priorityValue8021Action_Cluster": "str", + "priorityValue8021Action_SMB": "str", + }, + "trafficType": ["str"], + "virtualSwitchConfigurationOverrides": { + "enableIov": "str", + "loadBalancingAlgorithm": "str", + }, + } + ], + "storageConnectivitySwitchless": bool, + "storageNetworks": [ + { + "name": "str", + "networkAdapterName": "str", + "storageAdapterIPInfo": [ + { + "ipv4Address": "str", + "physicalNode": "str", + "subnetMask": "str", + } + ], + "vlanId": "str", + } + ], + }, + "identityProvider": "str", + "infrastructureNetwork": [ { - "adapter": ["str"], - "adapterPropertyOverrides": { - "jumboPacket": "str", - "networkDirect": "str", - "networkDirectTechnology": "str", - }, - "name": "str", - "overrideAdapterProperty": False, - "overrideQosPolicy": False, - "overrideVirtualSwitchConfiguration": False, - "qosPolicyOverrides": { - "bandwidthPercentage_SMB": "str", - "priorityValue8021Action_Cluster": "str", - "priorityValue8021Action_SMB": "str", - }, - "trafficType": ["str"], - "virtualSwitchConfigurationOverrides": { - "enableIov": "str", - "loadBalancingAlgorithm": "str", - }, + "dnsServerConfig": "str", + "dnsServers": ["str"], + "dnsZones": [{"dnsForwarder": ["str"], "dnsZoneName": "str"}], + "gateway": "str", + "ipPools": [{"endingAddress": "str", "startingAddress": "str"}], + "subnetMask": "str", + "useDhcp": bool, } ], - "storageConnectivitySwitchless": False, - "storageNetworks": [ - { - "name": "str", - "networkAdapterName": "str", - "storageAdapterIPInfo": [ - {"ipv4Address": "str", "physicalNode": "str", "subnetMask": "str"} - ], - "vlanId": "str", + "isManagementCluster": bool, + "localAvailabilityZones": [ + {"localAvailabilityZoneName": "str", "nodes": ["str"]} + ], + "namingPrefix": "str", + "observability": { + "episodicDataUpload": bool, + "euLocation": bool, + "streamingDataClient": bool, + }, + "optionalServices": {"customLocation": "str"}, + "physicalNodes": [{"ipv4Address": "str", "name": "str"}], + "sdnIntegration": { + "networkController": { + "macAddressPoolStart": "str", + "macAddressPoolStop": "str", + "networkVirtualizationEnabled": bool, } + }, + "secrets": [ + {"eceSecretName": "str", "secretLocation": "str", "secretName": "str"} ], + "secretsLocation": "str", + "securitySettings": { + "bitlockerBootVolume": bool, + "bitlockerDataVolumes": bool, + "credentialGuardEnforced": bool, + "driftControlEnforced": bool, + "drtmProtection": bool, + "hvciProtection": bool, + "sideChannelMitigationEnforced": bool, + "smbClusterEncryption": bool, + "smbSigningEnforced": bool, + "wdacEnforced": bool, + }, + "storage": {"configurationMode": "str"}, }, - "infrastructureNetwork": [ - { - "dnsServers": ["str"], - "gateway": "str", - "ipPools": [{"endingAddress": "str", "startingAddress": "str"}], - "subnetMask": "str", - "useDhcp": bool, - } - ], - "namingPrefix": "str", - "observability": { - "episodicDataUpload": True, - "euLocation": False, - "streamingDataClient": True, - }, - "optionalServices": {"customLocation": "str"}, - "physicalNodes": [{"ipv4Address": "str", "name": "str"}], - "sdnIntegration": { - "networkController": { - "macAddressPoolStart": "str", - "macAddressPoolStop": "str", - "networkVirtualizationEnabled": bool, - } - }, - "secrets": [{"eceSecretName": "str", "secretLocation": "str", "secretName": "str"}], - "secretsLocation": "str", - "securitySettings": { - "bitlockerBootVolume": True, - "bitlockerDataVolumes": True, - "credentialGuardEnforced": False, - "driftControlEnforced": True, - "drtmProtection": True, - "hvciProtection": True, - "sideChannelMitigationEnforced": True, - "smbClusterEncryption": False, - "smbSigningEnforced": True, - "wdacEnforced": True, - }, - "storage": {"configurationMode": "Express"}, - }, - "sbePartnerInfo": { - "credentialList": [ - {"eceSecretName": "str", "secretLocation": "str", "secretName": "str"} - ], - "partnerProperties": [{"name": "str", "value": "str"}], - "sbeDeploymentInfo": { - "family": "str", - "publisher": "str", - "sbeManifestCreationDate": "2020-02-20 00:00:00", - "sbeManifestSource": "str", - "version": "str", + "sbePartnerInfo": { + "credentialList": [ + {"eceSecretName": "str", "secretLocation": "str", "secretName": "str"} + ], + "partnerProperties": [{"name": "str", "value": "str"}], + "sbeDeploymentInfo": { + "family": "str", + "publisher": "str", + "sbeManifestCreationDate": "2020-02-20 00:00:00", + "sbeManifestSource": "str", + "version": "str", + }, }, - }, - } - ], - "version": "str", - }, - "deploymentMode": "Deploy", - "id": "str", - "name": "str", - "operationType": "ClusterProvisioning", - "provisioningState": "str", - "reportedProperties": { - "deploymentStatus": { - "status": "str", - "steps": [ - { - "description": "str", - "endTimeUtc": "str", - "exception": ["str"], - "fullStepIndex": "str", - "name": "str", - "startTimeUtc": "str", - "status": "str", - "steps": [...], } ], + "version": "str", }, - "validationStatus": { - "status": "str", - "steps": [ - { - "description": "str", - "endTimeUtc": "str", - "exception": ["str"], - "fullStepIndex": "str", - "name": "str", - "startTimeUtc": "str", - "status": "str", - "steps": [...], - } - ], + "deploymentMode": "str", + "operationType": "str", + "provisioningState": "str", + "reportedProperties": { + "deploymentStatus": { + "status": "str", + "steps": [ + { + "description": "str", + "endTimeUtc": "str", + "exception": ["str"], + "fullStepIndex": "str", + "name": "str", + "startTimeUtc": "str", + "status": "str", + "steps": [...], + } + ], + }, + "validationStatus": { + "status": "str", + "steps": [ + { + "description": "str", + "endTimeUtc": "str", + "exception": ["str"], + "fullStepIndex": "str", + "name": "str", + "startTimeUtc": "str", + "status": "str", + "steps": [...], + } + ], + }, }, }, "systemData": { @@ -208,8 +219,6 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - deployment_settings_name="default", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -218,15 +227,25 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_deployment_settings_begin_delete(self, resource_group): response = await ( await self.client.deployment_settings.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - deployment_settings_name="default", - api_version="2024-04-01", + deployment_settings_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_deployment_settings_list_by_clusters(self, resource_group): + response = self.client.deployment_settings.list_by_clusters( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_device_jobs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_device_jobs_operations.py new file mode 100644 index 000000000000..345e329ba259 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_device_jobs_operations.py @@ -0,0 +1,81 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIEdgeDeviceJobsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_device_jobs_get(self, resource_group): + response = self.client.edge_device_jobs.get( + resource_uri="str", + edge_device_name="str", + jobs_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_device_jobs_begin_create_or_update(self, resource_group): + response = self.client.edge_device_jobs.begin_create_or_update( + resource_uri="str", + edge_device_name="str", + jobs_name="str", + resource={ + "kind": "HCI", + "properties": "hci_edge_device_job_properties", + "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", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_device_jobs_begin_delete(self, resource_group): + response = self.client.edge_device_jobs.begin_delete( + resource_uri="str", + edge_device_name="str", + jobs_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_device_jobs_list_by_edge_device(self, resource_group): + response = self.client.edge_device_jobs.list_by_edge_device( + resource_uri="str", + edge_device_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_device_jobs_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_device_jobs_operations_async.py new file mode 100644 index 000000000000..b683e74821d8 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_device_jobs_operations_async.py @@ -0,0 +1,86 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci.aio import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIEdgeDeviceJobsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_device_jobs_get(self, resource_group): + response = await self.client.edge_device_jobs.get( + resource_uri="str", + edge_device_name="str", + jobs_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_device_jobs_begin_create_or_update(self, resource_group): + response = await ( + await self.client.edge_device_jobs.begin_create_or_update( + resource_uri="str", + edge_device_name="str", + jobs_name="str", + resource={ + "kind": "HCI", + "properties": "hci_edge_device_job_properties", + "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", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_device_jobs_begin_delete(self, resource_group): + response = await ( + await self.client.edge_device_jobs.begin_delete( + resource_uri="str", + edge_device_name="str", + jobs_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_device_jobs_list_by_edge_device(self, resource_group): + response = self.client.edge_device_jobs.list_by_edge_device( + resource_uri="str", + edge_device_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations.py index 0503cdcfb887..4d850d7be7e9 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,22 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.edge_devices.list( - resource_uri="str", - api_version="2024-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): + def test_edge_devices_get(self, resource_group): response = self.client.edge_devices.get( resource_uri="str", - edge_device_name="default", - api_version="2024-04-01", + edge_device_name="str", ) # please add some check logic here by yourself @@ -43,9 +31,10 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_edge_devices_begin_create_or_update(self, resource_group): response = self.client.edge_devices.begin_create_or_update( resource_uri="str", + edge_device_name="str", resource={ "kind": "HCI", "id": "str", @@ -69,6 +58,10 @@ def test_begin_create_or_update(self, resource_group): }, "provisioningState": "str", "reportedProperties": { + "confidentialVmProfile": { + "igvmStatus": "str", + "statusDetails": [{"code": "str", "message": "str"}], + }, "deviceState": "str", "extensionProfile": { "extensions": [ @@ -82,6 +75,8 @@ def test_begin_create_or_update(self, resource_group): } ] }, + "hardwareProfile": {"processorType": "str"}, + "lastSyncTimestamp": "2020-02-20 00:00:00", "networkProfile": { "hostNetwork": { "enableStorageAutoIp": bool, @@ -142,12 +137,14 @@ def test_begin_create_or_update(self, resource_group): "macAddress": "str", "nicStatus": "str", "nicType": "str", + "rdmaCapability": "str", "slot": "str", "subnetMask": "str", "switchName": "str", "vlanId": "str", } ], + "sdnProperties": {"sdnApiAddress": "str", "sdnDomainName": "str", "sdnStatus": "str"}, "switchDetails": [ { "extensions": [ @@ -160,6 +157,7 @@ def test_begin_create_or_update(self, resource_group): }, "osProfile": {"assemblyVersion": "str", "bootType": "str"}, "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, + "storageProfile": {"poolableDisksCount": 0}, }, }, "systemData": { @@ -172,8 +170,6 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - edge_device_name="default", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -181,11 +177,10 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_edge_devices_begin_delete(self, resource_group): response = self.client.edge_devices.begin_delete( resource_uri="str", - edge_device_name="default", - api_version="2024-04-01", + edge_device_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -193,12 +188,21 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_validate(self, resource_group): + def test_edge_devices_list(self, resource_group): + response = self.client.edge_devices.list( + resource_uri="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_devices_begin_validate(self, resource_group): response = self.client.edge_devices.begin_validate( resource_uri="str", + edge_device_name="str", validate_request={"edgeDeviceIds": ["str"], "additionalInfo": "str"}, - edge_device_name="default", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations_async.py index e066e78a66a7..f1ad5f3a2774 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,22 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.edge_devices.list( - resource_uri="str", - api_version="2024-04-01", - ) - 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_get(self, resource_group): + async def test_edge_devices_get(self, resource_group): response = await self.client.edge_devices.get( resource_uri="str", - edge_device_name="default", - api_version="2024-04-01", + edge_device_name="str", ) # please add some check logic here by yourself @@ -44,10 +32,11 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_edge_devices_begin_create_or_update(self, resource_group): response = await ( await self.client.edge_devices.begin_create_or_update( resource_uri="str", + edge_device_name="str", resource={ "kind": "HCI", "id": "str", @@ -71,6 +60,10 @@ async def test_begin_create_or_update(self, resource_group): }, "provisioningState": "str", "reportedProperties": { + "confidentialVmProfile": { + "igvmStatus": "str", + "statusDetails": [{"code": "str", "message": "str"}], + }, "deviceState": "str", "extensionProfile": { "extensions": [ @@ -84,6 +77,8 @@ async def test_begin_create_or_update(self, resource_group): } ] }, + "hardwareProfile": {"processorType": "str"}, + "lastSyncTimestamp": "2020-02-20 00:00:00", "networkProfile": { "hostNetwork": { "enableStorageAutoIp": bool, @@ -144,12 +139,14 @@ async def test_begin_create_or_update(self, resource_group): "macAddress": "str", "nicStatus": "str", "nicType": "str", + "rdmaCapability": "str", "slot": "str", "subnetMask": "str", "switchName": "str", "vlanId": "str", } ], + "sdnProperties": {"sdnApiAddress": "str", "sdnDomainName": "str", "sdnStatus": "str"}, "switchDetails": [ { "extensions": [ @@ -162,6 +159,7 @@ async def test_begin_create_or_update(self, resource_group): }, "osProfile": {"assemblyVersion": "str", "bootType": "str"}, "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, + "storageProfile": {"poolableDisksCount": 0}, }, }, "systemData": { @@ -174,8 +172,6 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - edge_device_name="default", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -184,12 +180,11 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_edge_devices_begin_delete(self, resource_group): response = await ( await self.client.edge_devices.begin_delete( resource_uri="str", - edge_device_name="default", - api_version="2024-04-01", + edge_device_name="str", ) ).result() # call '.result()' to poll until service return final result @@ -198,13 +193,22 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_validate(self, resource_group): + async def test_edge_devices_list(self, resource_group): + response = self.client.edge_devices.list( + resource_uri="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_devices_begin_validate(self, resource_group): response = await ( await self.client.edge_devices.begin_validate( resource_uri="str", + edge_device_name="str", validate_request={"edgeDeviceIds": ["str"], "additionalInfo": "str"}, - edge_device_name="default", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations.py new file mode 100644 index 000000000000..f04243b80402 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations.py @@ -0,0 +1,80 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIEdgeMachineJobsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machine_jobs_get(self, resource_group): + response = self.client.edge_machine_jobs.get( + resource_group_name=resource_group.name, + edge_machine_name="str", + jobs_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machine_jobs_begin_create_or_update(self, resource_group): + response = self.client.edge_machine_jobs.begin_create_or_update( + resource_group_name=resource_group.name, + edge_machine_name="str", + jobs_name="str", + resource={ + "id": "str", + "name": "str", + "properties": "edge_machine_job_properties", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machine_jobs_begin_delete(self, resource_group): + response = self.client.edge_machine_jobs.begin_delete( + resource_group_name=resource_group.name, + edge_machine_name="str", + jobs_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machine_jobs_list(self, resource_group): + response = self.client.edge_machine_jobs.list( + resource_group_name=resource_group.name, + edge_machine_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations_async.py new file mode 100644 index 000000000000..a36bcb628488 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machine_jobs_operations_async.py @@ -0,0 +1,85 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci.aio import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIEdgeMachineJobsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machine_jobs_get(self, resource_group): + response = await self.client.edge_machine_jobs.get( + resource_group_name=resource_group.name, + edge_machine_name="str", + jobs_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machine_jobs_begin_create_or_update(self, resource_group): + response = await ( + await self.client.edge_machine_jobs.begin_create_or_update( + resource_group_name=resource_group.name, + edge_machine_name="str", + jobs_name="str", + resource={ + "id": "str", + "name": "str", + "properties": "edge_machine_job_properties", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machine_jobs_begin_delete(self, resource_group): + response = await ( + await self.client.edge_machine_jobs.begin_delete( + resource_group_name=resource_group.name, + edge_machine_name="str", + jobs_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machine_jobs_list(self, resource_group): + response = self.client.edge_machine_jobs.list( + resource_group_name=resource_group.name, + edge_machine_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations.py new file mode 100644 index 000000000000..35b1fbe63a50 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations.py @@ -0,0 +1,243 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIEdgeMachinesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machines_get(self, resource_group): + response = self.client.edge_machines.get( + resource_group_name=resource_group.name, + edge_machine_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machines_begin_create_or_update(self, resource_group): + response = self.client.edge_machines.begin_create_or_update( + resource_group_name=resource_group.name, + edge_machine_name="str", + resource={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "arcGatewayResourceId": "str", + "arcMachineResourceGroupId": "str", + "arcMachineResourceId": "str", + "claimedBy": "str", + "cloudId": "str", + "connectivityStatus": "str", + "devicePoolResourceId": "str", + "edgeMachineKind": "str", + "lastSyncTimestamp": "2020-02-20 00:00:00", + "machineState": "str", + "operationDetails": [ + { + "description": "str", + "error": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + }, + "id": "str", + "name": "str", + "resourceId": "str", + "status": "str", + "type": "str", + } + ], + "ownershipVoucherDetails": {"ownerKeyType": "str", "ownershipVoucher": "str"}, + "provisioningDetails": { + "osProfile": { + "gpgPubKey": "str", + "imageHash": "str", + "operationType": "str", + "osImageLocation": "str", + "osName": "str", + "osType": "str", + "osVersion": "str", + "vsrVersion": "str", + }, + "userDetails": [ + {"secretType": "str", "userName": "str", "secretLocation": "str", "sshPubKey": ["str"]} + ], + }, + "provisioningState": "str", + "reportedProperties": { + "extensionProfile": { + "extensions": [ + { + "errorDetails": [{"exception": "str"}], + "extensionName": "str", + "extensionResourceId": "str", + "managedBy": "str", + "state": "str", + "typeHandlerVersion": "str", + } + ] + }, + "hardwareProfile": { + "cpuCores": 0, + "cpuSockets": 0, + "manufacturer": "str", + "memoryCapacityInGb": 0, + "model": "str", + "processorType": "str", + "serialNumber": "str", + }, + "lastUpdated": "2020-02-20 00:00:00", + "networkProfile": { + "nicDetails": [ + { + "adapterName": "str", + "componentId": "str", + "defaultGateway": "str", + "defaultIsolationId": "str", + "dnsServers": ["str"], + "driverVersion": "str", + "interfaceDescription": "str", + "ip4Address": "str", + "macAddress": "str", + "nicStatus": "str", + "nicType": "str", + "rdmaCapability": "str", + "slot": "str", + "subnetMask": "str", + "switchName": "str", + "vlanId": "str", + } + ], + "switchDetails": [ + { + "extensions": [ + {"extensionEnabled": bool, "extensionName": "str", "switchId": "str"} + ], + "switchName": "str", + "switchType": "str", + } + ], + }, + "osProfile": { + "assemblyVersion": "str", + "baseImageVersion": "str", + "bootType": "str", + "buildNumber": "str", + "imageVersion": "str", + "osSku": "str", + "osType": "str", + "osVersion": "str", + }, + "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, + "storageProfile": {"poolableDisksCount": 0}, + }, + "siteDetails": { + "siteResourceId": "str", + "deviceConfiguration": { + "deviceMetadata": "str", + "nicDetails": [ + { + "adapterName": "str", + "componentId": "str", + "defaultGateway": "str", + "defaultIsolationId": "str", + "dnsServers": ["str"], + "driverVersion": "str", + "interfaceDescription": "str", + "ip4Address": "str", + "subnetMask": "str", + } + ], + }, + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machines_begin_update(self, resource_group): + response = self.client.edge_machines.begin_update( + resource_group_name=resource_group.name, + edge_machine_name="str", + properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machines_begin_delete(self, resource_group): + response = self.client.edge_machines.begin_delete( + resource_group_name=resource_group.name, + edge_machine_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machines_list_by_resource_group(self, resource_group): + response = self.client.edge_machines.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_edge_machines_list_by_subscription(self, resource_group): + response = self.client.edge_machines.list_by_subscription() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations_async.py new file mode 100644 index 000000000000..ae1d42800f2c --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_machines_operations_async.py @@ -0,0 +1,250 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci.aio import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIEdgeMachinesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machines_get(self, resource_group): + response = await self.client.edge_machines.get( + resource_group_name=resource_group.name, + edge_machine_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machines_begin_create_or_update(self, resource_group): + response = await ( + await self.client.edge_machines.begin_create_or_update( + resource_group_name=resource_group.name, + edge_machine_name="str", + resource={ + "location": "str", + "id": "str", + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "arcGatewayResourceId": "str", + "arcMachineResourceGroupId": "str", + "arcMachineResourceId": "str", + "claimedBy": "str", + "cloudId": "str", + "connectivityStatus": "str", + "devicePoolResourceId": "str", + "edgeMachineKind": "str", + "lastSyncTimestamp": "2020-02-20 00:00:00", + "machineState": "str", + "operationDetails": [ + { + "description": "str", + "error": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + }, + "id": "str", + "name": "str", + "resourceId": "str", + "status": "str", + "type": "str", + } + ], + "ownershipVoucherDetails": {"ownerKeyType": "str", "ownershipVoucher": "str"}, + "provisioningDetails": { + "osProfile": { + "gpgPubKey": "str", + "imageHash": "str", + "operationType": "str", + "osImageLocation": "str", + "osName": "str", + "osType": "str", + "osVersion": "str", + "vsrVersion": "str", + }, + "userDetails": [ + {"secretType": "str", "userName": "str", "secretLocation": "str", "sshPubKey": ["str"]} + ], + }, + "provisioningState": "str", + "reportedProperties": { + "extensionProfile": { + "extensions": [ + { + "errorDetails": [{"exception": "str"}], + "extensionName": "str", + "extensionResourceId": "str", + "managedBy": "str", + "state": "str", + "typeHandlerVersion": "str", + } + ] + }, + "hardwareProfile": { + "cpuCores": 0, + "cpuSockets": 0, + "manufacturer": "str", + "memoryCapacityInGb": 0, + "model": "str", + "processorType": "str", + "serialNumber": "str", + }, + "lastUpdated": "2020-02-20 00:00:00", + "networkProfile": { + "nicDetails": [ + { + "adapterName": "str", + "componentId": "str", + "defaultGateway": "str", + "defaultIsolationId": "str", + "dnsServers": ["str"], + "driverVersion": "str", + "interfaceDescription": "str", + "ip4Address": "str", + "macAddress": "str", + "nicStatus": "str", + "nicType": "str", + "rdmaCapability": "str", + "slot": "str", + "subnetMask": "str", + "switchName": "str", + "vlanId": "str", + } + ], + "switchDetails": [ + { + "extensions": [ + {"extensionEnabled": bool, "extensionName": "str", "switchId": "str"} + ], + "switchName": "str", + "switchType": "str", + } + ], + }, + "osProfile": { + "assemblyVersion": "str", + "baseImageVersion": "str", + "bootType": "str", + "buildNumber": "str", + "imageVersion": "str", + "osSku": "str", + "osType": "str", + "osVersion": "str", + }, + "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, + "storageProfile": {"poolableDisksCount": 0}, + }, + "siteDetails": { + "siteResourceId": "str", + "deviceConfiguration": { + "deviceMetadata": "str", + "nicDetails": [ + { + "adapterName": "str", + "componentId": "str", + "defaultGateway": "str", + "defaultIsolationId": "str", + "dnsServers": ["str"], + "driverVersion": "str", + "interfaceDescription": "str", + "ip4Address": "str", + "subnetMask": "str", + } + ], + }, + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machines_begin_update(self, resource_group): + response = await ( + await self.client.edge_machines.begin_update( + resource_group_name=resource_group.name, + edge_machine_name="str", + properties={ + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machines_begin_delete(self, resource_group): + response = await ( + await self.client.edge_machines.begin_delete( + resource_group_name=resource_group.name, + edge_machine_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machines_list_by_resource_group(self, resource_group): + response = self.client.edge_machines.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_edge_machines_list_by_subscription(self, resource_group): + response = self.client.edge_machines.list_by_subscription() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_extensions_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_extensions_operations.py index 959d8f32460f..cb5a546d2808 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_extensions_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_extensions_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,26 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_arc_setting(self, resource_group): - response = self.client.extensions.list_by_arc_setting( - resource_group_name=resource_group.name, - cluster_name="str", - arc_setting_name="str", - api_version="2024-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): + def test_extensions_get(self, resource_group): response = self.client.extensions.get( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", extension_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -47,44 +33,50 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create(self, resource_group): + def test_extensions_begin_create(self, resource_group): response = self.client.extensions.begin_create( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", extension_name="str", extension={ - "aggregateState": "str", - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": "str", "id": "str", - "managedBy": "str", "name": "str", - "perNodeExtensionDetails": [ - { - "extension": "str", - "instanceView": { - "name": "str", - "status": { - "code": "str", - "displayStatus": "str", - "level": "str", - "message": "str", - "time": "2020-02-20 00:00:00", + "properties": { + "aggregateState": "str", + "extensionParameters": { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "protectedSettings": {}, + "publisher": "str", + "settings": {}, + "type": "str", + "typeHandlerVersion": "str", + }, + "managedBy": "str", + "perNodeExtensionDetails": [ + { + "extension": "str", + "instanceView": { + "name": "str", + "status": { + "code": "str", + "displayStatus": "str", + "level": "str", + "message": "str", + "time": "2020-02-20 00:00:00", + }, + "type": "str", + "typeHandlerVersion": "str", }, - "type": "str", + "name": "str", + "state": "str", "typeHandlerVersion": "str", - }, - "name": "str", - "state": "str", - "typeHandlerVersion": "str", - } - ], - "protectedSettings": {}, - "provisioningState": "str", - "publisher": "str", - "settings": {}, + } + ], + "provisioningState": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -94,9 +86,7 @@ def test_begin_create(self, resource_group): "lastModifiedByType": "str", }, "type": "str", - "typeHandlerVersion": "str", }, - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -104,21 +94,22 @@ def test_begin_create(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_extensions_begin_update(self, resource_group): response = self.client.extensions.begin_update( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", extension_name="str", extension={ - "extensionParameters": { - "enableAutomaticUpgrade": bool, - "protectedSettings": {}, - "settings": {}, - "typeHandlerVersion": "str", + "properties": { + "extensionParameters": { + "enableAutomaticUpgrade": bool, + "protectedSettings": {}, + "settings": {}, + "typeHandlerVersion": "str", + } } }, - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -126,13 +117,12 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_extensions_begin_delete(self, resource_group): response = self.client.extensions.begin_delete( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", extension_name="str", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -140,14 +130,25 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_upgrade(self, resource_group): + def test_extensions_list_by_arc_setting(self, resource_group): + response = self.client.extensions.list_by_arc_setting( + resource_group_name=resource_group.name, + cluster_name="str", + arc_setting_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_extensions_begin_upgrade(self, resource_group): response = self.client.extensions.begin_upgrade( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", extension_name="str", extension_upgrade_parameters={"targetVersion": "str"}, - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_extensions_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_extensions_operations_async.py index 7f0975e129d2..475d6e874e0c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_extensions_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_extensions_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,26 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_arc_setting(self, resource_group): - response = self.client.extensions.list_by_arc_setting( - resource_group_name=resource_group.name, - cluster_name="str", - arc_setting_name="str", - api_version="2024-04-01", - ) - 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_get(self, resource_group): + async def test_extensions_get(self, resource_group): response = await self.client.extensions.get( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", extension_name="str", - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -48,7 +34,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create(self, resource_group): + async def test_extensions_begin_create(self, resource_group): response = await ( await self.client.extensions.begin_create( resource_group_name=resource_group.name, @@ -56,37 +42,43 @@ async def test_begin_create(self, resource_group): arc_setting_name="str", extension_name="str", extension={ - "aggregateState": "str", - "autoUpgradeMinorVersion": bool, - "enableAutomaticUpgrade": bool, - "forceUpdateTag": "str", "id": "str", - "managedBy": "str", "name": "str", - "perNodeExtensionDetails": [ - { - "extension": "str", - "instanceView": { - "name": "str", - "status": { - "code": "str", - "displayStatus": "str", - "level": "str", - "message": "str", - "time": "2020-02-20 00:00:00", + "properties": { + "aggregateState": "str", + "extensionParameters": { + "autoUpgradeMinorVersion": bool, + "enableAutomaticUpgrade": bool, + "forceUpdateTag": "str", + "protectedSettings": {}, + "publisher": "str", + "settings": {}, + "type": "str", + "typeHandlerVersion": "str", + }, + "managedBy": "str", + "perNodeExtensionDetails": [ + { + "extension": "str", + "instanceView": { + "name": "str", + "status": { + "code": "str", + "displayStatus": "str", + "level": "str", + "message": "str", + "time": "2020-02-20 00:00:00", + }, + "type": "str", + "typeHandlerVersion": "str", }, - "type": "str", + "name": "str", + "state": "str", "typeHandlerVersion": "str", - }, - "name": "str", - "state": "str", - "typeHandlerVersion": "str", - } - ], - "protectedSettings": {}, - "provisioningState": "str", - "publisher": "str", - "settings": {}, + } + ], + "provisioningState": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -96,9 +88,7 @@ async def test_begin_create(self, resource_group): "lastModifiedByType": "str", }, "type": "str", - "typeHandlerVersion": "str", }, - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -107,7 +97,7 @@ async def test_begin_create(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_extensions_begin_update(self, resource_group): response = await ( await self.client.extensions.begin_update( resource_group_name=resource_group.name, @@ -115,14 +105,15 @@ async def test_begin_update(self, resource_group): arc_setting_name="str", extension_name="str", extension={ - "extensionParameters": { - "enableAutomaticUpgrade": bool, - "protectedSettings": {}, - "settings": {}, - "typeHandlerVersion": "str", + "properties": { + "extensionParameters": { + "enableAutomaticUpgrade": bool, + "protectedSettings": {}, + "settings": {}, + "typeHandlerVersion": "str", + } } }, - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -131,14 +122,13 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_extensions_begin_delete(self, resource_group): response = await ( await self.client.extensions.begin_delete( resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", extension_name="str", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -147,7 +137,19 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_upgrade(self, resource_group): + async def test_extensions_list_by_arc_setting(self, resource_group): + response = self.client.extensions.list_by_arc_setting( + resource_group_name=resource_group.name, + cluster_name="str", + arc_setting_name="str", + ) + 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_extensions_begin_upgrade(self, resource_group): response = await ( await self.client.extensions.begin_upgrade( resource_group_name=resource_group.name, @@ -155,7 +157,6 @@ async def test_begin_upgrade(self, resource_group): arc_setting_name="str", extension_name="str", extension_upgrade_parameters={"targetVersion": "str"}, - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations.py new file mode 100644 index 000000000000..00d62c608010 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIKubernetesVersionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_kubernetes_versions_list_by_subscription_location_resource(self, resource_group): + response = self.client.kubernetes_versions.list_by_subscription_location_resource( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations_async.py new file mode 100644 index 000000000000..6d1d7b2de058 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_kubernetes_versions_operations_async.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci.aio import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIKubernetesVersionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_kubernetes_versions_list_by_subscription_location_resource(self, resource_group): + response = self.client.kubernetes_versions.list_by_subscription_location_resource( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_offers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_offers_operations.py index 57d9691a2b84..2c2dafc8c6c2 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_offers_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_offers_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,24 +20,24 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_publisher(self, resource_group): - response = self.client.offers.list_by_publisher( + def test_offers_get(self, resource_group): + response = self.client.offers.get( resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", - api_version="2024-04-01", + offer_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_cluster(self, resource_group): - response = self.client.offers.list_by_cluster( + def test_offers_list_by_publisher(self, resource_group): + response = self.client.offers.list_by_publisher( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + publisher_name="str", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,14 +45,11 @@ def test_list_by_cluster(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.offers.get( + def test_offers_list_by_cluster(self, resource_group): + response = self.client.offers.list_by_cluster( resource_group_name=resource_group.name, cluster_name="str", - publisher_name="str", - offer_name="str", - api_version="2024-04-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_offers_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_offers_operations_async.py index f18028e3dd8a..ee616e626a99 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_offers_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_offers_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,24 +21,24 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_publisher(self, resource_group): - response = self.client.offers.list_by_publisher( + async def test_offers_get(self, resource_group): + response = await self.client.offers.get( resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", - api_version="2024-04-01", + offer_name="str", ) - 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_list_by_cluster(self, resource_group): - response = self.client.offers.list_by_cluster( + async def test_offers_list_by_publisher(self, resource_group): + response = self.client.offers.list_by_publisher( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + publisher_name="str", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,14 +46,11 @@ async def test_list_by_cluster(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.offers.get( + async def test_offers_list_by_cluster(self, resource_group): + response = self.client.offers.list_by_cluster( resource_group_name=resource_group.name, cluster_name="str", - publisher_name="str", - offer_name="str", - api_version="2024-04-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_operations.py index 85d912935e32..4e6bc75800ff 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,10 +20,8 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.operations.list( - api_version="2024-04-01", - ) - + def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_operations_async.py index 3bee9caf1099..abd9f14fe648 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,10 +21,8 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): - response = await self.client.operations.list( - api_version="2024-04-01", - ) - + async def test_operations_list(self, resource_group): + response = self.client.operations.list() + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations.py new file mode 100644 index 000000000000..a9920a1dfc3f --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations.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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIOsImagesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_os_images_get(self, resource_group): + response = self.client.os_images.get( + location="str", + os_image_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_os_images_list_by_subscription_location_resource(self, resource_group): + response = self.client.os_images.list_by_subscription_location_resource( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations_async.py new file mode 100644 index 000000000000..354f39cfe1e4 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_os_images_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci.aio import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIOsImagesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_os_images_get(self, resource_group): + response = await self.client.os_images.get( + location="str", + os_image_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_os_images_list_by_subscription_location_resource(self, resource_group): + response = self.client.os_images.list_by_subscription_location_resource( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations.py new file mode 100644 index 000000000000..9abfbab2f3e5 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIOwnershipVouchersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ownership_vouchers_validate(self, resource_group): + response = self.client.ownership_vouchers.validate( + resource_group_name=resource_group.name, + location="str", + validation_request={"ownershipVoucherDetails": [{"ownerKeyType": "str", "ownershipVoucher": "str"}]}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations_async.py new file mode 100644 index 000000000000..cec2d7a2b92c --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_ownership_vouchers_operations_async.py @@ -0,0 +1,32 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci.aio import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIOwnershipVouchersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ownership_vouchers_validate(self, resource_group): + response = await self.client.ownership_vouchers.validate( + resource_group_name=resource_group.name, + location="str", + validation_request={"ownershipVoucherDetails": [{"ownerKeyType": "str", "ownershipVoucher": "str"}]}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations.py new file mode 100644 index 000000000000..7f7aacb9b283 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations.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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIPlatformUpdatesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_platform_updates_get(self, resource_group): + response = self.client.platform_updates.get( + location="str", + platform_update_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_platform_updates_list(self, resource_group): + response = self.client.platform_updates.list( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations_async.py new file mode 100644 index 000000000000..36bf46ce3d10 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_platform_updates_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci.aio import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIPlatformUpdatesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_platform_updates_get(self, resource_group): + response = await self.client.platform_updates.get( + location="str", + platform_update_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_platform_updates_list(self, resource_group): + response = self.client.platform_updates.list( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations.py index b8ff5ab5f2bd..9381bde678af 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,25 +20,23 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_cluster(self, resource_group): - response = self.client.publishers.list_by_cluster( + def test_publishers_get(self, resource_group): + response = self.client.publishers.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + publisher_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.publishers.get( + def test_publishers_list_by_cluster(self, resource_group): + response = self.client.publishers.list_by_cluster( resource_group_name=resource_group.name, cluster_name="str", - publisher_name="str", - api_version="2024-04-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations_async.py index 30ca60b18682..e5fea572c422 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_publishers_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,25 +21,23 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_cluster(self, resource_group): - response = self.client.publishers.list_by_cluster( + async def test_publishers_get(self, resource_group): + response = await self.client.publishers.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + publisher_name="str", ) - 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_get(self, resource_group): - response = await self.client.publishers.get( + async def test_publishers_list_by_cluster(self, resource_group): + response = self.client.publishers.list_by_cluster( resource_group_name=resource_group.name, cluster_name="str", - publisher_name="str", - api_version="2024-04-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_security_settings_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_security_settings_operations.py index 4a09b4536e85..995f429b8d4b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_security_settings_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_security_settings_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,24 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_clusters(self, resource_group): - response = self.client.security_settings.list_by_clusters( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): + def test_security_settings_get(self, resource_group): response = self.client.security_settings.get( resource_group_name=resource_group.name, cluster_name="str", - security_settings_name="default", - api_version="2024-04-01", + security_settings_name="str", ) # please add some check logic here by yourself @@ -45,23 +32,27 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_security_settings_begin_create_or_update(self, resource_group): response = self.client.security_settings.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", + security_settings_name="str", resource={ "id": "str", "name": "str", - "provisioningState": "str", - "securedCoreComplianceAssignment": "str", - "securityComplianceStatus": { - "dataAtRestEncrypted": "str", - "dataInTransitProtected": "str", - "lastUpdated": "2020-02-20 00:00:00", - "securedCoreCompliance": "str", - "wdacCompliance": "str", + "properties": { + "provisioningState": "str", + "securedCoreComplianceAssignment": "str", + "securityComplianceStatus": { + "dataAtRestEncrypted": "str", + "dataInTransitProtected": "str", + "lastUpdated": "2020-02-20 00:00:00", + "securedCoreCompliance": "str", + "wdacCompliance": "str", + }, + "smbEncryptionForIntraClusterTrafficComplianceAssignment": "str", + "wdacComplianceAssignment": "str", }, - "smbEncryptionForIntraClusterTrafficComplianceAssignment": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -71,10 +62,7 @@ def test_begin_create_or_update(self, resource_group): "lastModifiedByType": "str", }, "type": "str", - "wdacComplianceAssignment": "str", }, - security_settings_name="default", - api_version="2024-04-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -82,13 +70,23 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_security_settings_begin_delete(self, resource_group): response = self.client.security_settings.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - security_settings_name="default", - api_version="2024-04-01", + security_settings_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_security_settings_list_by_clusters(self, resource_group): + response = self.client.security_settings.list_by_clusters( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_security_settings_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_security_settings_operations_async.py index 4b56e479fec4..fab55ba1e153 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_security_settings_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_security_settings_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,24 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_clusters(self, resource_group): - response = self.client.security_settings.list_by_clusters( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-04-01", - ) - 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_get(self, resource_group): + async def test_security_settings_get(self, resource_group): response = await self.client.security_settings.get( resource_group_name=resource_group.name, cluster_name="str", - security_settings_name="default", - api_version="2024-04-01", + security_settings_name="str", ) # please add some check logic here by yourself @@ -46,24 +33,28 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_security_settings_begin_create_or_update(self, resource_group): response = await ( await self.client.security_settings.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", + security_settings_name="str", resource={ "id": "str", "name": "str", - "provisioningState": "str", - "securedCoreComplianceAssignment": "str", - "securityComplianceStatus": { - "dataAtRestEncrypted": "str", - "dataInTransitProtected": "str", - "lastUpdated": "2020-02-20 00:00:00", - "securedCoreCompliance": "str", - "wdacCompliance": "str", + "properties": { + "provisioningState": "str", + "securedCoreComplianceAssignment": "str", + "securityComplianceStatus": { + "dataAtRestEncrypted": "str", + "dataInTransitProtected": "str", + "lastUpdated": "2020-02-20 00:00:00", + "securedCoreCompliance": "str", + "wdacCompliance": "str", + }, + "smbEncryptionForIntraClusterTrafficComplianceAssignment": "str", + "wdacComplianceAssignment": "str", }, - "smbEncryptionForIntraClusterTrafficComplianceAssignment": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -73,10 +64,7 @@ async def test_begin_create_or_update(self, resource_group): "lastModifiedByType": "str", }, "type": "str", - "wdacComplianceAssignment": "str", }, - security_settings_name="default", - api_version="2024-04-01", ) ).result() # call '.result()' to poll until service return final result @@ -85,15 +73,25 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_security_settings_begin_delete(self, resource_group): response = await ( await self.client.security_settings.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - security_settings_name="default", - api_version="2024-04-01", + security_settings_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_security_settings_list_by_clusters(self, resource_group): + response = self.client.security_settings.list_by_clusters( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_skus_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_skus_operations.py index 96716711a736..f46ccae8433b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_skus_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_skus_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,29 +20,27 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_offer(self, resource_group): - response = self.client.skus.list_by_offer( + def test_skus_get(self, resource_group): + response = self.client.skus.get( resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", offer_name="str", - api_version="2024-04-01", + sku_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.skus.get( + def test_skus_list_by_offer(self, resource_group): + response = self.client.skus.list_by_offer( resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", offer_name="str", - sku_name="str", - api_version="2024-04-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_skus_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_skus_operations_async.py index 79b8dc6a74ea..f7fa965c08e9 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_skus_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_skus_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,29 +21,27 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_offer(self, resource_group): - response = self.client.skus.list_by_offer( + async def test_skus_get(self, resource_group): + response = await self.client.skus.get( resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", offer_name="str", - api_version="2024-04-01", + sku_name="str", ) - 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_get(self, resource_group): - response = await self.client.skus.get( + async def test_skus_list_by_offer(self, resource_group): + response = self.client.skus.list_by_offer( resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", offer_name="str", - sku_name="str", - api_version="2024-04-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations.py new file mode 100644 index 000000000000..7ab58d06aabb --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations.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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIUpdateContentsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_update_contents_get(self, resource_group): + response = self.client.update_contents.get( + location="str", + update_content_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_update_contents_list(self, resource_group): + response = self.client.update_contents.list( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations_async.py new file mode 100644 index 000000000000..30a206426a11 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_contents_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci.aio import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIUpdateContentsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_update_contents_get(self, resource_group): + response = await self.client.update_contents.get( + location="str", + update_content_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_update_contents_list(self, resource_group): + response = self.client.update_contents.list( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_runs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_runs_operations.py index 795a1dbe1b26..ed6cd7e28d60 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_runs_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_runs_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,56 +20,33 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.update_runs.list( - resource_group_name=resource_group.name, - cluster_name="str", - update_name="str", - api_version="2024-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete(self, resource_group): - response = self.client.update_runs.begin_delete( + def test_update_runs_get(self, resource_group): + response = self.client.update_runs.get( resource_group_name=resource_group.name, cluster_name="str", update_name="str", update_run_name="str", - api_version="2024-04-01", - ).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_put(self, resource_group): + def test_update_runs_put(self, resource_group): response = self.client.update_runs.put( resource_group_name=resource_group.name, cluster_name="str", update_name="str", update_run_name="str", update_runs_properties={ - "description": "str", - "duration": "str", - "endTimeUtc": "2020-02-20 00:00:00", - "errorMessage": "str", - "expectedExecutionTime": "str", "id": "str", - "lastUpdatedTime": "2020-02-20 00:00:00", - "lastUpdatedTimeUtc": "2020-02-20 00:00:00", "location": "str", "name": "str", - "provisioningState": "str", - "startTimeUtc": "2020-02-20 00:00:00", - "state": "str", - "status": "str", - "steps": [ - { + "properties": { + "duration": "str", + "lastUpdatedTime": "2020-02-20 00:00:00", + "progress": { "description": "str", "endTimeUtc": "2020-02-20 00:00:00", "errorMessage": "str", @@ -79,8 +56,11 @@ def test_put(self, resource_group): "startTimeUtc": "2020-02-20 00:00:00", "status": "str", "steps": [...], - } - ], + }, + "provisioningState": "str", + "state": "str", + "timeStarted": "2020-02-20 00:00:00", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -89,10 +69,8 @@ def test_put(self, resource_group): "lastModifiedBy": "str", "lastModifiedByType": "str", }, - "timeStarted": "2020-02-20 00:00:00", "type": "str", }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -100,14 +78,25 @@ def test_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.update_runs.get( + def test_update_runs_begin_delete(self, resource_group): + response = self.client.update_runs.begin_delete( resource_group_name=resource_group.name, cluster_name="str", update_name="str", update_run_name="str", - api_version="2024-04-01", - ) + ).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_update_runs_list(self, resource_group): + response = self.client.update_runs.list( + resource_group_name=resource_group.name, + cluster_name="str", + update_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_runs_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_runs_operations_async.py index b3283f3e8e79..18ca562ddd3e 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_runs_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_runs_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,58 +21,33 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.update_runs.list( + async def test_update_runs_get(self, resource_group): + response = await self.client.update_runs.get( resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + update_run_name="str", ) - 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_begin_delete(self, resource_group): - response = await ( - await self.client.update_runs.begin_delete( - resource_group_name=resource_group.name, - cluster_name="str", - update_name="str", - update_run_name="str", - api_version="2024-04-01", - ) - ).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_put(self, resource_group): + async def test_update_runs_put(self, resource_group): response = await self.client.update_runs.put( resource_group_name=resource_group.name, cluster_name="str", update_name="str", update_run_name="str", update_runs_properties={ - "description": "str", - "duration": "str", - "endTimeUtc": "2020-02-20 00:00:00", - "errorMessage": "str", - "expectedExecutionTime": "str", "id": "str", - "lastUpdatedTime": "2020-02-20 00:00:00", - "lastUpdatedTimeUtc": "2020-02-20 00:00:00", "location": "str", "name": "str", - "provisioningState": "str", - "startTimeUtc": "2020-02-20 00:00:00", - "state": "str", - "status": "str", - "steps": [ - { + "properties": { + "duration": "str", + "lastUpdatedTime": "2020-02-20 00:00:00", + "progress": { "description": "str", "endTimeUtc": "2020-02-20 00:00:00", "errorMessage": "str", @@ -82,8 +57,11 @@ async def test_put(self, resource_group): "startTimeUtc": "2020-02-20 00:00:00", "status": "str", "steps": [...], - } - ], + }, + "provisioningState": "str", + "state": "str", + "timeStarted": "2020-02-20 00:00:00", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -92,10 +70,8 @@ async def test_put(self, resource_group): "lastModifiedBy": "str", "lastModifiedByType": "str", }, - "timeStarted": "2020-02-20 00:00:00", "type": "str", }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -103,14 +79,27 @@ async def test_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.update_runs.get( + async def test_update_runs_begin_delete(self, resource_group): + response = await ( + await self.client.update_runs.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + update_name="str", + update_run_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_update_runs_list(self, resource_group): + response = self.client.update_runs.list( resource_group_name=resource_group.name, cluster_name="str", update_name="str", - update_run_name="str", - api_version="2024-04-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_summaries_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_summaries_operations.py index c0145c494cfe..bdbdb624cfae 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_summaries_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_summaries_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,69 +20,58 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.update_summaries.list( + def test_update_summaries_get(self, resource_group): + response = self.client.update_summaries.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete(self, resource_group): - response = self.client.update_summaries.begin_delete( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-04-01", - ).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_put(self, resource_group): + def test_update_summaries_put(self, resource_group): response = self.client.update_summaries.put( resource_group_name=resource_group.name, cluster_name="str", update_location_properties={ - "currentOemVersion": "str", - "currentSbeVersion": "str", - "currentVersion": "str", - "hardwareModel": "str", - "healthCheckDate": "2020-02-20 00:00:00", - "healthCheckResult": [ - { - "additionalData": "str", - "description": "str", - "displayName": "str", - "healthCheckSource": "str", - "healthCheckTags": {}, - "name": "str", - "remediation": "str", - "severity": "str", - "status": "str", - "tags": {"key": "str", "value": "str"}, - "targetResourceID": "str", - "targetResourceName": "str", - "targetResourceType": "str", - "timestamp": "2020-02-20 00:00:00", - "title": "str", - } - ], - "healthState": "str", "id": "str", - "lastChecked": "2020-02-20 00:00:00", - "lastUpdated": "2020-02-20 00:00:00", "location": "str", "name": "str", - "oemFamily": "str", - "packageVersions": [{"lastUpdated": "2020-02-20 00:00:00", "packageType": "str", "version": "str"}], - "provisioningState": "str", - "state": "str", + "properties": { + "currentOemVersion": "str", + "currentSbeVersion": "str", + "currentVersion": "str", + "hardwareModel": "str", + "healthCheckDate": "2020-02-20 00:00:00", + "healthCheckResult": [ + { + "additionalData": "str", + "description": "str", + "displayName": "str", + "healthCheckSource": "str", + "healthCheckTags": {}, + "name": "str", + "remediation": "str", + "severity": "str", + "status": "str", + "tags": {"key": "str", "value": "str"}, + "targetResourceID": "str", + "targetResourceName": "str", + "targetResourceType": "str", + "timestamp": "2020-02-20 00:00:00", + "title": "str", + } + ], + "healthState": "str", + "lastChecked": "2020-02-20 00:00:00", + "lastUpdated": "2020-02-20 00:00:00", + "oemFamily": "str", + "packageVersions": [{"lastUpdated": "2020-02-20 00:00:00", "packageType": "str", "version": "str"}], + "provisioningState": "str", + "state": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -93,7 +82,6 @@ def test_put(self, resource_group): }, "type": "str", }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -101,12 +89,22 @@ def test_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.update_summaries.get( + def test_update_summaries_begin_delete(self, resource_group): + response = self.client.update_summaries.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", - ) + ).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_update_summaries_list(self, resource_group): + response = self.client.update_summaries.list( + resource_group_name=resource_group.name, + cluster_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_summaries_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_summaries_operations_async.py index cc60f92f8ed5..5f4968ad6d18 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_summaries_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_summaries_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,71 +21,58 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.update_summaries.list( + async def test_update_summaries_get(self, resource_group): + response = await self.client.update_summaries.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", ) - 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_begin_delete(self, resource_group): - response = await ( - await self.client.update_summaries.begin_delete( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-04-01", - ) - ).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_put(self, resource_group): + async def test_update_summaries_put(self, resource_group): response = await self.client.update_summaries.put( resource_group_name=resource_group.name, cluster_name="str", update_location_properties={ - "currentOemVersion": "str", - "currentSbeVersion": "str", - "currentVersion": "str", - "hardwareModel": "str", - "healthCheckDate": "2020-02-20 00:00:00", - "healthCheckResult": [ - { - "additionalData": "str", - "description": "str", - "displayName": "str", - "healthCheckSource": "str", - "healthCheckTags": {}, - "name": "str", - "remediation": "str", - "severity": "str", - "status": "str", - "tags": {"key": "str", "value": "str"}, - "targetResourceID": "str", - "targetResourceName": "str", - "targetResourceType": "str", - "timestamp": "2020-02-20 00:00:00", - "title": "str", - } - ], - "healthState": "str", "id": "str", - "lastChecked": "2020-02-20 00:00:00", - "lastUpdated": "2020-02-20 00:00:00", "location": "str", "name": "str", - "oemFamily": "str", - "packageVersions": [{"lastUpdated": "2020-02-20 00:00:00", "packageType": "str", "version": "str"}], - "provisioningState": "str", - "state": "str", + "properties": { + "currentOemVersion": "str", + "currentSbeVersion": "str", + "currentVersion": "str", + "hardwareModel": "str", + "healthCheckDate": "2020-02-20 00:00:00", + "healthCheckResult": [ + { + "additionalData": "str", + "description": "str", + "displayName": "str", + "healthCheckSource": "str", + "healthCheckTags": {}, + "name": "str", + "remediation": "str", + "severity": "str", + "status": "str", + "tags": {"key": "str", "value": "str"}, + "targetResourceID": "str", + "targetResourceName": "str", + "targetResourceType": "str", + "timestamp": "2020-02-20 00:00:00", + "title": "str", + } + ], + "healthState": "str", + "lastChecked": "2020-02-20 00:00:00", + "lastUpdated": "2020-02-20 00:00:00", + "oemFamily": "str", + "packageVersions": [{"lastUpdated": "2020-02-20 00:00:00", "packageType": "str", "version": "str"}], + "provisioningState": "str", + "state": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -96,7 +83,6 @@ async def test_put(self, resource_group): }, "type": "str", }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -104,12 +90,24 @@ async def test_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.update_summaries.get( + async def test_update_summaries_begin_delete(self, resource_group): + response = await ( + await self.client.update_summaries.begin_delete( + 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_update_summaries_list(self, resource_group): + response = self.client.update_summaries.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_updates_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_updates_operations.py index 93d23ec988d7..6b8ff4550f75 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_updates_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_updates_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,91 +20,69 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_post(self, resource_group): - response = self.client.updates.begin_post( + def test_updates_get(self, resource_group): + response = self.client.updates.get( resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", - ).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_list(self, resource_group): - response = self.client.updates.list( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-04-01", ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete(self, resource_group): - response = self.client.updates.begin_delete( - resource_group_name=resource_group.name, - cluster_name="str", - update_name="str", - api_version="2024-04-01", - ).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_put(self, resource_group): + def test_updates_put(self, resource_group): response = self.client.updates.put( resource_group_name=resource_group.name, cluster_name="str", update_name="str", update_properties={ - "availabilityType": "str", - "componentVersions": [{"lastUpdated": "2020-02-20 00:00:00", "packageType": "str", "version": "str"}], - "description": "str", - "displayName": "str", - "healthCheckDate": "2020-02-20 00:00:00", - "healthCheckResult": [ - { - "additionalData": "str", - "description": "str", - "displayName": "str", - "healthCheckSource": "str", - "healthCheckTags": {}, - "name": "str", - "remediation": "str", - "severity": "str", - "status": "str", - "tags": {"key": "str", "value": "str"}, - "targetResourceID": "str", - "targetResourceName": "str", - "targetResourceType": "str", - "timestamp": "2020-02-20 00:00:00", - "title": "str", - } - ], - "healthState": "str", "id": "str", - "installedDate": "2020-02-20 00:00:00", "location": "str", - "minSbeVersionRequired": "str", "name": "str", - "notifyMessage": "str", - "packagePath": "str", - "packageSizeInMb": 0.0, - "packageType": "str", - "prerequisites": [{"packageName": "str", "updateType": "str", "version": "str"}], - "progressPercentage": 0.0, - "provisioningState": "str", - "publisher": "str", - "rebootRequired": "str", - "releaseLink": "str", - "state": "str", + "properties": { + "availabilityType": "str", + "componentVersions": [ + {"lastUpdated": "2020-02-20 00:00:00", "packageType": "str", "version": "str"} + ], + "description": "str", + "displayName": "str", + "healthCheckDate": "2020-02-20 00:00:00", + "healthCheckResult": [ + { + "additionalData": "str", + "description": "str", + "displayName": "str", + "healthCheckSource": "str", + "healthCheckTags": {}, + "name": "str", + "remediation": "str", + "severity": "str", + "status": "str", + "tags": {"key": "str", "value": "str"}, + "targetResourceID": "str", + "targetResourceName": "str", + "targetResourceType": "str", + "timestamp": "2020-02-20 00:00:00", + "title": "str", + } + ], + "healthState": "str", + "installedDate": "2020-02-20 00:00:00", + "minSbeVersionRequired": "str", + "packagePath": "str", + "packageSizeInMb": 0.0, + "packageType": "str", + "prerequisites": [{"packageName": "str", "updateType": "str", "version": "str"}], + "provisioningState": "str", + "publisher": "str", + "rebootRequired": "str", + "releaseLink": "str", + "state": "str", + "updateStateProperties": {"notifyMessage": "str", "progressPercentage": 0.0}, + "version": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -114,9 +92,7 @@ def test_put(self, resource_group): "lastModifiedByType": "str", }, "type": "str", - "version": "str", }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -124,13 +100,35 @@ def test_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.updates.get( + def test_updates_begin_delete(self, resource_group): + response = self.client.updates.begin_delete( resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + ).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_updates_list(self, resource_group): + response = self.client.updates.list( + resource_group_name=resource_group.name, + cluster_name="str", ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_updates_begin_post(self, resource_group): + response = self.client.updates.begin_post( + resource_group_name=resource_group.name, + cluster_name="str", + update_name="str", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_updates_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_updates_operations_async.py index 6929349d843f..458740531424 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_updates_operations_async.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_updates_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,95 +21,69 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_post(self, resource_group): - response = await ( - await self.client.updates.begin_post( - resource_group_name=resource_group.name, - cluster_name="str", - update_name="str", - api_version="2024-04-01", - ) - ).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_list(self, resource_group): - response = self.client.updates.list( + async def test_updates_get(self, resource_group): + response = await self.client.updates.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + update_name="str", ) - 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_begin_delete(self, resource_group): - response = await ( - await self.client.updates.begin_delete( - resource_group_name=resource_group.name, - cluster_name="str", - update_name="str", - api_version="2024-04-01", - ) - ).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_put(self, resource_group): + async def test_updates_put(self, resource_group): response = await self.client.updates.put( resource_group_name=resource_group.name, cluster_name="str", update_name="str", update_properties={ - "availabilityType": "str", - "componentVersions": [{"lastUpdated": "2020-02-20 00:00:00", "packageType": "str", "version": "str"}], - "description": "str", - "displayName": "str", - "healthCheckDate": "2020-02-20 00:00:00", - "healthCheckResult": [ - { - "additionalData": "str", - "description": "str", - "displayName": "str", - "healthCheckSource": "str", - "healthCheckTags": {}, - "name": "str", - "remediation": "str", - "severity": "str", - "status": "str", - "tags": {"key": "str", "value": "str"}, - "targetResourceID": "str", - "targetResourceName": "str", - "targetResourceType": "str", - "timestamp": "2020-02-20 00:00:00", - "title": "str", - } - ], - "healthState": "str", "id": "str", - "installedDate": "2020-02-20 00:00:00", "location": "str", - "minSbeVersionRequired": "str", "name": "str", - "notifyMessage": "str", - "packagePath": "str", - "packageSizeInMb": 0.0, - "packageType": "str", - "prerequisites": [{"packageName": "str", "updateType": "str", "version": "str"}], - "progressPercentage": 0.0, - "provisioningState": "str", - "publisher": "str", - "rebootRequired": "str", - "releaseLink": "str", - "state": "str", + "properties": { + "availabilityType": "str", + "componentVersions": [ + {"lastUpdated": "2020-02-20 00:00:00", "packageType": "str", "version": "str"} + ], + "description": "str", + "displayName": "str", + "healthCheckDate": "2020-02-20 00:00:00", + "healthCheckResult": [ + { + "additionalData": "str", + "description": "str", + "displayName": "str", + "healthCheckSource": "str", + "healthCheckTags": {}, + "name": "str", + "remediation": "str", + "severity": "str", + "status": "str", + "tags": {"key": "str", "value": "str"}, + "targetResourceID": "str", + "targetResourceName": "str", + "targetResourceType": "str", + "timestamp": "2020-02-20 00:00:00", + "title": "str", + } + ], + "healthState": "str", + "installedDate": "2020-02-20 00:00:00", + "minSbeVersionRequired": "str", + "packagePath": "str", + "packageSizeInMb": 0.0, + "packageType": "str", + "prerequisites": [{"packageName": "str", "updateType": "str", "version": "str"}], + "provisioningState": "str", + "publisher": "str", + "rebootRequired": "str", + "releaseLink": "str", + "state": "str", + "updateStateProperties": {"notifyMessage": "str", "progressPercentage": 0.0}, + "version": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -119,9 +93,7 @@ async def test_put(self, resource_group): "lastModifiedByType": "str", }, "type": "str", - "version": "str", }, - api_version="2024-04-01", ) # please add some check logic here by yourself @@ -129,13 +101,39 @@ async def test_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.updates.get( + async def test_updates_begin_delete(self, resource_group): + response = await ( + await self.client.updates.begin_delete( + resource_group_name=resource_group.name, + cluster_name="str", + update_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_updates_list(self, resource_group): + response = self.client.updates.list( resource_group_name=resource_group.name, cluster_name="str", - update_name="str", - api_version="2024-04-01", ) + 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_updates_begin_post(self, resource_group): + response = await ( + await self.client.updates.begin_post( + resource_group_name=resource_group.name, + cluster_name="str", + update_name="str", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_validated_solution_recipes_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_validated_solution_recipes_operations.py new file mode 100644 index 000000000000..15f49bb5013f --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_validated_solution_recipes_operations.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. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIValidatedSolutionRecipesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_validated_solution_recipes_get(self, resource_group): + response = self.client.validated_solution_recipes.get( + location="str", + validated_solution_recipe_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_validated_solution_recipes_list_by_subscription_location_resource(self, resource_group): + response = self.client.validated_solution_recipes.list_by_subscription_location_resource( + location="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_validated_solution_recipes_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_validated_solution_recipes_operations_async.py new file mode 100644 index 000000000000..8de1b5a179b1 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_validated_solution_recipes_operations_async.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.azurestackhci.aio import AzureStackHCIClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAzureStackHCIValidatedSolutionRecipesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_validated_solution_recipes_get(self, resource_group): + response = await self.client.validated_solution_recipes.get( + location="str", + validated_solution_recipe_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_validated_solution_recipes_list_by_subscription_location_resource(self, resource_group): + response = self.client.validated_solution_recipes.list_by_subscription_location_resource( + location="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/pyproject.toml b/sdk/azurestackhci/azure-mgmt-azurestackhci/pyproject.toml index 540da07d41af..98a450941b32 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/pyproject.toml +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-azurestackhci" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Azurestackhci Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] +requires-python = ">=3.9" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.azurestackhci._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false pyright = false type_check_samples = false verifytypes = false + +[packaging] +package_name = "azure-mgmt-azurestackhci" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Azure Stack HCI Management" +package_doc_id = "" +is_stable = false +is_arm = true +title = "AzureStackHCIClient" +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/sdk_packaging.toml b/sdk/azurestackhci/azure-mgmt-azurestackhci/sdk_packaging.toml deleted file mode 100644 index 7d20975b1aea..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/sdk_packaging.toml +++ /dev/null @@ -1,8 +0,0 @@ -[packaging] -package_name = "azure-mgmt-azurestackhci" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Azure Stack HCI Management" -package_doc_id = "" -is_stable = false -is_arm = true -title = "AzureStackHCIClient" diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/setup.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/setup.py deleted file mode 100644 index 17bb6ae831b0..000000000000 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/setup.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-azurestackhci" -PACKAGE_PPRINT_NAME = "Azure Stack HCI Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", - ], - python_requires=">=3.8", -) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/tests/test_azure_stack_hci_clusters_operations_async_test.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/tests/test_azure_stack_hci_clusters_operations_async_test.py index d7983fee832c..a29ae4bf8cb1 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/tests/test_azure_stack_hci_clusters_operations_async_test.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/tests/test_azure_stack_hci_clusters_operations_async_test.py @@ -1,4 +1,3 @@ - # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/tests/test_azure_stack_hci_operations_async_test.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/tests/test_azure_stack_hci_operations_async_test.py index a26a44327c76..ad436650ffc6 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/tests/test_azure_stack_hci_operations_async_test.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/tests/test_azure_stack_hci_operations_async_test.py @@ -1,4 +1,3 @@ - # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/tsp-location.yaml b/sdk/azurestackhci/azure-mgmt-azurestackhci/tsp-location.yaml new file mode 100644 index 000000000000..b79dbc460818 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI +commit: 9564453c2af68fd5b29dd4bfc31d547f4e6e7cd1 +repo: Azure/azure-rest-api-specs +additionalDirectories: