From 80a9bf5e941c3efe5b47a14bfa0eb1a9d03f7247 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 30 Sep 2024 19:40:45 +0000 Subject: [PATCH] CodeGen from PR 30637 in Azure/azure-rest-api-specs Merge 114c216f8e6877725b5187e7d82b8d8e9aa67224 into 1b9c5dafba0f4b5185279197f82b350a46fe43ba --- .../azure-mgmt-azurestackhci/_meta.json | 6 +- .../azurestackhci/_azure_stack_hci_client.py | 61 +- .../mgmt/azurestackhci/_configuration.py | 6 +- .../azure/mgmt/azurestackhci/_version.py | 2 +- .../aio/_azure_stack_hci_client.py | 63 +- .../mgmt/azurestackhci/aio/_configuration.py | 6 +- .../azurestackhci/aio/operations/__init__.py | 20 + .../aio/operations/_clusters_operations.py | 402 - .../operations/_gallery_images_operations.py | 792 ++ .../aio/operations/_guest_agent_operations.py | 402 + .../operations/_guest_agents_operations.py | 136 + .../_hybrid_identity_metadata_operations.py | 193 + .../_logical_networks_operations.py | 795 ++ .../_marketplace_gallery_images_operations.py | 808 ++ .../_network_interfaces_operations.py | 797 ++ .../_storage_containers_operations.py | 797 ++ .../_virtual_hard_disks_operations.py | 797 ++ .../_virtual_machine_instances_operations.py | 1016 ++ .../mgmt/azurestackhci/models/__init__.py | 324 +- .../models/_azure_stack_hci_client_enums.py | 211 +- .../mgmt/azurestackhci/models/_models_py3.py | 8879 ++++++++++------- .../mgmt/azurestackhci/operations/__init__.py | 20 + .../operations/_arc_settings_operations.py | 36 +- .../operations/_clusters_operations.py | 502 +- .../_deployment_settings_operations.py | 16 +- .../operations/_edge_devices_operations.py | 10 +- .../operations/_extensions_operations.py | 24 +- .../operations/_gallery_images_operations.py | 1000 ++ .../operations/_guest_agent_operations.py | 485 + .../operations/_guest_agents_operations.py | 165 + .../_hybrid_identity_metadata_operations.py | 248 + .../_logical_networks_operations.py | 1003 ++ .../_marketplace_gallery_images_operations.py | 1020 ++ .../_network_interfaces_operations.py | 1003 ++ .../operations/_offers_operations.py | 12 +- .../azurestackhci/operations/_operations.py | 2 +- .../operations/_publishers_operations.py | 8 +- .../_security_settings_operations.py | 16 +- .../operations/_skus_operations.py | 8 +- .../_storage_containers_operations.py | 1003 ++ .../operations/_update_runs_operations.py | 16 +- .../_update_summaries_operations.py | 16 +- .../operations/_updates_operations.py | 20 +- .../_virtual_hard_disks_operations.py | 1003 ++ .../_virtual_machine_instances_operations.py | 1208 +++ .../consent_and_install_default_extensions.py | 2 +- .../generated_samples/create_arc_identity.py | 2 +- .../generated_samples/create_cluster.py | 2 +- .../create_cluster_identity.py | 2 +- .../generated_samples/create_guest_agent.py | 41 + .../generated_samples/delete_arc_setting.py | 2 +- .../generated_samples/delete_cluster.py | 2 +- .../delete_deployment_settings.py | 2 +- .../generated_samples/delete_edge_devices.py | 2 +- .../generated_samples/delete_extension.py | 2 +- .../generated_samples/delete_gallery_image.py | 41 + .../generated_samples/delete_guest_agent.py | 40 + .../delete_logical_network.py | 41 + .../delete_marketplace_gallery_image.py | 41 + .../delete_network_interface.py | 41 + .../delete_security_settings.py | 2 +- .../delete_storage_container.py | 41 + .../generated_samples/delete_update_runs.py | 2 +- .../delete_update_summaries.py | 2 +- .../generated_samples/delete_updates.py | 2 +- .../delete_virtual_hard_disk.py | 41 + .../delete_virtual_machine_instance.py | 40 + .../extend_software_assurance_benefit.py | 2 +- .../generated_samples/extensions_upgrade.py | 2 +- .../generated_samples/generate_password.py | 2 +- .../generated_samples/get_arc_setting.py | 2 +- .../generated_samples/get_cluster.py | 2 +- .../get_deployment_settings.py | 2 +- .../generated_samples/get_edge_devices.py | 2 +- .../generated_samples/get_extension.py | 2 +- .../generated_samples/get_gallery_image.py | 42 + .../generated_samples/get_guest_agent.py | 41 + .../get_hybrid_identity_metadata.py | 41 + .../generated_samples/get_logical_network.py | 42 + .../get_marketplace_gallery_image.py | 42 + .../get_network_interface.py | 42 + .../generated_samples/get_offer.py | 2 +- .../generated_samples/get_publisher.py | 2 +- .../get_security_settings.py | 2 +- .../generated_samples/get_sku.py | 2 +- .../get_storage_container.py | 42 + .../generated_samples/get_update_runs.py | 2 +- .../generated_samples/get_update_summaries.py | 2 +- .../generated_samples/get_updates.py | 2 +- .../get_virtual_hard_disk.py | 42 + .../get_virtual_machine_instance.py | 41 + .../generated_samples/guest_agent_list.py | 42 + .../hybrid_identity_metadata_list.py | 42 + .../initialize_disable_process.py | 2 +- .../list_arc_settings_by_cluster.py | 2 +- .../list_clusters_by_resource_group.py | 2 +- .../list_clusters_by_subscription.py | 2 +- .../list_deployment_settings_by_cluster.py | 2 +- .../generated_samples/list_edge_devices.py | 2 +- .../list_extensions_by_arc_setting.py | 2 +- .../list_gallery_image_by_resource_group.py | 42 + .../list_gallery_image_by_subscription.py | 40 + .../list_logical_network_by_resource_group.py | 42 + .../list_logical_network_by_subscription.py | 40 + ...etplace_gallery_image_by_resource_group.py | 42 + ...rketplace_gallery_image_by_subscription.py | 40 + ...ist_network_interface_by_resource_group.py | 42 + .../list_network_interface_by_subscription.py | 40 + .../list_offers_by_cluster.py | 2 +- .../list_offers_by_publisher.py | 2 +- .../generated_samples/list_operations.py | 2 +- .../list_publishers_by_cluster.py | 2 +- .../list_security_settings_by_cluster.py | 2 +- .../generated_samples/list_skus_by_offer.py | 2 +- ...ist_storage_container_by_resource_group.py | 42 + .../list_storage_container_by_subscription.py | 40 + .../generated_samples/list_update_runs.py | 2 +- .../list_update_summaries.py | 2 +- .../generated_samples/list_updates.py | 2 +- ...ist_virtual_hard_disk_by_resource_group.py | 42 + .../list_virtual_hard_disk_by_subscription.py | 40 + .../list_virtual_machine_instances.py | 42 + .../generated_samples/patch_arc_setting.py | 2 +- .../generated_samples/patch_extension.py | 2 +- .../generated_samples/post_updates.py | 2 +- .../put_deployment_settings.py | 59 +- ...hci_edge_device.py => put_edge_devices.py} | 7 +- .../generated_samples/put_extension.py | 2 +- .../generated_samples/put_gallery_image.py | 54 + .../generated_samples/put_logical_network.py | 49 + .../put_marketplace_gallery_image.py | 57 + .../put_network_interface.py | 52 + .../put_security_settings.py | 10 +- .../put_storage_container.py | 50 + .../generated_samples/put_update_runs.py | 2 +- .../generated_samples/put_update_summaries.py | 2 +- .../generated_samples/put_updates.py | 2 +- .../put_virtual_hard_disk.py | 50 + ...ual_machine_instance_with_gallery_image.py | 59 + ...instance_with_marketplace_gallery_image.py | 59 + ...t_virtual_machine_instance_with_os_disk.py | 58 + ...l_machine_instance_with_vm_config_agent.py | 64 + .../restart_virtual_machine_instance.py | 41 + .../start_virtual_machine_instance.py | 41 + .../stop_virtual_machine_instance.py | 41 + .../generated_samples/update_cluster.py | 2 +- ..._collection.py => update_gallery_image.py} | 12 +- ...e_support.py => update_logical_network.py} | 16 +- .../update_marketplace_gallery_image.py | 43 + .../update_network_interface.py | 43 + .../update_storage_container.py | 43 + .../update_virtual_hard_disk.py | 43 + .../update_virtual_machine_instance.py | 52 + .../generated_samples/upload_certificate.py | 2 +- ...azure_stack_hci_arc_settings_operations.py | 18 +- ...stack_hci_arc_settings_operations_async.py | 18 +- ...est_azure_stack_hci_clusters_operations.py | 93 +- ...ure_stack_hci_clusters_operations_async.py | 99 +- ...tack_hci_deployment_settings_operations.py | 43 +- ...ci_deployment_settings_operations_async.py | 41 +- ...azure_stack_hci_edge_devices_operations.py | 140 +- ...stack_hci_edge_devices_operations_async.py | 140 +- ...t_azure_stack_hci_extensions_operations.py | 12 +- ...e_stack_hci_extensions_operations_async.py | 12 +- ...ure_stack_hci_gallery_images_operations.py | 120 + ...ack_hci_gallery_images_operations_async.py | 127 + ..._azure_stack_hci_guest_agent_operations.py | 52 + ..._stack_hci_guest_agent_operations_async.py | 57 + ...azure_stack_hci_guest_agents_operations.py | 30 + ...stack_hci_guest_agents_operations_async.py | 31 + ...hci_hybrid_identity_metadata_operations.py | 41 + ...brid_identity_metadata_operations_async.py | 42 + ...e_stack_hci_logical_networks_operations.py | 138 + ...k_hci_logical_networks_operations_async.py | 145 + ...i_marketplace_gallery_images_operations.py | 119 + ...etplace_gallery_images_operations_async.py | 126 + ...stack_hci_network_interfaces_operations.py | 124 + ...hci_network_interfaces_operations_async.py | 131 + .../test_azure_stack_hci_offers_operations.py | 6 +- ...azure_stack_hci_offers_operations_async.py | 6 +- .../test_azure_stack_hci_operations.py | 2 +- .../test_azure_stack_hci_operations_async.py | 2 +- ...t_azure_stack_hci_publishers_operations.py | 4 +- ...e_stack_hci_publishers_operations_async.py | 4 +- ..._stack_hci_security_settings_operations.py | 10 +- ..._hci_security_settings_operations_async.py | 10 +- .../test_azure_stack_hci_skus_operations.py | 4 +- ...t_azure_stack_hci_skus_operations_async.py | 4 +- ...stack_hci_storage_containers_operations.py | 114 + ...hci_storage_containers_operations_async.py | 121 + ..._azure_stack_hci_update_runs_operations.py | 10 +- ..._stack_hci_update_runs_operations_async.py | 10 +- ...e_stack_hci_update_summaries_operations.py | 12 +- ...k_hci_update_summaries_operations_async.py | 12 +- ...test_azure_stack_hci_updates_operations.py | 13 +- ...zure_stack_hci_updates_operations_async.py | 13 +- ...stack_hci_virtual_hard_disks_operations.py | 119 + ...hci_virtual_hard_disks_operations_async.py | 126 + ...ci_virtual_machine_instances_operations.py | 210 + ...tual_machine_instances_operations_async.py | 228 + 200 files changed, 25488 insertions(+), 5277 deletions(-) create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_gallery_images_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_guest_agent_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_guest_agents_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_hybrid_identity_metadata_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_logical_networks_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_marketplace_gallery_images_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_network_interfaces_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_storage_containers_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_virtual_hard_disks_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_virtual_machine_instances_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_gallery_images_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_guest_agent_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_guest_agents_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_hybrid_identity_metadata_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_logical_networks_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_marketplace_gallery_images_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_network_interfaces_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_storage_containers_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_virtual_hard_disks_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_virtual_machine_instances_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_guest_agent.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_gallery_image.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_guest_agent.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_logical_network.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_marketplace_gallery_image.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_network_interface.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_storage_container.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_virtual_hard_disk.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_virtual_machine_instance.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_gallery_image.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_guest_agent.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_hybrid_identity_metadata.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_logical_network.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_marketplace_gallery_image.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_network_interface.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_storage_container.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_virtual_hard_disk.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_virtual_machine_instance.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/guest_agent_list.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/hybrid_identity_metadata_list.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_gallery_image_by_resource_group.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_gallery_image_by_subscription.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_logical_network_by_resource_group.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_logical_network_by_subscription.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_marketplace_gallery_image_by_resource_group.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_marketplace_gallery_image_by_subscription.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_network_interface_by_resource_group.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_network_interface_by_subscription.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_storage_container_by_resource_group.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_storage_container_by_subscription.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_hard_disk_by_resource_group.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_hard_disk_by_subscription.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_machine_instances.py rename sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/{create_hci_edge_device.py => put_edge_devices.py} (93%) create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_gallery_image.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_logical_network.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_marketplace_gallery_image.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_network_interface.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_storage_container.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_hard_disk.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_gallery_image.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_marketplace_gallery_image.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_os_disk.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_vm_config_agent.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/restart_virtual_machine_instance.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/start_virtual_machine_instance.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/stop_virtual_machine_instance.py rename sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/{trigger_log_collection.py => update_gallery_image.py} (78%) rename sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/{configure_remote_support.py => update_logical_network.py} (74%) create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_marketplace_gallery_image.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_network_interface.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_storage_container.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_virtual_hard_disk.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_virtual_machine_instance.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_gallery_images_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_gallery_images_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agent_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agent_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agents_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agents_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_hybrid_identity_metadata_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_hybrid_identity_metadata_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_logical_networks_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_logical_networks_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_marketplace_gallery_images_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_marketplace_gallery_images_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_network_interfaces_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_network_interfaces_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_storage_containers_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_storage_containers_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_hard_disks_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_hard_disks_operations_async.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_machine_instances_operations.py create mode 100644 sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_machine_instances_operations_async.py diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json b/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json index 5bb25bc73234..a8134f1ccb07 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/_meta.json @@ -1,11 +1,11 @@ { - "commit": "30d040e41a4cea0d31a6c7e56726ea2df17fdcc5", + "commit": "71c6d575b514f2640f5165d7b5199ad697a8cb5a", "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" + "autorest_command": "autorest specification/azurestackhci/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/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/readme.md" } \ No newline at end of file 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/_azure_stack_hci_client.py index fd250e7d509a..8b6427cacd42 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_azure_stack_hci_client.py @@ -24,14 +24,24 @@ DeploymentSettingsOperations, EdgeDevicesOperations, ExtensionsOperations, + GalleryImagesOperations, + GuestAgentOperations, + GuestAgentsOperations, + HybridIdentityMetadataOperations, + LogicalNetworksOperations, + MarketplaceGalleryImagesOperations, + NetworkInterfacesOperations, OffersOperations, Operations, PublishersOperations, SecuritySettingsOperations, SkusOperations, + StorageContainersOperations, UpdateRunsOperations, UpdateSummariesOperations, UpdatesOperations, + VirtualHardDisksOperations, + VirtualMachineInstancesOperations, ) if TYPE_CHECKING: @@ -52,6 +62,15 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :vartype edge_devices: azure.mgmt.azurestackhci.operations.EdgeDevicesOperations :ivar extensions: ExtensionsOperations operations :vartype extensions: azure.mgmt.azurestackhci.operations.ExtensionsOperations + :ivar gallery_images: GalleryImagesOperations operations + :vartype gallery_images: azure.mgmt.azurestackhci.operations.GalleryImagesOperations + :ivar logical_networks: LogicalNetworksOperations operations + :vartype logical_networks: azure.mgmt.azurestackhci.operations.LogicalNetworksOperations + :ivar marketplace_gallery_images: MarketplaceGalleryImagesOperations operations + :vartype marketplace_gallery_images: + azure.mgmt.azurestackhci.operations.MarketplaceGalleryImagesOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: azure.mgmt.azurestackhci.operations.NetworkInterfacesOperations :ivar offers: OffersOperations operations :vartype offers: azure.mgmt.azurestackhci.operations.OffersOperations :ivar operations: Operations operations @@ -62,19 +81,33 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :vartype security_settings: azure.mgmt.azurestackhci.operations.SecuritySettingsOperations :ivar skus: SkusOperations operations :vartype skus: azure.mgmt.azurestackhci.operations.SkusOperations + :ivar storage_containers: StorageContainersOperations operations + :vartype storage_containers: azure.mgmt.azurestackhci.operations.StorageContainersOperations :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 + :ivar virtual_hard_disks: VirtualHardDisksOperations operations + :vartype virtual_hard_disks: azure.mgmt.azurestackhci.operations.VirtualHardDisksOperations + :ivar virtual_machine_instances: VirtualMachineInstancesOperations operations + :vartype virtual_machine_instances: + azure.mgmt.azurestackhci.operations.VirtualMachineInstancesOperations + :ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations + :vartype hybrid_identity_metadata: + azure.mgmt.azurestackhci.operations.HybridIdentityMetadataOperations + :ivar guest_agent: GuestAgentOperations operations + :vartype guest_agent: azure.mgmt.azurestackhci.operations.GuestAgentOperations + :ivar guest_agents: GuestAgentsOperations operations + :vartype guest_agents: azure.mgmt.azurestackhci.operations.GuestAgentsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-01-01". 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 @@ -122,6 +155,16 @@ def __init__( ) self.edge_devices = EdgeDevicesOperations(self._client, self._config, self._serialize, self._deserialize) self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.gallery_images = GalleryImagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.logical_networks = LogicalNetworksOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.marketplace_gallery_images = MarketplaceGalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_interfaces = NetworkInterfacesOperations( + 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) @@ -129,11 +172,25 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) + self.storage_containers = StorageContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.update_runs = UpdateRunsOperations(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) + self.virtual_hard_disks = VirtualHardDisksOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_instances = VirtualMachineInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.hybrid_identity_metadata = HybridIdentityMetadataOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.guest_agent = GuestAgentOperations(self._client, self._config, self._serialize, self._deserialize) + self.guest_agents = GuestAgentsOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. 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..35b9022b5cd3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_configuration.py @@ -26,15 +26,15 @@ class AzureStackHCIClientConfiguration: # pylint: disable=too-many-instance-att :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-01-01". 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") + api_version: str = kwargs.pop("api_version", "2024-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") 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..e5754a47ce68 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "8.0.0b4" +VERSION = "1.0.0b1" 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/_azure_stack_hci_client.py index 337a69cb70e8..1bbe13bf1a9d 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/_azure_stack_hci_client.py @@ -24,14 +24,24 @@ DeploymentSettingsOperations, EdgeDevicesOperations, ExtensionsOperations, + GalleryImagesOperations, + GuestAgentOperations, + GuestAgentsOperations, + HybridIdentityMetadataOperations, + LogicalNetworksOperations, + MarketplaceGalleryImagesOperations, + NetworkInterfacesOperations, OffersOperations, Operations, PublishersOperations, SecuritySettingsOperations, SkusOperations, + StorageContainersOperations, UpdateRunsOperations, UpdateSummariesOperations, UpdatesOperations, + VirtualHardDisksOperations, + VirtualMachineInstancesOperations, ) if TYPE_CHECKING: @@ -53,6 +63,16 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :vartype edge_devices: azure.mgmt.azurestackhci.aio.operations.EdgeDevicesOperations :ivar extensions: ExtensionsOperations operations :vartype extensions: azure.mgmt.azurestackhci.aio.operations.ExtensionsOperations + :ivar gallery_images: GalleryImagesOperations operations + :vartype gallery_images: azure.mgmt.azurestackhci.aio.operations.GalleryImagesOperations + :ivar logical_networks: LogicalNetworksOperations operations + :vartype logical_networks: azure.mgmt.azurestackhci.aio.operations.LogicalNetworksOperations + :ivar marketplace_gallery_images: MarketplaceGalleryImagesOperations operations + :vartype marketplace_gallery_images: + azure.mgmt.azurestackhci.aio.operations.MarketplaceGalleryImagesOperations + :ivar network_interfaces: NetworkInterfacesOperations operations + :vartype network_interfaces: + azure.mgmt.azurestackhci.aio.operations.NetworkInterfacesOperations :ivar offers: OffersOperations operations :vartype offers: azure.mgmt.azurestackhci.aio.operations.OffersOperations :ivar operations: Operations operations @@ -63,19 +83,34 @@ class AzureStackHCIClient: # pylint: disable=client-accepts-api-version-keyword :vartype security_settings: azure.mgmt.azurestackhci.aio.operations.SecuritySettingsOperations :ivar skus: SkusOperations operations :vartype skus: azure.mgmt.azurestackhci.aio.operations.SkusOperations + :ivar storage_containers: StorageContainersOperations operations + :vartype storage_containers: + azure.mgmt.azurestackhci.aio.operations.StorageContainersOperations :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 + :ivar virtual_hard_disks: VirtualHardDisksOperations operations + :vartype virtual_hard_disks: azure.mgmt.azurestackhci.aio.operations.VirtualHardDisksOperations + :ivar virtual_machine_instances: VirtualMachineInstancesOperations operations + :vartype virtual_machine_instances: + azure.mgmt.azurestackhci.aio.operations.VirtualMachineInstancesOperations + :ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations + :vartype hybrid_identity_metadata: + azure.mgmt.azurestackhci.aio.operations.HybridIdentityMetadataOperations + :ivar guest_agent: GuestAgentOperations operations + :vartype guest_agent: azure.mgmt.azurestackhci.aio.operations.GuestAgentOperations + :ivar guest_agents: GuestAgentsOperations operations + :vartype guest_agents: azure.mgmt.azurestackhci.aio.operations.GuestAgentsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-01-01". 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 @@ -123,6 +158,16 @@ def __init__( ) self.edge_devices = EdgeDevicesOperations(self._client, self._config, self._serialize, self._deserialize) self.extensions = ExtensionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.gallery_images = GalleryImagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.logical_networks = LogicalNetworksOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.marketplace_gallery_images = MarketplaceGalleryImagesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_interfaces = NetworkInterfacesOperations( + 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) @@ -130,11 +175,25 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.skus = SkusOperations(self._client, self._config, self._serialize, self._deserialize) + self.storage_containers = StorageContainersOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.update_runs = UpdateRunsOperations(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) + self.virtual_hard_disks = VirtualHardDisksOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.virtual_machine_instances = VirtualMachineInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.hybrid_identity_metadata = HybridIdentityMetadataOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.guest_agent = GuestAgentOperations(self._client, self._config, self._serialize, self._deserialize) + self.guest_agents = GuestAgentsOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any 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..060944bc2c4d 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 @@ -26,15 +26,15 @@ class AzureStackHCIClientConfiguration: # pylint: disable=too-many-instance-att :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-04-01". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-01-01". 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") + api_version: str = kwargs.pop("api_version", "2024-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") 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..2eed2d52b4ab 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 @@ -11,14 +11,24 @@ from ._deployment_settings_operations import DeploymentSettingsOperations from ._edge_devices_operations import EdgeDevicesOperations from ._extensions_operations import ExtensionsOperations +from ._gallery_images_operations import GalleryImagesOperations +from ._logical_networks_operations import LogicalNetworksOperations +from ._marketplace_gallery_images_operations import MarketplaceGalleryImagesOperations +from ._network_interfaces_operations import NetworkInterfacesOperations 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 ._storage_containers_operations import StorageContainersOperations from ._update_runs_operations import UpdateRunsOperations from ._update_summaries_operations import UpdateSummariesOperations from ._updates_operations import UpdatesOperations +from ._virtual_hard_disks_operations import VirtualHardDisksOperations +from ._virtual_machine_instances_operations import VirtualMachineInstancesOperations +from ._hybrid_identity_metadata_operations import HybridIdentityMetadataOperations +from ._guest_agent_operations import GuestAgentOperations +from ._guest_agents_operations import GuestAgentsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -30,14 +40,24 @@ "DeploymentSettingsOperations", "EdgeDevicesOperations", "ExtensionsOperations", + "GalleryImagesOperations", + "LogicalNetworksOperations", + "MarketplaceGalleryImagesOperations", + "NetworkInterfacesOperations", "OffersOperations", "Operations", "PublishersOperations", "SecuritySettingsOperations", "SkusOperations", + "StorageContainersOperations", "UpdateRunsOperations", "UpdateSummariesOperations", "UpdatesOperations", + "VirtualHardDisksOperations", + "VirtualMachineInstancesOperations", + "HybridIdentityMetadataOperations", + "GuestAgentOperations", + "GuestAgentsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() 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 index 15676f3d4572..5debd80903a6 100644 --- 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 @@ -33,7 +33,6 @@ 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, @@ -41,7 +40,6 @@ 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, ) @@ -1144,403 +1142,3 @@ def get_long_running_output(pipeline_response): 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/_gallery_images_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_gallery_images_operations.py new file mode 100644 index 000000000000..96ba972b33c7 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_gallery_images_operations.py @@ -0,0 +1,792 @@ +# 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._gallery_images_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_all_request, + build_list_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 GalleryImagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`gallery_images` 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_async + async def get(self, resource_group_name: str, gallery_image_name: str, **kwargs: Any) -> _models.GalleryImages: + """Gets a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :return: GalleryImages or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.GalleryImages + :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.GalleryImages] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + gallery_image_name=gallery_image_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("GalleryImages", 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, + gallery_image_name: str, + gallery_images: Union[_models.GalleryImages, 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(gallery_images, (IOBase, bytes)): + _content = gallery_images + else: + _json = self._serialize.body(gallery_images, "GalleryImages") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + gallery_image_name=gallery_image_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_or_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: _models.GalleryImages, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GalleryImages]: + """The operation to create or update a gallery image. Please note some properties can be set only + during gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Required. + :type gallery_images: ~azure.mgmt.azurestackhci.models.GalleryImages + :keyword content_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 GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GalleryImages]: + """The operation to create or update a gallery image. Please note some properties can be set only + during gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Required. + :type gallery_images: 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 GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: Union[_models.GalleryImages, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.GalleryImages]: + """The operation to create or update a gallery image. Please note some properties can be set only + during gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Is either a GalleryImages type or a IO[bytes] type. Required. + :type gallery_images: ~azure.mgmt.azurestackhci.models.GalleryImages or IO[bytes] + :return: An instance of AsyncLROPoller that returns either GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :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.GalleryImages] = 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, + gallery_image_name=gallery_image_name, + gallery_images=gallery_images, + 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("GalleryImages", 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.GalleryImages].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GalleryImages]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, gallery_image_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, + gallery_image_name=gallery_image_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 [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["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, gallery_image_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_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, + gallery_image_name=gallery_image_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 _update_initial( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: Union[_models.GalleryImagesUpdateRequest, 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(gallery_images, (IOBase, bytes)): + _content = gallery_images + else: + _json = self._serialize.body(gallery_images, "GalleryImagesUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + gallery_image_name=gallery_image_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_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: _models.GalleryImagesUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GalleryImages]: + """The operation to update a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Required. + :type gallery_images: ~azure.mgmt.azurestackhci.models.GalleryImagesUpdateRequest + :keyword content_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 GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GalleryImages]: + """The operation to update a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Required. + :type gallery_images: 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 GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: Union[_models.GalleryImagesUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.GalleryImages]: + """The operation to update a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Is either a GalleryImagesUpdateRequest type or a IO[bytes] type. + Required. + :type gallery_images: ~azure.mgmt.azurestackhci.models.GalleryImagesUpdateRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :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.GalleryImages] = 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, + gallery_image_name=gallery_image_name, + gallery_images=gallery_images, + 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("GalleryImages", 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.GalleryImages].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GalleryImages]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.GalleryImages"]: + """Lists all of the gallery images in the specified resource group. Use the nextLink property in + the response to get the next page of gallery images. + + :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 GalleryImages or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.GalleryImages] + :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.GalleryImagesListResult] = 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, + 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("GalleryImagesListResult", 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_all(self, **kwargs: Any) -> AsyncIterable["_models.GalleryImages"]: + """Lists all of the gallery images in the specified subscription. Use the nextLink property in the + response to get the next page of gallery images. + + :return: An iterator like instance of either GalleryImages or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.GalleryImages] + :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.GalleryImagesListResult] = 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_all_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("GalleryImagesListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_guest_agent_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_guest_agent_operations.py new file mode 100644 index 000000000000..3a2de5d93bb3 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_guest_agent_operations.py @@ -0,0 +1,402 @@ +# 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, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload + +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_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._guest_agent_operations import build_create_request, build_delete_request, build_get_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 GuestAgentOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`guest_agent` 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 _create_initial( + self, resource_uri: str, body: Optional[Union[_models.GuestAgent, IO[bytes]]] = None, **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(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "GuestAgent") + else: + _json = None + + _request = build_create_request( + resource_uri=resource_uri, + 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_uri: str, + body: Optional[_models.GuestAgent] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GuestAgent]: + """Implements GuestAgent PUT method. + + Create Or Update GuestAgent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param body: Request payload. Default value is None. + :type body: ~azure.mgmt.azurestackhci.models.GuestAgent + :keyword content_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 GuestAgent or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.GuestAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_uri: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.GuestAgent]: + """Implements GuestAgent PUT method. + + Create Or Update GuestAgent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param body: Request payload. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns either GuestAgent or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.GuestAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, resource_uri: str, body: Optional[Union[_models.GuestAgent, IO[bytes]]] = None, **kwargs: Any + ) -> AsyncLROPoller[_models.GuestAgent]: + """Implements GuestAgent PUT method. + + Create Or Update GuestAgent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param body: Request payload. Is either a GuestAgent type or a IO[bytes] type. Default value is + None. + :type body: ~azure.mgmt.azurestackhci.models.GuestAgent or IO[bytes] + :return: An instance of AsyncLROPoller that returns either GuestAgent or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.GuestAgent] + :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.GuestAgent] = 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_uri=resource_uri, + body=body, + 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("GuestAgent", 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.GuestAgent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.GuestAgent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get(self, resource_uri: str, **kwargs: Any) -> _models.GuestAgent: + """Gets GuestAgent. + + Implements GuestAgent GET method. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: GuestAgent or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.GuestAgent + :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.GuestAgent] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_uri=resource_uri, + 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("GuestAgent", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial(self, resource_uri: 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_uri=resource_uri, + 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["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, **kwargs: Any) -> AsyncLROPoller[None]: + """Deleted an GuestAgent. + + Implements GuestAgent DELETE method. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: 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, + 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 diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_guest_agents_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_guest_agents_operations.py new file mode 100644 index 000000000000..fda7cf005580 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_guest_agents_operations.py @@ -0,0 +1,136 @@ +# 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.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ...operations._guest_agents_operations import build_list_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 GuestAgentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`guest_agents` 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.GuestAgent"]: + """Implements GET GuestAgent in a vm. + + Returns the list of GuestAgent of the given vm. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An iterator like instance of either GuestAgent or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.GuestAgent] + :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.GuestAgentList] = 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("GuestAgentList", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_hybrid_identity_metadata_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_hybrid_identity_metadata_operations.py new file mode 100644 index 000000000000..27a3a0dfdbf8 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_hybrid_identity_metadata_operations.py @@ -0,0 +1,193 @@ +# 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._hybrid_identity_metadata_operations import build_get_request, build_list_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 HybridIdentityMetadataOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`hybrid_identity_metadata` 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_async + async def get(self, resource_uri: str, **kwargs: Any) -> _models.HybridIdentityMetadata: + """Gets HybridIdentityMetadata. + + Implements HybridIdentityMetadata GET method. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: HybridIdentityMetadata or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.HybridIdentityMetadata + :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.HybridIdentityMetadata] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_uri=resource_uri, + 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("HybridIdentityMetadata", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.HybridIdentityMetadata"]: + """Implements GET HybridIdentityMetadata in a vm. + + Returns the list of HybridIdentityMetadata of the given vm. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An iterator like instance of either HybridIdentityMetadata or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.HybridIdentityMetadata] + :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.HybridIdentityMetadataList] = 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("HybridIdentityMetadataList", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_logical_networks_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_logical_networks_operations.py new file mode 100644 index 000000000000..609ad1e84088 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_logical_networks_operations.py @@ -0,0 +1,795 @@ +# 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._logical_networks_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_all_request, + build_list_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 LogicalNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`logical_networks` 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_async + async def get(self, resource_group_name: str, logical_network_name: str, **kwargs: Any) -> _models.LogicalNetworks: + """get. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :return: LogicalNetworks or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.LogicalNetworks + :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.LogicalNetworks] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + logical_network_name=logical_network_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("LogicalNetworks", 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, + logical_network_name: str, + logical_networks: Union[_models.LogicalNetworks, 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(logical_networks, (IOBase, bytes)): + _content = logical_networks + else: + _json = self._serialize.body(logical_networks, "LogicalNetworks") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + logical_network_name=logical_network_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_or_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: _models.LogicalNetworks, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalNetworks]: + """The operation to create or update a logical network. Please note some properties can be set + only during logical network creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Required. + :type logical_networks: ~azure.mgmt.azurestackhci.models.LogicalNetworks + :keyword content_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 LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalNetworks]: + """The operation to create or update a logical network. Please note some properties can be set + only during logical network creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Required. + :type logical_networks: 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 LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: Union[_models.LogicalNetworks, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalNetworks]: + """The operation to create or update a logical network. Please note some properties can be set + only during logical network creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Is either a LogicalNetworks type or a IO[bytes] type. Required. + :type logical_networks: ~azure.mgmt.azurestackhci.models.LogicalNetworks or IO[bytes] + :return: An instance of AsyncLROPoller that returns either LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :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.LogicalNetworks] = 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, + logical_network_name=logical_network_name, + logical_networks=logical_networks, + 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("LogicalNetworks", 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.LogicalNetworks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LogicalNetworks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, logical_network_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, + logical_network_name=logical_network_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 [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["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, logical_network_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete a logical network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_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, + logical_network_name=logical_network_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 _update_initial( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: Union[_models.LogicalNetworksUpdateRequest, 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(logical_networks, (IOBase, bytes)): + _content = logical_networks + else: + _json = self._serialize.body(logical_networks, "LogicalNetworksUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + logical_network_name=logical_network_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_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: _models.LogicalNetworksUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalNetworks]: + """The operation to update a logical network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Required. + :type logical_networks: ~azure.mgmt.azurestackhci.models.LogicalNetworksUpdateRequest + :keyword content_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 LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalNetworks]: + """The operation to update a logical network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Required. + :type logical_networks: 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 LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: Union[_models.LogicalNetworksUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalNetworks]: + """The operation to update a logical network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Is either a LogicalNetworksUpdateRequest type or a IO[bytes] type. + Required. + :type logical_networks: ~azure.mgmt.azurestackhci.models.LogicalNetworksUpdateRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :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.LogicalNetworks] = 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, + logical_network_name=logical_network_name, + logical_networks=logical_networks, + 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("LogicalNetworks", 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.LogicalNetworks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LogicalNetworks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.LogicalNetworks"]: + """Lists all of the logical networks in the specified resource group. Use the nextLink property in + the response to get the next page of logical networks. + + :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 LogicalNetworks or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :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.LogicalNetworksListResult] = 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, + 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("LogicalNetworksListResult", 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_all(self, **kwargs: Any) -> AsyncIterable["_models.LogicalNetworks"]: + """Lists all of the logical networks in the specified subscription. Use the nextLink property in + the response to get the next page of logical networks. + + :return: An iterator like instance of either LogicalNetworks or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :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.LogicalNetworksListResult] = 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_all_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("LogicalNetworksListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_marketplace_gallery_images_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_marketplace_gallery_images_operations.py new file mode 100644 index 000000000000..e43c27009da9 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_marketplace_gallery_images_operations.py @@ -0,0 +1,808 @@ +# 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._marketplace_gallery_images_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_all_request, + build_list_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 MarketplaceGalleryImagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`marketplace_gallery_images` 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_async + async def get( + self, resource_group_name: str, marketplace_gallery_image_name: str, **kwargs: Any + ) -> _models.MarketplaceGalleryImages: + """Gets a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :return: MarketplaceGalleryImages or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages + :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.MarketplaceGalleryImages] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + marketplace_gallery_image_name=marketplace_gallery_image_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("MarketplaceGalleryImages", 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, + marketplace_gallery_image_name: str, + marketplace_gallery_images: Union[_models.MarketplaceGalleryImages, 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(marketplace_gallery_images, (IOBase, bytes)): + _content = marketplace_gallery_images + else: + _json = self._serialize.body(marketplace_gallery_images, "MarketplaceGalleryImages") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + marketplace_gallery_image_name=marketplace_gallery_image_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_or_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: _models.MarketplaceGalleryImages, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MarketplaceGalleryImages]: + """The operation to create or update a marketplace gallery image. Please note some properties can + be set only during marketplace gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Required. + :type marketplace_gallery_images: ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages + :keyword content_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 MarketplaceGalleryImages or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MarketplaceGalleryImages]: + """The operation to create or update a marketplace gallery image. Please note some properties can + be set only during marketplace gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Required. + :type marketplace_gallery_images: 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 MarketplaceGalleryImages or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: Union[_models.MarketplaceGalleryImages, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MarketplaceGalleryImages]: + """The operation to create or update a marketplace gallery image. Please note some properties can + be set only during marketplace gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Is either a MarketplaceGalleryImages type or a IO[bytes] + type. Required. + :type marketplace_gallery_images: ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either MarketplaceGalleryImages or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :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.MarketplaceGalleryImages] = 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, + marketplace_gallery_image_name=marketplace_gallery_image_name, + marketplace_gallery_images=marketplace_gallery_images, + 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("MarketplaceGalleryImages", 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.MarketplaceGalleryImages].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MarketplaceGalleryImages]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, marketplace_gallery_image_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, + marketplace_gallery_image_name=marketplace_gallery_image_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 [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["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, marketplace_gallery_image_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_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, + marketplace_gallery_image_name=marketplace_gallery_image_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 _update_initial( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: Union[_models.MarketplaceGalleryImagesUpdateRequest, 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(marketplace_gallery_images, (IOBase, bytes)): + _content = marketplace_gallery_images + else: + _json = self._serialize.body(marketplace_gallery_images, "MarketplaceGalleryImagesUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + marketplace_gallery_image_name=marketplace_gallery_image_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_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: _models.MarketplaceGalleryImagesUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MarketplaceGalleryImages]: + """The operation to update a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Required. + :type marketplace_gallery_images: + ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest + :keyword content_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 MarketplaceGalleryImages or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MarketplaceGalleryImages]: + """The operation to update a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Required. + :type marketplace_gallery_images: 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 MarketplaceGalleryImages or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: Union[_models.MarketplaceGalleryImagesUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MarketplaceGalleryImages]: + """The operation to update a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Is either a MarketplaceGalleryImagesUpdateRequest type or a + IO[bytes] type. Required. + :type marketplace_gallery_images: + ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either MarketplaceGalleryImages or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :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.MarketplaceGalleryImages] = 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, + marketplace_gallery_image_name=marketplace_gallery_image_name, + marketplace_gallery_images=marketplace_gallery_images, + 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("MarketplaceGalleryImages", 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.MarketplaceGalleryImages].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MarketplaceGalleryImages]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.MarketplaceGalleryImages"]: + """Lists all of the marketplace gallery images in the specified resource group. Use the nextLink + property in the response to get the next page of marketplace gallery images. + + :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 MarketplaceGalleryImages or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :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.MarketplaceGalleryImagesListResult] = 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, + 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("MarketplaceGalleryImagesListResult", 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_all(self, **kwargs: Any) -> AsyncIterable["_models.MarketplaceGalleryImages"]: + """Lists all of the marketplace gallery images in the specified subscription. Use the nextLink + property in the response to get the next page of marketplace gallery images. + + :return: An iterator like instance of either MarketplaceGalleryImages or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :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.MarketplaceGalleryImagesListResult] = 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_all_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("MarketplaceGalleryImagesListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_network_interfaces_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_network_interfaces_operations.py new file mode 100644 index 000000000000..2798ff5fdbeb --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_network_interfaces_operations.py @@ -0,0 +1,797 @@ +# 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._network_interfaces_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_all_request, + build_list_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 NetworkInterfacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`network_interfaces` 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_async + async def get( + self, resource_group_name: str, network_interface_name: str, **kwargs: Any + ) -> _models.NetworkInterfaces: + """Gets a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :return: NetworkInterfaces or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.NetworkInterfaces + :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.NetworkInterfaces] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_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("NetworkInterfaces", 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, + network_interface_name: str, + network_interfaces: Union[_models.NetworkInterfaces, 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(network_interfaces, (IOBase, bytes)): + _content = network_interfaces + else: + _json = self._serialize.body(network_interfaces, "NetworkInterfaces") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_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_or_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: _models.NetworkInterfaces, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaces]: + """The operation to create or update a network interface. Please note some properties can be set + only during network interface creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Required. + :type network_interfaces: ~azure.mgmt.azurestackhci.models.NetworkInterfaces + :keyword content_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 NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaces]: + """The operation to create or update a network interface. Please note some properties can be set + only during network interface creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Required. + :type network_interfaces: 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 NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: Union[_models.NetworkInterfaces, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaces]: + """The operation to create or update a network interface. Please note some properties can be set + only during network interface creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Is either a NetworkInterfaces type or a IO[bytes] type. Required. + :type network_interfaces: ~azure.mgmt.azurestackhci.models.NetworkInterfaces or IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :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.NetworkInterfaces] = 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, + network_interface_name=network_interface_name, + network_interfaces=network_interfaces, + 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("NetworkInterfaces", 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.NetworkInterfaces].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkInterfaces]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, network_interface_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, + network_interface_name=network_interface_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 [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["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, network_interface_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_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, + network_interface_name=network_interface_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 _update_initial( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: Union[_models.NetworkInterfacesUpdateRequest, 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(network_interfaces, (IOBase, bytes)): + _content = network_interfaces + else: + _json = self._serialize.body(network_interfaces, "NetworkInterfacesUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_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_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: _models.NetworkInterfacesUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaces]: + """The operation to update a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Required. + :type network_interfaces: ~azure.mgmt.azurestackhci.models.NetworkInterfacesUpdateRequest + :keyword content_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 NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaces]: + """The operation to update a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Required. + :type network_interfaces: 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 NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: Union[_models.NetworkInterfacesUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkInterfaces]: + """The operation to update a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Is either a NetworkInterfacesUpdateRequest type or a IO[bytes] type. + Required. + :type network_interfaces: ~azure.mgmt.azurestackhci.models.NetworkInterfacesUpdateRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :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.NetworkInterfaces] = 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, + network_interface_name=network_interface_name, + network_interfaces=network_interfaces, + 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("NetworkInterfaces", 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.NetworkInterfaces].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkInterfaces]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.NetworkInterfaces"]: + """Lists all of the network interfaces in the specified resource group. Use the nextLink property + in the response to get the next page of network interfaces. + + :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 NetworkInterfaces or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :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.NetworkInterfacesListResult] = 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, + 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("NetworkInterfacesListResult", 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_all(self, **kwargs: Any) -> AsyncIterable["_models.NetworkInterfaces"]: + """Lists all of the network interfaces in the specified subscription. Use the nextLink property in + the response to get the next page of network interfaces. + + :return: An iterator like instance of either NetworkInterfaces or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :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.NetworkInterfacesListResult] = 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_all_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("NetworkInterfacesListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_storage_containers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_storage_containers_operations.py new file mode 100644 index 000000000000..8a65dee11a8e --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_storage_containers_operations.py @@ -0,0 +1,797 @@ +# 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._storage_containers_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_all_request, + build_list_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 StorageContainersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`storage_containers` 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_async + async def get( + self, resource_group_name: str, storage_container_name: str, **kwargs: Any + ) -> _models.StorageContainers: + """Gets a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :return: StorageContainers or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.StorageContainers + :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.StorageContainers] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + storage_container_name=storage_container_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("StorageContainers", 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, + storage_container_name: str, + storage_containers: Union[_models.StorageContainers, 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(storage_containers, (IOBase, bytes)): + _content = storage_containers + else: + _json = self._serialize.body(storage_containers, "StorageContainers") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + storage_container_name=storage_container_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_or_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: _models.StorageContainers, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.StorageContainers]: + """The operation to create or update a storage container. Please note some properties can be set + only during storage container creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Required. + :type storage_containers: ~azure.mgmt.azurestackhci.models.StorageContainers + :keyword content_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 StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.StorageContainers]: + """The operation to create or update a storage container. Please note some properties can be set + only during storage container creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Required. + :type storage_containers: 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 StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: Union[_models.StorageContainers, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.StorageContainers]: + """The operation to create or update a storage container. Please note some properties can be set + only during storage container creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Is either a StorageContainers type or a IO[bytes] type. Required. + :type storage_containers: ~azure.mgmt.azurestackhci.models.StorageContainers or IO[bytes] + :return: An instance of AsyncLROPoller that returns either StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :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.StorageContainers] = 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, + storage_container_name=storage_container_name, + storage_containers=storage_containers, + 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("StorageContainers", 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.StorageContainers].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.StorageContainers]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, storage_container_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, + storage_container_name=storage_container_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 [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["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, storage_container_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_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, + storage_container_name=storage_container_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 _update_initial( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: Union[_models.StorageContainersUpdateRequest, 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(storage_containers, (IOBase, bytes)): + _content = storage_containers + else: + _json = self._serialize.body(storage_containers, "StorageContainersUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + storage_container_name=storage_container_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_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: _models.StorageContainersUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.StorageContainers]: + """The operation to update a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Required. + :type storage_containers: ~azure.mgmt.azurestackhci.models.StorageContainersUpdateRequest + :keyword content_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 StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.StorageContainers]: + """The operation to update a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Required. + :type storage_containers: 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 StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: Union[_models.StorageContainersUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.StorageContainers]: + """The operation to update a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Is either a StorageContainersUpdateRequest type or a IO[bytes] type. + Required. + :type storage_containers: ~azure.mgmt.azurestackhci.models.StorageContainersUpdateRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :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.StorageContainers] = 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, + storage_container_name=storage_container_name, + storage_containers=storage_containers, + 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("StorageContainers", 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.StorageContainers].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.StorageContainers]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.StorageContainers"]: + """Lists all of the storage containers in the specified resource group. Use the nextLink property + in the response to get the next page of storage containers. + + :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 StorageContainers or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.StorageContainers] + :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.StorageContainersListResult] = 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, + 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("StorageContainersListResult", 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_all(self, **kwargs: Any) -> AsyncIterable["_models.StorageContainers"]: + """Lists all of the storage containers in the specified subscription. Use the nextLink property in + the response to get the next page of storage containers. + + :return: An iterator like instance of either StorageContainers or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.StorageContainers] + :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.StorageContainersListResult] = 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_all_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("StorageContainersListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_virtual_hard_disks_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_virtual_hard_disks_operations.py new file mode 100644 index 000000000000..06b238bbe008 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_virtual_hard_disks_operations.py @@ -0,0 +1,797 @@ +# 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._virtual_hard_disks_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_all_request, + build_list_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 VirtualHardDisksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`virtual_hard_disks` 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_async + async def get( + self, resource_group_name: str, virtual_hard_disk_name: str, **kwargs: Any + ) -> _models.VirtualHardDisks: + """Gets a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :return: VirtualHardDisks or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.VirtualHardDisks + :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.VirtualHardDisks] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + virtual_hard_disk_name=virtual_hard_disk_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("VirtualHardDisks", 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, + virtual_hard_disk_name: str, + virtual_hard_disks: Union[_models.VirtualHardDisks, 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(virtual_hard_disks, (IOBase, bytes)): + _content = virtual_hard_disks + else: + _json = self._serialize.body(virtual_hard_disks, "VirtualHardDisks") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hard_disk_name=virtual_hard_disk_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_or_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: _models.VirtualHardDisks, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHardDisks]: + """The operation to create or update a virtual hard disk. Please note some properties can be set + only during virtual hard disk creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Required. + :type virtual_hard_disks: ~azure.mgmt.azurestackhci.models.VirtualHardDisks + :keyword content_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 VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHardDisks]: + """The operation to create or update a virtual hard disk. Please note some properties can be set + only during virtual hard disk creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Required. + :type virtual_hard_disks: 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 VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: Union[_models.VirtualHardDisks, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHardDisks]: + """The operation to create or update a virtual hard disk. Please note some properties can be set + only during virtual hard disk creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Is either a VirtualHardDisks type or a IO[bytes] type. Required. + :type virtual_hard_disks: ~azure.mgmt.azurestackhci.models.VirtualHardDisks or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :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.VirtualHardDisks] = 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, + virtual_hard_disk_name=virtual_hard_disk_name, + virtual_hard_disks=virtual_hard_disks, + 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("VirtualHardDisks", 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.VirtualHardDisks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualHardDisks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, virtual_hard_disk_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, + virtual_hard_disk_name=virtual_hard_disk_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 [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["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, virtual_hard_disk_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """The operation to delete a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_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, + virtual_hard_disk_name=virtual_hard_disk_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 _update_initial( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: Union[_models.VirtualHardDisksUpdateRequest, 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(virtual_hard_disks, (IOBase, bytes)): + _content = virtual_hard_disks + else: + _json = self._serialize.body(virtual_hard_disks, "VirtualHardDisksUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + virtual_hard_disk_name=virtual_hard_disk_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_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: _models.VirtualHardDisksUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHardDisks]: + """The operation to update a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Required. + :type virtual_hard_disks: ~azure.mgmt.azurestackhci.models.VirtualHardDisksUpdateRequest + :keyword content_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 VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHardDisks]: + """The operation to update a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Required. + :type virtual_hard_disks: 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 VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: Union[_models.VirtualHardDisksUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualHardDisks]: + """The operation to update a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Is either a VirtualHardDisksUpdateRequest type or a IO[bytes] type. + Required. + :type virtual_hard_disks: ~azure.mgmt.azurestackhci.models.VirtualHardDisksUpdateRequest or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :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.VirtualHardDisks] = 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, + virtual_hard_disk_name=virtual_hard_disk_name, + virtual_hard_disks=virtual_hard_disks, + 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("VirtualHardDisks", 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.VirtualHardDisks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualHardDisks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.VirtualHardDisks"]: + """Lists all of the virtual hard disks in the specified resource group. Use the nextLink property + in the response to get the next page of virtual hard disks. + + :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 VirtualHardDisks or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :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.VirtualHardDisksListResult] = 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, + 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("VirtualHardDisksListResult", 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_all(self, **kwargs: Any) -> AsyncIterable["_models.VirtualHardDisks"]: + """Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in + the response to get the next page of virtual hard disks. + + :return: An iterator like instance of either VirtualHardDisks or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :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.VirtualHardDisksListResult] = 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_all_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("VirtualHardDisksListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_virtual_machine_instances_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_virtual_machine_instances_operations.py new file mode 100644 index 000000000000..c3b1dd0b706f --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/aio/operations/_virtual_machine_instances_operations.py @@ -0,0 +1,1016 @@ +# 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._virtual_machine_instances_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, + build_restart_request, + build_start_request, + build_stop_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 VirtualMachineInstancesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.aio.AzureStackHCIClient`'s + :attr:`virtual_machine_instances` 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_async + async def get(self, resource_uri: str, **kwargs: Any) -> _models.VirtualMachineInstance: + """Gets a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: VirtualMachineInstance or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.VirtualMachineInstance + :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.VirtualMachineInstance] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_uri=resource_uri, + 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("VirtualMachineInstance", 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, + virtual_machine_instance: Union[_models.VirtualMachineInstance, 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(virtual_machine_instance, (IOBase, bytes)): + _content = virtual_machine_instance + else: + _json = self._serialize.body(virtual_machine_instance, "VirtualMachineInstance") + + _request = build_create_or_update_request( + resource_uri=resource_uri, + 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_or_update( + self, + resource_uri: str, + virtual_machine_instance: _models.VirtualMachineInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualMachineInstance]: + """The operation to create or update a virtual machine instance. Please note some properties can + be set only during virtual machine instance creation. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Required. + :type virtual_machine_instance: ~azure.mgmt.azurestackhci.models.VirtualMachineInstance + :keyword content_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 VirtualMachineInstance or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_uri: str, + virtual_machine_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualMachineInstance]: + """The operation to create or update a virtual machine instance. Please note some properties can + be set only during virtual machine instance creation. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Required. + :type virtual_machine_instance: 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 VirtualMachineInstance or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_uri: str, + virtual_machine_instance: Union[_models.VirtualMachineInstance, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualMachineInstance]: + """The operation to create or update a virtual machine instance. Please note some properties can + be set only during virtual machine instance creation. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Is either a VirtualMachineInstance type or a IO[bytes] type. + Required. + :type virtual_machine_instance: ~azure.mgmt.azurestackhci.models.VirtualMachineInstance or + IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualMachineInstance or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = 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, + virtual_machine_instance=virtual_machine_instance, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial(self, resource_uri: 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_uri=resource_uri, + 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["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, **kwargs: Any) -> AsyncLROPoller[None]: + """The operation to delete a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: 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, + 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 _update_initial( + self, + resource_uri: str, + virtual_machine_instance: Union[_models.VirtualMachineInstanceUpdateRequest, 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(virtual_machine_instance, (IOBase, bytes)): + _content = virtual_machine_instance + else: + _json = self._serialize.body(virtual_machine_instance, "VirtualMachineInstanceUpdateRequest") + + _request = build_update_request( + resource_uri=resource_uri, + 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_update( + self, + resource_uri: str, + virtual_machine_instance: _models.VirtualMachineInstanceUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualMachineInstance]: + """The operation to update a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Required. + :type virtual_machine_instance: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceUpdateRequest + :keyword content_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 VirtualMachineInstance or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_uri: str, + virtual_machine_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualMachineInstance]: + """The operation to update a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Required. + :type virtual_machine_instance: 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 VirtualMachineInstance or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_uri: str, + virtual_machine_instance: Union[_models.VirtualMachineInstanceUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualMachineInstance]: + """The operation to update a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Is either a VirtualMachineInstanceUpdateRequest type or a + IO[bytes] type. Required. + :type virtual_machine_instance: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceUpdateRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualMachineInstance or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = 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_uri=resource_uri, + virtual_machine_instance=virtual_machine_instance, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _start_initial(self, resource_uri: 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_start_request( + resource_uri=resource_uri, + 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["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_start(self, resource_uri: str, **kwargs: Any) -> AsyncLROPoller[_models.VirtualMachineInstance]: + """The operation to start a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An instance of AsyncLROPoller that returns either VirtualMachineInstance or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( + resource_uri=resource_uri, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _stop_initial(self, resource_uri: 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_stop_request( + resource_uri=resource_uri, + 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["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_stop(self, resource_uri: str, **kwargs: Any) -> AsyncLROPoller[_models.VirtualMachineInstance]: + """The operation to stop a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An instance of AsyncLROPoller that returns either VirtualMachineInstance or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = 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._stop_initial( + resource_uri=resource_uri, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _restart_initial(self, resource_uri: 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_restart_request( + resource_uri=resource_uri, + 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["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_restart(self, resource_uri: str, **kwargs: Any) -> AsyncLROPoller[_models.VirtualMachineInstance]: + """The operation to restart a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An instance of AsyncLROPoller that returns either VirtualMachineInstance or the result + of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._restart_initial( + resource_uri=resource_uri, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.VirtualMachineInstance"]: + """Lists all of the virtual machine instances within the specified parent resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An iterator like instance of either VirtualMachineInstance or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstanceListResult] = 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("VirtualMachineInstanceListResult", 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) 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..3805e43e502b 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 @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._models_py3 import AdapterPropertyOverrides from ._models_py3 import ArcConnectivityProperties from ._models_py3 import ArcIdentityResponse from ._models_py3 import ArcSetting @@ -24,55 +25,74 @@ 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 DeploymentStatus 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 ExtendedLocation 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 GalleryDiskImage +from ._models_py3 import GalleryImageIdentifier +from ._models_py3 import GalleryImageStatus +from ._models_py3 import GalleryImageStatusDownloadStatus +from ._models_py3 import GalleryImageStatusProvisioningStatus +from ._models_py3 import GalleryImageVersion +from ._models_py3 import GalleryImageVersionStorageProfile +from ._models_py3 import GalleryImages +from ._models_py3 import GalleryImagesListResult +from ._models_py3 import GalleryImagesUpdateRequest +from ._models_py3 import GalleryOSDiskImage +from ._models_py3 import GuestAgent +from ._models_py3 import GuestAgentInstallStatus +from ._models_py3 import GuestAgentList +from ._models_py3 import GuestCredential +from ._models_py3 import HardwareProfileUpdate +from ._models_py3 import HostNetwork +from ._models_py3 import HttpProxyConfiguration +from ._models_py3 import HybridIdentityMetadata +from ._models_py3 import HybridIdentityMetadataList +from ._models_py3 import IPConfiguration +from ._models_py3 import IPConfigurationProperties +from ._models_py3 import IPConfigurationPropertiesSubnet +from ._models_py3 import IPPool +from ._models_py3 import IPPoolInfo +from ._models_py3 import Identity from ._models_py3 import InfrastructureNetwork +from ._models_py3 import InstanceViewStatus +from ._models_py3 import Intents +from ._models_py3 import InterfaceDNSSettings 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 LogicalNetworkPropertiesDhcpOptions +from ._models_py3 import LogicalNetworkStatus +from ._models_py3 import LogicalNetworkStatusProvisioningStatus +from ._models_py3 import LogicalNetworks +from ._models_py3 import LogicalNetworksListResult +from ._models_py3 import LogicalNetworksUpdateRequest +from ._models_py3 import MarketplaceGalleryImageStatus +from ._models_py3 import MarketplaceGalleryImageStatusDownloadStatus +from ._models_py3 import MarketplaceGalleryImageStatusProvisioningStatus +from ._models_py3 import MarketplaceGalleryImages +from ._models_py3 import MarketplaceGalleryImagesListResult +from ._models_py3 import MarketplaceGalleryImagesUpdateRequest +from ._models_py3 import NetworkInterfaceStatus +from ._models_py3 import NetworkInterfaceStatusProvisioningStatus +from ._models_py3 import NetworkInterfaces +from ._models_py3 import NetworkInterfacesListResult +from ._models_py3 import NetworkInterfacesUpdateRequest +from ._models_py3 import NetworkProfileUpdate +from ._models_py3 import NetworkProfileUpdateNetworkInterfacesItem from ._models_py3 import NicDetail from ._models_py3 import Observability from ._models_py3 import Offer @@ -81,10 +101,12 @@ from ._models_py3 import OperationDisplay from ._models_py3 import OperationListResult from ._models_py3 import OptionalServices +from ._models_py3 import OsProfileUpdate +from ._models_py3 import OsProfileUpdateLinuxConfiguration +from ._models_py3 import OsProfileUpdateWindowsConfiguration 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 @@ -94,19 +116,11 @@ 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 Route +from ._models_py3 import RouteTable 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 @@ -117,10 +131,20 @@ from ._models_py3 import SoftwareAssuranceChangeRequest from ._models_py3 import SoftwareAssuranceChangeRequestProperties from ._models_py3 import SoftwareAssuranceProperties +from ._models_py3 import SshConfiguration +from ._models_py3 import SshPublicKey from ._models_py3 import Step from ._models_py3 import Storage -from ._models_py3 import SwitchDetail -from ._models_py3 import SwitchExtension +from ._models_py3 import StorageContainerStatus +from ._models_py3 import StorageContainerStatusProvisioningStatus +from ._models_py3 import StorageContainers +from ._models_py3 import StorageContainersListResult +from ._models_py3 import StorageContainersUpdateRequest +from ._models_py3 import StorageNetworks +from ._models_py3 import StorageProfileUpdate +from ._models_py3 import StorageProfileUpdateDataDisksItem +from ._models_py3 import Subnet +from ._models_py3 import SubnetPropertiesFormatIpConfigurationReferencesItem from ._models_py3 import SystemData from ._models_py3 import TrackedResource from ._models_py3 import Update @@ -134,37 +158,67 @@ from ._models_py3 import UserAssignedIdentity from ._models_py3 import ValidateRequest from ._models_py3 import ValidateResponse +from ._models_py3 import ValidationStatus +from ._models_py3 import VirtualHardDiskStatus +from ._models_py3 import VirtualHardDiskStatusProvisioningStatus +from ._models_py3 import VirtualHardDisks +from ._models_py3 import VirtualHardDisksListResult +from ._models_py3 import VirtualHardDisksUpdateRequest +from ._models_py3 import VirtualMachineConfigAgentInstanceView +from ._models_py3 import VirtualMachineInstance +from ._models_py3 import VirtualMachineInstanceListResult +from ._models_py3 import VirtualMachineInstancePropertiesHardwareProfile +from ._models_py3 import VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig +from ._models_py3 import VirtualMachineInstancePropertiesNetworkProfile +from ._models_py3 import VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem +from ._models_py3 import VirtualMachineInstancePropertiesOsProfile +from ._models_py3 import VirtualMachineInstancePropertiesOsProfileLinuxConfiguration +from ._models_py3 import VirtualMachineInstancePropertiesOsProfileWindowsConfiguration +from ._models_py3 import VirtualMachineInstancePropertiesSecurityProfile +from ._models_py3 import VirtualMachineInstancePropertiesSecurityProfileUefiSettings +from ._models_py3 import VirtualMachineInstancePropertiesStorageProfile +from ._models_py3 import VirtualMachineInstancePropertiesStorageProfileDataDisksItem +from ._models_py3 import VirtualMachineInstancePropertiesStorageProfileImageReference +from ._models_py3 import VirtualMachineInstancePropertiesStorageProfileOsDisk +from ._models_py3 import VirtualMachineInstanceStatus +from ._models_py3 import VirtualMachineInstanceStatusProvisioningStatus +from ._models_py3 import VirtualMachineInstanceUpdateProperties +from ._models_py3 import VirtualMachineInstanceUpdateRequest +from ._models_py3 import VirtualMachineInstanceView +from ._models_py3 import VirtualSwitchConfigurationOverrides -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 CloudInitDataSource 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 DiskFileFormat +from ._azure_stack_hci_client_enums import ExtendedLocationTypes 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 HyperVGeneration +from ._azure_stack_hci_client_enums import IPPoolTypeEnum 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 IpAllocationMethodEnum 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 OperatingSystemTypes from ._azure_stack_hci_client_enums import Origin +from ._azure_stack_hci_client_enums import PowerStateEnum +from ._azure_stack_hci_client_enums import ProvisioningAction from ._azure_stack_hci_client_enums import ProvisioningState +from ._azure_stack_hci_client_enums import ProvisioningStateEnum from ._azure_stack_hci_client_enums import RebootRequirement -from ._azure_stack_hci_client_enums import RemoteSupportType +from ._azure_stack_hci_client_enums import SecurityTypes from ._azure_stack_hci_client_enums import ServiceName from ._azure_stack_hci_client_enums import Severity from ._azure_stack_hci_client_enums import SoftwareAssuranceIntent @@ -172,14 +226,17 @@ 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 StatusTypes from ._azure_stack_hci_client_enums import UpdateRunPropertiesState from ._azure_stack_hci_client_enums import UpdateSummariesPropertiesState +from ._azure_stack_hci_client_enums import VmSizeEnum from ._azure_stack_hci_client_enums import WindowsServerSubscription from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ + "AdapterPropertyOverrides", "ArcConnectivityProperties", "ArcIdentityResponse", "ArcSetting", @@ -198,55 +255,74 @@ "DeploymentData", "DeploymentSecuritySettings", "DeploymentSetting", - "DeploymentSettingAdapterPropertyOverrides", - "DeploymentSettingHostNetwork", - "DeploymentSettingIntents", "DeploymentSettingListResult", - "DeploymentSettingStorageAdapterIPInfo", - "DeploymentSettingStorageNetworks", - "DeploymentSettingVirtualSwitchConfigurationOverrides", + "DeploymentStatus", "DeploymentStep", "DeviceConfiguration", - "EceActionStatus", - "EceDeploymentSecrets", - "EceReportedProperties", "EdgeDevice", "EdgeDeviceListResult", - "EdgeDeviceProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", + "ExtendedLocation", "Extension", "ExtensionInstanceView", "ExtensionInstanceViewStatus", "ExtensionList", "ExtensionPatch", "ExtensionPatchParameters", - "ExtensionProfile", "ExtensionUpgradeParameters", - "HciEdgeDevice", - "HciEdgeDeviceAdapterPropertyOverrides", - "HciEdgeDeviceArcExtension", - "HciEdgeDeviceHostNetwork", - "HciEdgeDeviceIntents", - "HciEdgeDeviceProperties", - "HciEdgeDeviceStorageAdapterIPInfo", - "HciEdgeDeviceStorageNetworks", - "HciEdgeDeviceVirtualSwitchConfigurationOverrides", - "HciNetworkProfile", - "HciNicDetail", - "HciOsProfile", - "HciReportedProperties", - "HciValidationFailureDetail", + "GalleryDiskImage", + "GalleryImageIdentifier", + "GalleryImageStatus", + "GalleryImageStatusDownloadStatus", + "GalleryImageStatusProvisioningStatus", + "GalleryImageVersion", + "GalleryImageVersionStorageProfile", + "GalleryImages", + "GalleryImagesListResult", + "GalleryImagesUpdateRequest", + "GalleryOSDiskImage", + "GuestAgent", + "GuestAgentInstallStatus", + "GuestAgentList", + "GuestCredential", + "HardwareProfileUpdate", + "HostNetwork", + "HttpProxyConfiguration", + "HybridIdentityMetadata", + "HybridIdentityMetadataList", + "IPConfiguration", + "IPConfigurationProperties", + "IPConfigurationPropertiesSubnet", + "IPPool", + "IPPoolInfo", + "Identity", "InfrastructureNetwork", + "InstanceViewStatus", + "Intents", + "InterfaceDNSSettings", "IpPools", "IsolatedVmAttestationConfiguration", - "LogCollectionError", - "LogCollectionProperties", - "LogCollectionRequest", - "LogCollectionRequestProperties", - "LogCollectionSession", - "NetworkController", + "LogicalNetworkPropertiesDhcpOptions", + "LogicalNetworkStatus", + "LogicalNetworkStatusProvisioningStatus", + "LogicalNetworks", + "LogicalNetworksListResult", + "LogicalNetworksUpdateRequest", + "MarketplaceGalleryImageStatus", + "MarketplaceGalleryImageStatusDownloadStatus", + "MarketplaceGalleryImageStatusProvisioningStatus", + "MarketplaceGalleryImages", + "MarketplaceGalleryImagesListResult", + "MarketplaceGalleryImagesUpdateRequest", + "NetworkInterfaceStatus", + "NetworkInterfaceStatusProvisioningStatus", + "NetworkInterfaces", + "NetworkInterfacesListResult", + "NetworkInterfacesUpdateRequest", + "NetworkProfileUpdate", + "NetworkProfileUpdateNetworkInterfacesItem", "NicDetail", "Observability", "Offer", @@ -255,10 +331,12 @@ "OperationDisplay", "OperationListResult", "OptionalServices", + "OsProfileUpdate", + "OsProfileUpdateLinuxConfiguration", + "OsProfileUpdateWindowsConfiguration", "PackageVersionInfo", "PasswordCredential", "PerNodeExtensionState", - "PerNodeRemoteSupportSession", "PerNodeState", "PhysicalNodes", "PrecheckResult", @@ -268,19 +346,11 @@ "PublisherList", "QosPolicyOverrides", "RawCertificateData", - "RemoteSupportNodeSettings", - "RemoteSupportProperties", - "RemoteSupportRequest", - "RemoteSupportRequestProperties", "ReportedProperties", "Resource", - "SbeCredentials", - "SbeDeploymentInfo", - "SbeDeploymentPackageInfo", - "SbePartnerInfo", - "SbePartnerProperties", + "Route", + "RouteTable", "ScaleUnits", - "SdnIntegration", "SecurityComplianceStatus", "SecuritySetting", "SecuritySettingListResult", @@ -291,10 +361,20 @@ "SoftwareAssuranceChangeRequest", "SoftwareAssuranceChangeRequestProperties", "SoftwareAssuranceProperties", + "SshConfiguration", + "SshPublicKey", "Step", "Storage", - "SwitchDetail", - "SwitchExtension", + "StorageContainerStatus", + "StorageContainerStatusProvisioningStatus", + "StorageContainers", + "StorageContainersListResult", + "StorageContainersUpdateRequest", + "StorageNetworks", + "StorageProfileUpdate", + "StorageProfileUpdateDataDisksItem", + "Subnet", + "SubnetPropertiesFormatIpConfigurationReferencesItem", "SystemData", "TrackedResource", "Update", @@ -308,36 +388,66 @@ "UserAssignedIdentity", "ValidateRequest", "ValidateResponse", - "AccessLevel", + "ValidationStatus", + "VirtualHardDiskStatus", + "VirtualHardDiskStatusProvisioningStatus", + "VirtualHardDisks", + "VirtualHardDisksListResult", + "VirtualHardDisksUpdateRequest", + "VirtualMachineConfigAgentInstanceView", + "VirtualMachineInstance", + "VirtualMachineInstanceListResult", + "VirtualMachineInstancePropertiesHardwareProfile", + "VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig", + "VirtualMachineInstancePropertiesNetworkProfile", + "VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem", + "VirtualMachineInstancePropertiesOsProfile", + "VirtualMachineInstancePropertiesOsProfileLinuxConfiguration", + "VirtualMachineInstancePropertiesOsProfileWindowsConfiguration", + "VirtualMachineInstancePropertiesSecurityProfile", + "VirtualMachineInstancePropertiesSecurityProfileUefiSettings", + "VirtualMachineInstancePropertiesStorageProfile", + "VirtualMachineInstancePropertiesStorageProfileDataDisksItem", + "VirtualMachineInstancePropertiesStorageProfileImageReference", + "VirtualMachineInstancePropertiesStorageProfileOsDisk", + "VirtualMachineInstanceStatus", + "VirtualMachineInstanceStatusProvisioningStatus", + "VirtualMachineInstanceUpdateProperties", + "VirtualMachineInstanceUpdateRequest", + "VirtualMachineInstanceView", + "VirtualSwitchConfigurationOverrides", "ActionType", - "ArcExtensionState", "ArcSettingAggregateState", "AvailabilityType", + "CloudInitDataSource", "ClusterNodeType", "ComplianceAssignmentType", "ComplianceStatus", "ConnectivityStatus", "CreatedByType", "DeploymentMode", - "DeviceKind", - "DeviceState", "DiagnosticLevel", - "EceSecrets", + "DiskFileFormat", + "ExtendedLocationTypes", "ExtensionAggregateState", "ExtensionManagedBy", "HealthState", + "HyperVGeneration", + "IPPoolTypeEnum", "ImdsAttestation", - "LogCollectionJobType", - "LogCollectionStatus", + "IpAllocationMethodEnum", "ManagedServiceIdentityType", "NodeArcState", "NodeExtensionState", "OemActivation", - "OperationType", + "OperatingSystemTypes", "Origin", + "PowerStateEnum", + "ProvisioningAction", "ProvisioningState", + "ProvisioningStateEnum", "RebootRequirement", - "RemoteSupportType", + "SecurityTypes", "ServiceName", "Severity", "SoftwareAssuranceIntent", @@ -345,8 +455,10 @@ "State", "Status", "StatusLevelTypes", + "StatusTypes", "UpdateRunPropertiesState", "UpdateSummariesPropertiesState", + "VmSizeEnum", "WindowsServerSubscription", ] __all__.extend([p for p in _patch_all if p not in __all__]) 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 index bd5c50533c82..9b97cd432773 100644 --- 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 @@ -10,44 +10,12 @@ 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.""" @@ -79,6 +47,13 @@ class AvailabilityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): NOTIFY = "Notify" +class CloudInitDataSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Datasource for the gallery image when provisioning with cloud-init [NoCloud, Azure].""" + + NO_CLOUD = "NoCloud" + AZURE = "Azure" + + class ClusterNodeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The node type of all the nodes of the cluster.""" @@ -128,40 +103,12 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class DeploymentMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The deployment mode of EnterpriseCloudEngine(ECE) action for a cluster.""" + """The deployment mode for cluster deployment.""" VALIDATE = "Validate" - """Validate ECE action deployment for a cluster.""" + """Validate deployment settings for 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.""" + """Deploy cluster using deployment settings.""" class DiagnosticLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -172,17 +119,17 @@ class DiagnosticLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENHANCED = "Enhanced" -class EceSecrets(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Secret names allowed for Enterprise Cloud Engine (ECE) deployment.""" +class DiskFileFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The format of the actual VHD file [vhd, vhdx].""" + + VHDX = "vhdx" + VHD = "vhd" - 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 ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of extendedLocation.""" + + CUSTOM_LOCATION = "CustomLocation" class ExtensionAggregateState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -209,10 +156,10 @@ class ExtensionAggregateState(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ExtensionManagedBy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Extension managed by user or Azure.""" + """Indicates if the extension is managed by azure or the user.""" - USER = "User" AZURE = "Azure" + USER = "User" class HealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -226,6 +173,13 @@ class HealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): IN_PROGRESS = "InProgress" +class HyperVGeneration(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The hypervisor generation of the Virtual Machine [V1, V2].""" + + V1 = "V1" + V2 = "V2" + + class ImdsAttestation(str, Enum, metaclass=CaseInsensitiveEnumMeta): """IMDS attestation status of the cluster.""" @@ -233,20 +187,20 @@ class ImdsAttestation(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" -class LogCollectionJobType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """LogCollection job type.""" +class IpAllocationMethodEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IPAllocationMethod - The IP address allocation method. Possible values include: 'Static', + 'Dynamic'. + """ - ON_DEMAND = "OnDemand" - SCHEDULED = "Scheduled" + DYNAMIC = "Dynamic" + STATIC = "Static" -class LogCollectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """LogCollection status.""" +class IPPoolTypeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of the IP Pool [vm, vippool].""" - NONE = "None" - IN_PROGRESS = "InProgress" - FAILED = "Failed" - SUCCEEDED = "Succeeded" + VM = "vm" + VIPPOOL = "vippool" class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -312,13 +266,11 @@ class OemActivation(str, Enum, metaclass=CaseInsensitiveEnumMeta): ENABLED = "Enabled" -class OperationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The intended operation for a cluster.""" +class OperatingSystemTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Operating system type that the gallery image uses [Windows, Linux].""" - CLUSTER_PROVISIONING = "ClusterProvisioning" - """Cluster provisioning operation.""" - CLUSTER_UPGRADE = "ClusterUpgrade" - """Cluster upgrade operation.""" + WINDOWS = "Windows" + LINUX = "Linux" class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -331,6 +283,26 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): USER_SYSTEM = "user,system" +class PowerStateEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The power state of the virtual machine instance.""" + + DEALLOCATED = "Deallocated" + DEALLOCATING = "Deallocating" + RUNNING = "Running" + STARTING = "Starting" + STOPPED = "Stopped" + STOPPING = "Stopping" + UNKNOWN = "Unknown" + + +class ProvisioningAction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the different types of operations for guest agent.""" + + INSTALL = "install" + UNINSTALL = "uninstall" + REPAIR = "repair" + + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the ArcSetting proxy resource.""" @@ -354,6 +326,17 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISABLE_IN_PROGRESS = "DisableInProgress" +class ProvisioningStateEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Provisioning state of the gallery image.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + ACCEPTED = "Accepted" + DELETING = "Deleting" + CANCELED = "Canceled" + + class RebootRequirement(str, Enum, metaclass=CaseInsensitiveEnumMeta): """RebootRequirement.""" @@ -362,11 +345,13 @@ class RebootRequirement(str, Enum, metaclass=CaseInsensitiveEnumMeta): FALSE = "False" -class RemoteSupportType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Remote Support Type for cluster.""" +class SecurityTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies the SecurityType of the virtual machine. EnableTPM and SecureBootEnabled must be set + to true for SecurityType to function. + """ - ENABLE = "Enable" - REVOKE = "Revoke" + TRUSTED_LAUNCH = "TrustedLaunch" + CONFIDENTIAL_VM = "ConfidentialVM" class ServiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -452,6 +437,14 @@ class StatusLevelTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): ERROR = "Error" +class StatusTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The installation status of the hybrid machine agent installation.""" + + SUCCEEDED = "Succeeded" + IN_PROGRESS = "InProgress" + FAILED = "Failed" + + class UpdateRunPropertiesState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the update run.""" @@ -474,6 +467,34 @@ class UpdateSummariesPropertiesState(str, Enum, metaclass=CaseInsensitiveEnumMet PREPARATION_FAILED = "PreparationFailed" +class VmSizeEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """VmSizeEnum.""" + + DEFAULT = "Default" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_K8_S_V1 = "Standard_K8S_v1" + STANDARD_K8_S2_V1 = "Standard_K8S2_v1" + STANDARD_K8_S3_V1 = "Standard_K8S3_v1" + STANDARD_K8_S4_V1 = "Standard_K8S4_v1" + STANDARD_NK6 = "Standard_NK6" + STANDARD_NK12 = "Standard_NK12" + STANDARD_NV6 = "Standard_NV6" + STANDARD_NV12 = "Standard_NV12" + STANDARD_K8_S5_V1 = "Standard_K8S5_v1" + CUSTOM = "Custom" + + class WindowsServerSubscription(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Desired state of Windows Server Subscription.""" 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 index acc84c5de59c..af2719d3bba6 100644 --- 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 @@ -9,7 +9,7 @@ import datetime import sys -from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union +from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union from .. import _serialization @@ -24,6 +24,53 @@ JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +class AdapterPropertyOverrides(_serialization.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 + """ + + _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 ArcConnectivityProperties(_serialization.Model): """Connectivity related configuration required by arc server. @@ -109,8 +156,8 @@ class Resource(_serialization.Model): 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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -151,8 +198,8 @@ class ProxyResource(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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -170,8 +217,8 @@ class ArcSetting(ProxyResource): # pylint: disable=too-many-instance-attributes 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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -343,8 +390,8 @@ class TrackedResource(Resource): 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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -396,8 +443,8 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes 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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -440,10 +487,6 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes :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. @@ -527,8 +570,6 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes "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": { @@ -559,8 +600,6 @@ def __init__( # pylint: disable=too-many-locals 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, @@ -584,10 +623,6 @@ def __init__( # pylint: disable=too-many-locals :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 @@ -613,8 +648,6 @@ def __init__( # pylint: disable=too-many-locals 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 @@ -1169,17 +1202,12 @@ class DeploymentData(_serialization.Model): # pylint: disable=too-many-instance :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 + :vartype host_network: ~azure.mgmt.azurestackhci.models.HostNetwork :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. + :ivar secrets_location: The URI to the keyvault / secret store. :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 """ @@ -1197,11 +1225,9 @@ class DeploymentData(_serialization.Model): # pylint: disable=too-many-instance "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"}, + "host_network": {"key": "hostNetwork", "type": "HostNetwork"}, "adou_path": {"key": "adouPath", "type": "str"}, "secrets_location": {"key": "secretsLocation", "type": "str"}, - "secrets": {"key": "secrets", "type": "[EceDeploymentSecrets]"}, "optional_services": {"key": "optionalServices", "type": "OptionalServices"}, } @@ -1216,11 +1242,9 @@ def __init__( 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, + host_network: Optional["_models.HostNetwork"] = 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: @@ -1242,17 +1266,12 @@ def __init__( :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 + :paramtype host_network: ~azure.mgmt.azurestackhci.models.HostNetwork :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. + :keyword secrets_location: The URI to the keyvault / secret store. :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 """ @@ -1266,10 +1285,8 @@ def __init__( 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 @@ -1383,8 +1400,8 @@ class DeploymentSetting(ProxyResource): 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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -1404,13 +1421,10 @@ class DeploymentSetting(ProxyResource): :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 + :vartype reported_properties: ~azure.mgmt.azurestackhci.models.ReportedProperties """ _validation = { @@ -1418,7 +1432,6 @@ class DeploymentSetting(ProxyResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, "reported_properties": {"readonly": True}, } @@ -1430,249 +1443,41 @@ class DeploymentSetting(ProxyResource): "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"}, + "reported_properties": {"key": "properties.reportedProperties", "type": "ReportedProperties"}, } def __init__( self, *, + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None, 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 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". + :paramtype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState :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.provisioning_state = provisioning_state 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. @@ -1707,127 +1512,32 @@ def __init__( self.next_link = next_link -class DeploymentSettingStorageAdapterIPInfo(_serialization.Model): - """The StorageAdapter physical nodes of a cluster. +class DeploymentStatus(_serialization.Model): + """The DeploymentStatus of AzureStackHCI 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 + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: Status of 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 = { - "physical_node": {"key": "physicalNode", "type": "str"}, - "ipv4_address": {"key": "ipv4Address", "type": "str"}, - "subnet_mask": {"key": "subnetMask", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "steps": {"key": "steps", "type": "[DeploymentStep]"}, } - 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 - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.enable_iov = enable_iov - self.load_balancing_algorithm = load_balancing_algorithm + self.status = None + self.steps = None class DeploymentStep(_serialization.Model): @@ -1889,11 +1599,11 @@ def __init__(self, **kwargs: Any) -> None: class DeviceConfiguration(_serialization.Model): - """The device Configuration for edge device. + """The device Configuration of a device. :ivar nic_details: NIC Details of device. :vartype nic_details: list[~azure.mgmt.azurestackhci.models.NicDetail] - :ivar device_metadata: Device metadata details. + :ivar device_metadata: device metadata details. :vartype device_metadata: str """ @@ -1912,7 +1622,7 @@ def __init__( """ :keyword nic_details: NIC Details of device. :paramtype nic_details: list[~azure.mgmt.azurestackhci.models.NicDetail] - :keyword device_metadata: Device metadata details. + :keyword device_metadata: device metadata details. :paramtype device_metadata: str """ super().__init__(**kwargs) @@ -1920,117 +1630,13 @@ def __init__( 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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -2040,8 +1646,13 @@ class EdgeDevice(ProxyResource): :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 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 = { @@ -2049,7 +1660,6 @@ class EdgeDevice(ProxyResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, - "kind": {"required": True}, } _attribute_map = { @@ -2057,15 +1667,29 @@ class EdgeDevice(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "kind": {"key": "kind", "type": "str"}, + "device_configuration": {"key": "properties.deviceConfiguration", "type": "DeviceConfiguration"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - _subtype_map = {"kind": {"HCI": "HciEdgeDevice"}} - - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + device_configuration: Optional["_models.DeviceConfiguration"] = None, + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword device_configuration: Device Configuration. + :paramtype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration + :keyword 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". + :paramtype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningState + """ super().__init__(**kwargs) - self.kind: Optional[str] = None + self.device_configuration = device_configuration + self.provisioning_state = provisioning_state class EdgeDeviceListResult(_serialization.Model): @@ -2100,39 +1724,6 @@ def __init__(self, *, value: List["_models.EdgeDevice"], next_link: Optional[str 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. @@ -2225,13 +1816,45 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A self.error = error +class ExtendedLocation(_serialization.Model): + """The complex type of the extended location. + + :ivar name: The name of the extended location. + :vartype name: str + :ivar type: The type of the extended location. "CustomLocation" + :vartype type: str or ~azure.mgmt.azurestackhci.models.ExtendedLocationTypes + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the extended location. + :paramtype name: str + :keyword type: The type of the extended location. "CustomLocation" + :paramtype type: str or ~azure.mgmt.azurestackhci.models.ExtendedLocationTypes + """ + super().__init__(**kwargs) + self.name = name + self.type = type + + 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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -2256,7 +1879,7 @@ class Extension(ProxyResource): # pylint: disable=too-many-instance-attributes :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". + "Azure" and "User". :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. @@ -2565,29 +2188,6 @@ def __init__( 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. @@ -2608,689 +2208,877 @@ def __init__(self, *, target_version: Optional[str] = None, **kwargs: Any) -> No self.target_version = target_version -class HciEdgeDevice(EdgeDevice): - """Arc-enabled edge device with HCI OS. +class GalleryDiskImage(_serialization.Model): + """This is the disk image base class. 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 + :ivar size_in_mb: This property indicates the size of the VHD to be created. + :vartype size_in_mb: int """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "kind": {"required": True}, + "size_in_mb": {"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"}, - "kind": {"key": "kind", "type": "str"}, - "properties": {"key": "properties", "type": "HciEdgeDeviceProperties"}, + "size_in_mb": {"key": "sizeInMB", "type": "int"}, } - 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 - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.kind: str = "HCI" - self.properties = properties + self.size_in_mb = None -class HciEdgeDeviceAdapterPropertyOverrides(_serialization.Model): - """The AdapterPropertyOverrides of a cluster. +class GalleryImageIdentifier(_serialization.Model): + """This is the gallery image definition identifier. - 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 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 + :ivar publisher: The name of the gallery image definition publisher. Required. + :vartype publisher: str + :ivar offer: The name of the gallery image definition offer. Required. + :vartype offer: str + :ivar sku: The name of the gallery image definition SKU. Required. + :vartype sku: str """ _validation = { - "jumbo_packet": {"readonly": True}, - "network_direct": {"readonly": True}, - "network_direct_technology": {"readonly": True}, + "publisher": {"required": True}, + "offer": {"required": True}, + "sku": {"required": True}, } _attribute_map = { - "jumbo_packet": {"key": "jumboPacket", "type": "str"}, - "network_direct": {"key": "networkDirect", "type": "str"}, - "network_direct_technology": {"key": "networkDirectTechnology", "type": "str"}, + "publisher": {"key": "publisher", "type": "str"}, + "offer": {"key": "offer", "type": "str"}, + "sku": {"key": "sku", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, publisher: str, offer: str, sku: str, **kwargs: Any) -> None: + """ + :keyword publisher: The name of the gallery image definition publisher. Required. + :paramtype publisher: str + :keyword offer: The name of the gallery image definition offer. Required. + :paramtype offer: str + :keyword sku: The name of the gallery image definition SKU. Required. + :paramtype sku: str + """ super().__init__(**kwargs) - self.jumbo_packet = None - self.network_direct = None - self.network_direct_technology = None + self.publisher = publisher + self.offer = offer + self.sku = sku -class HciEdgeDeviceArcExtension(_serialization.Model): - """Arc extension installed on edge device. +class GalleryImages(TrackedResource): # pylint: disable=too-many-instance-attributes + """The gallery images resource definition. 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 + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :ivar container_id: Storage ContainerID of the storage container to be used for gallery image. + :vartype container_id: str + :ivar image_path: location of the image the gallery image should be created from. + :vartype image_path: str + :ivar os_type: Operating system type that the gallery image uses [Windows, Linux]. Known values + are: "Windows" and "Linux". + :vartype os_type: str or ~azure.mgmt.azurestackhci.models.OperatingSystemTypes + :ivar cloud_init_data_source: Datasource for the gallery image when provisioning with + cloud-init [NoCloud, Azure]. Known values are: "NoCloud" and "Azure". + :vartype cloud_init_data_source: str or ~azure.mgmt.azurestackhci.models.CloudInitDataSource + :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine [V1, V2]. Known + values are: "V1" and "V2". + :vartype hyper_v_generation: str or ~azure.mgmt.azurestackhci.models.HyperVGeneration + :ivar identifier: This is the gallery image definition identifier. + :vartype identifier: ~azure.mgmt.azurestackhci.models.GalleryImageIdentifier + :ivar version: Specifies information about the gallery image version that you want to create or + update. + :vartype version: ~azure.mgmt.azurestackhci.models.GalleryImageVersion + :ivar provisioning_state: Provisioning state of the gallery image. Known values are: + "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningStateEnum + :ivar status: The observed state of gallery images. + :vartype status: ~azure.mgmt.azurestackhci.models.GalleryImageStatus """ _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}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "status": {"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"}, + "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"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "container_id": {"key": "properties.containerId", "type": "str"}, + "image_path": {"key": "properties.imagePath", "type": "str"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "cloud_init_data_source": {"key": "properties.cloudInitDataSource", "type": "str"}, + "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, + "identifier": {"key": "properties.identifier", "type": "GalleryImageIdentifier"}, + "version": {"key": "properties.version", "type": "GalleryImageVersion"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "status": {"key": "properties.status", "type": "GalleryImageStatus"}, } - 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 + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + container_id: Optional[str] = None, + image_path: Optional[str] = None, + os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, + cloud_init_data_source: Optional[Union[str, "_models.CloudInitDataSource"]] = None, + hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, + identifier: Optional["_models.GalleryImageIdentifier"] = None, + version: Optional["_models.GalleryImageVersion"] = 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 extended_location: The extendedLocation of the resource. + :paramtype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :keyword container_id: Storage ContainerID of the storage container to be used for gallery + image. + :paramtype container_id: str + :keyword image_path: location of the image the gallery image should be created from. + :paramtype image_path: str + :keyword os_type: Operating system type that the gallery image uses [Windows, Linux]. Known + values are: "Windows" and "Linux". + :paramtype os_type: str or ~azure.mgmt.azurestackhci.models.OperatingSystemTypes + :keyword cloud_init_data_source: Datasource for the gallery image when provisioning with + cloud-init [NoCloud, Azure]. Known values are: "NoCloud" and "Azure". + :paramtype cloud_init_data_source: str or ~azure.mgmt.azurestackhci.models.CloudInitDataSource + :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine [V1, V2]. Known + values are: "V1" and "V2". + :paramtype hyper_v_generation: str or ~azure.mgmt.azurestackhci.models.HyperVGeneration + :keyword identifier: This is the gallery image definition identifier. + :paramtype identifier: ~azure.mgmt.azurestackhci.models.GalleryImageIdentifier + :keyword version: Specifies information about the gallery image version that you want to create + or update. + :paramtype version: ~azure.mgmt.azurestackhci.models.GalleryImageVersion + """ + super().__init__(tags=tags, location=location, **kwargs) + self.extended_location = extended_location + self.container_id = container_id + self.image_path = image_path + self.os_type = os_type + self.cloud_init_data_source = cloud_init_data_source + self.hyper_v_generation = hyper_v_generation + self.identifier = identifier + self.version = version + self.provisioning_state = None + self.status = None -class HciEdgeDeviceHostNetwork(_serialization.Model): - """The HostNetwork of a cluster. +class GalleryImagesListResult(_serialization.Model): + """List of gallery images. 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 + :ivar value: + :vartype value: list[~azure.mgmt.azurestackhci.models.GalleryImages] + :ivar next_link: Link to the next set of results. + :vartype next_link: str """ _validation = { - "intents": {"readonly": True}, - "storage_networks": {"readonly": True}, - "storage_connectivity_switchless": {"readonly": True}, - "enable_storage_auto_ip": {"readonly": True}, + "next_link": {"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"}, + "value": {"key": "value", "type": "[GalleryImages]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: Optional[List["_models.GalleryImages"]] = None, **kwargs: Any) -> None: + """ + :keyword value: + :paramtype value: list[~azure.mgmt.azurestackhci.models.GalleryImages] + """ super().__init__(**kwargs) - self.intents = None - self.storage_networks = None - self.storage_connectivity_switchless = None - self.enable_storage_auto_ip = None - + self.value = value + self.next_link = 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. +class GalleryImageStatus(_serialization.Model): + """The observed state of gallery images. - :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 + :ivar error_code: GalleryImage provisioning error code. + :vartype error_code: str + :ivar error_message: Descriptive error message. + :vartype error_message: str + :ivar provisioning_status: + :vartype provisioning_status: + ~azure.mgmt.azurestackhci.models.GalleryImageStatusProvisioningStatus + :ivar download_status: The download status of the gallery image. + :vartype download_status: ~azure.mgmt.azurestackhci.models.GalleryImageStatusDownloadStatus + :ivar progress_percentage: The progress of the operation in percentage. + :vartype progress_percentage: int """ - _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", - }, + _attribute_map = { + "error_code": {"key": "errorCode", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "GalleryImageStatusProvisioningStatus"}, + "download_status": {"key": "downloadStatus", "type": "GalleryImageStatusDownloadStatus"}, + "progress_percentage": {"key": "progressPercentage", "type": "int"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + provisioning_status: Optional["_models.GalleryImageStatusProvisioningStatus"] = None, + download_status: Optional["_models.GalleryImageStatusDownloadStatus"] = None, + progress_percentage: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword error_code: GalleryImage provisioning error code. + :paramtype error_code: str + :keyword error_message: Descriptive error message. + :paramtype error_message: str + :keyword provisioning_status: + :paramtype provisioning_status: + ~azure.mgmt.azurestackhci.models.GalleryImageStatusProvisioningStatus + :keyword download_status: The download status of the gallery image. + :paramtype download_status: ~azure.mgmt.azurestackhci.models.GalleryImageStatusDownloadStatus + :keyword progress_percentage: The progress of the operation in percentage. + :paramtype progress_percentage: int + """ 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. + self.error_code = error_code + self.error_message = error_message + self.provisioning_status = provisioning_status + self.download_status = download_status + self.progress_percentage = progress_percentage - 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 - """ +class GalleryImageStatusDownloadStatus(_serialization.Model): + """The download status of the gallery image. - _validation = { - "provisioning_state": {"readonly": True}, - "reported_properties": {"readonly": True}, - } + :ivar download_size_in_mb: The downloaded sized of the image in MB. + :vartype download_size_in_mb: int + """ _attribute_map = { - "device_configuration": {"key": "deviceConfiguration", "type": "DeviceConfiguration"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "reported_properties": {"key": "reportedProperties", "type": "HciReportedProperties"}, + "download_size_in_mb": {"key": "downloadSizeInMB", "type": "int"}, } - def __init__(self, *, device_configuration: Optional["_models.DeviceConfiguration"] = None, **kwargs: Any) -> None: + def __init__(self, *, download_size_in_mb: Optional[int] = None, **kwargs: Any) -> None: """ - :keyword device_configuration: Device Configuration. - :paramtype device_configuration: ~azure.mgmt.azurestackhci.models.DeviceConfiguration + :keyword download_size_in_mb: The downloaded sized of the image in MB. + :paramtype download_size_in_mb: int """ - super().__init__(device_configuration=device_configuration, **kwargs) - self.reported_properties = None - + super().__init__(**kwargs) + self.download_size_in_mb = download_size_in_mb -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. +class GalleryImageStatusProvisioningStatus(_serialization.Model): + """GalleryImageStatusProvisioningStatus. - :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 + :ivar operation_id: The ID of the operation performed on the gallery image. + :vartype operation_id: str + :ivar status: The status of the operation performed on the gallery image [Succeeded, Failed, + InProgress]. 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 """ - _validation = { - "physical_node": {"readonly": True}, - "ipv4_address": {"readonly": True}, - "subnet_mask": {"readonly": True}, + _attribute_map = { + "operation_id": {"key": "operationId", "type": "str"}, + "status": {"key": "status", "type": "str"}, } + def __init__( + self, + *, + operation_id: Optional[str] = None, + status: Optional[Union[str, "_models.Status"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword operation_id: The ID of the operation performed on the gallery image. + :paramtype operation_id: str + :keyword status: The status of the operation performed on the gallery image [Succeeded, Failed, + InProgress]. 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 + """ + super().__init__(**kwargs) + self.operation_id = operation_id + self.status = status + + +class GalleryImagesUpdateRequest(_serialization.Model): + """The gallery images resource patch definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + _attribute_map = { - "physical_node": {"key": "physicalNode", "type": "str"}, - "ipv4_address": {"key": "ipv4Address", "type": "str"}, - "subnet_mask": {"key": "subnetMask", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ super().__init__(**kwargs) - self.physical_node = None - self.ipv4_address = None - self.subnet_mask = None - + self.tags = tags -class HciEdgeDeviceStorageNetworks(_serialization.Model): - """The StorageNetworks of a cluster. - Variables are only populated by the server, and will be ignored when sending a request. +class GalleryImageVersion(_serialization.Model): + """Specifies information about the gallery image version that you want to create or update. - :ivar name: Name of the storage network. + :ivar name: This is the version of the gallery image. :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] + :ivar storage_profile: This is the storage profile of a Gallery Image Version. + :vartype storage_profile: ~azure.mgmt.azurestackhci.models.GalleryImageVersionStorageProfile """ - _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]"}, + "storage_profile": {"key": "properties.storageProfile", "type": "GalleryImageVersionStorageProfile"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + name: Optional[str] = None, + storage_profile: Optional["_models.GalleryImageVersionStorageProfile"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: This is the version of the gallery image. + :paramtype name: str + :keyword storage_profile: This is the storage profile of a Gallery Image Version. + :paramtype storage_profile: ~azure.mgmt.azurestackhci.models.GalleryImageVersionStorageProfile + """ super().__init__(**kwargs) - self.name = None - self.network_adapter_name = None - self.storage_vlan_id = None - self.storage_adapter_ip_info = None - + self.name = name + self.storage_profile = storage_profile -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. +class GalleryImageVersionStorageProfile(_serialization.Model): + """This is the storage profile of a Gallery Image Version. - :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 + :ivar os_disk_image: This is the OS disk image. + :vartype os_disk_image: ~azure.mgmt.azurestackhci.models.GalleryOSDiskImage """ - _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"}, + "os_disk_image": {"key": "osDiskImage", "type": "GalleryOSDiskImage"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, os_disk_image: Optional["_models.GalleryOSDiskImage"] = None, **kwargs: Any) -> None: + """ + :keyword os_disk_image: This is the OS disk image. + :paramtype os_disk_image: ~azure.mgmt.azurestackhci.models.GalleryOSDiskImage + """ super().__init__(**kwargs) - self.enable_iov = None - self.load_balancing_algorithm = None + self.os_disk_image = os_disk_image -class HciNetworkProfile(_serialization.Model): - """The network profile of a device. +class GalleryOSDiskImage(GalleryDiskImage): + """This is the OS disk image. 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 + :ivar size_in_mb: This property indicates the size of the VHD to be created. + :vartype size_in_mb: int + """ + + +class GuestAgent(ProxyResource): + """Defines the GuestAgent. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 credentials: Username / Password Credentials to provision guest agent. + :vartype credentials: ~azure.mgmt.azurestackhci.models.GuestCredential + :ivar provisioning_action: The guest agent provisioning action. Known values are: "install", + "uninstall", and "repair". + :vartype provisioning_action: str or ~azure.mgmt.azurestackhci.models.ProvisioningAction + :ivar status: The guest agent status. + :vartype status: str + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str """ _validation = { - "nic_details": {"readonly": True}, - "switch_details": {"readonly": True}, - "host_network": {"readonly": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "status": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - "nic_details": {"key": "nicDetails", "type": "[HciNicDetail]"}, - "switch_details": {"key": "switchDetails", "type": "[SwitchDetail]"}, - "host_network": {"key": "hostNetwork", "type": "HciEdgeDeviceHostNetwork"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "credentials": {"key": "properties.credentials", "type": "GuestCredential"}, + "provisioning_action": {"key": "properties.provisioningAction", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + credentials: Optional["_models.GuestCredential"] = None, + provisioning_action: Optional[Union[str, "_models.ProvisioningAction"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword credentials: Username / Password Credentials to provision guest agent. + :paramtype credentials: ~azure.mgmt.azurestackhci.models.GuestCredential + :keyword provisioning_action: The guest agent provisioning action. Known values are: "install", + "uninstall", and "repair". + :paramtype provisioning_action: str or ~azure.mgmt.azurestackhci.models.ProvisioningAction + """ super().__init__(**kwargs) - self.nic_details = None - self.switch_details = None - self.host_network = None + self.credentials = credentials + self.provisioning_action = provisioning_action + self.status = None + self.provisioning_state = None -class HciNicDetail(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The NIC Detail of a device. +class GuestAgentInstallStatus(_serialization.Model): + """Defines the status of a guest agent installation. 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 + :ivar vm_uuid: Specifies the VM's unique SMBIOS ID. + :vartype vm_uuid: str + :ivar status: The installation status of the hybrid machine agent installation. Known values + are: "Succeeded", "InProgress", and "Failed". + :vartype status: str or ~azure.mgmt.azurestackhci.models.StatusTypes + :ivar last_status_change: The time of the last status change. + :vartype last_status_change: ~datetime.datetime + :ivar agent_version: The hybrid machine agent full version. + :vartype agent_version: str + :ivar error_details: Details about the error state. + :vartype error_details: list[~azure.mgmt.azurestackhci.models.ErrorDetail] """ _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}, + "vm_uuid": {"readonly": True}, + "status": {"readonly": True}, + "last_status_change": {"readonly": True}, + "agent_version": {"readonly": True}, + "error_details": {"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"}, + "vm_uuid": {"key": "vmUuid", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "last_status_change": {"key": "lastStatusChange", "type": "iso-8601"}, + "agent_version": {"key": "agentVersion", "type": "str"}, + "error_details": {"key": "errorDetails", "type": "[ErrorDetail]"}, } 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. + self.vm_uuid = None + self.status = None + self.last_status_change = None + self.agent_version = None + self.error_details = None - 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 +class GuestAgentList(_serialization.Model): + """List of GuestAgent. + + All required parameters must be populated in order to send to server. + + :ivar next_link: Url to follow for getting next page of GuestAgent. + :vartype next_link: str + :ivar value: Array of GuestAgent. Required. + :vartype value: list[~azure.mgmt.azurestackhci.models.GuestAgent] """ _validation = { - "boot_type": {"readonly": True}, - "assembly_version": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { - "boot_type": {"key": "bootType", "type": "str"}, - "assembly_version": {"key": "assemblyVersion", "type": "str"}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[GuestAgent]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: List["_models.GuestAgent"], next_link: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword next_link: Url to follow for getting next page of GuestAgent. + :paramtype next_link: str + :keyword value: Array of GuestAgent. Required. + :paramtype value: list[~azure.mgmt.azurestackhci.models.GuestAgent] + """ super().__init__(**kwargs) - self.boot_type = None - self.assembly_version = None + self.next_link = next_link + self.value = value -class ReportedProperties(_serialization.Model): - """Reported properties pushed from edge device. +class GuestCredential(_serialization.Model): + """Username / Password Credentials to connect to guest. - Variables are only populated by the server, and will be ignored when sending a request. + :ivar username: The username to connect with the guest. + :vartype username: str + :ivar password: The password to connect with the guest. + :vartype password: str + """ + + _attribute_map = { + "username": {"key": "username", "type": "str"}, + "password": {"key": "password", "type": "str"}, + } + + def __init__(self, *, username: Optional[str] = None, password: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword username: The username to connect with the guest. + :paramtype username: str + :keyword password: The password to connect with the guest. + :paramtype password: str + """ + super().__init__(**kwargs) + self.username = username + self.password = password - :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 + +class HardwareProfileUpdate(_serialization.Model): + """HardwareProfile - Specifies the hardware settings for the virtual machine instance. + + :ivar vm_size: Known values are: "Default", "Standard_A2_v2", "Standard_A4_v2", + "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", + "Standard_D32s_v3", "Standard_DS2_v2", "Standard_DS3_v2", "Standard_DS4_v2", "Standard_DS5_v2", + "Standard_DS13_v2", "Standard_K8S_v1", "Standard_K8S2_v1", "Standard_K8S3_v1", + "Standard_K8S4_v1", "Standard_NK6", "Standard_NK12", "Standard_NV6", "Standard_NV12", + "Standard_K8S5_v1", and "Custom". + :vartype vm_size: str or ~azure.mgmt.azurestackhci.models.VmSizeEnum + :ivar processors: number of processors for the virtual machine instance. + :vartype processors: int + :ivar memory_mb: RAM in MB for the virtual machine instance. + :vartype memory_mb: int """ - _validation = { - "device_state": {"readonly": True}, - "extension_profile": {"readonly": True}, + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "processors": {"key": "processors", "type": "int"}, + "memory_mb": {"key": "memoryMB", "type": "int"}, + } + + def __init__( + self, + *, + vm_size: Optional[Union[str, "_models.VmSizeEnum"]] = None, + processors: Optional[int] = None, + memory_mb: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword vm_size: Known values are: "Default", "Standard_A2_v2", "Standard_A4_v2", + "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", + "Standard_D32s_v3", "Standard_DS2_v2", "Standard_DS3_v2", "Standard_DS4_v2", "Standard_DS5_v2", + "Standard_DS13_v2", "Standard_K8S_v1", "Standard_K8S2_v1", "Standard_K8S3_v1", + "Standard_K8S4_v1", "Standard_NK6", "Standard_NK12", "Standard_NV6", "Standard_NV12", + "Standard_K8S5_v1", and "Custom". + :paramtype vm_size: str or ~azure.mgmt.azurestackhci.models.VmSizeEnum + :keyword processors: number of processors for the virtual machine instance. + :paramtype processors: int + :keyword memory_mb: RAM in MB for the virtual machine instance. + :paramtype memory_mb: int + """ + super().__init__(**kwargs) + self.vm_size = vm_size + self.processors = processors + self.memory_mb = memory_mb + + +class HostNetwork(_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.Intents] + :ivar storage_networks: List of StorageNetworks config to deploy AzureStackHCI Cluster. + :vartype storage_networks: list[~azure.mgmt.azurestackhci.models.StorageNetworks] + :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": "[Intents]"}, + "storage_networks": {"key": "storageNetworks", "type": "[StorageNetworks]"}, + "storage_connectivity_switchless": {"key": "storageConnectivitySwitchless", "type": "bool"}, + "enable_storage_auto_ip": {"key": "enableStorageAutoIp", "type": "bool"}, } + def __init__( + self, + *, + intents: Optional[List["_models.Intents"]] = None, + storage_networks: Optional[List["_models.StorageNetworks"]] = 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.Intents] + :keyword storage_networks: List of StorageNetworks config to deploy AzureStackHCI Cluster. + :paramtype storage_networks: list[~azure.mgmt.azurestackhci.models.StorageNetworks] + :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 HttpProxyConfiguration(_serialization.Model): + """HTTP Proxy configuration for the VM. + + :ivar http_proxy: The HTTP proxy server endpoint to use. + :vartype http_proxy: str + :ivar https_proxy: The HTTPS proxy server endpoint to use. + :vartype https_proxy: str + :ivar no_proxy: The endpoints that should not go through proxy. + :vartype no_proxy: list[str] + :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :vartype trusted_ca: str + """ + _attribute_map = { - "device_state": {"key": "deviceState", "type": "str"}, - "extension_profile": {"key": "extensionProfile", "type": "ExtensionProfile"}, + "http_proxy": {"key": "httpProxy", "type": "str"}, + "https_proxy": {"key": "httpsProxy", "type": "str"}, + "no_proxy": {"key": "noProxy", "type": "[str]"}, + "trusted_ca": {"key": "trustedCa", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + http_proxy: Optional[str] = None, + https_proxy: Optional[str] = None, + no_proxy: Optional[List[str]] = None, + trusted_ca: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword http_proxy: The HTTP proxy server endpoint to use. + :paramtype http_proxy: str + :keyword https_proxy: The HTTPS proxy server endpoint to use. + :paramtype https_proxy: str + :keyword no_proxy: The endpoints that should not go through proxy. + :paramtype no_proxy: list[str] + :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. + :paramtype trusted_ca: str + """ super().__init__(**kwargs) - self.device_state = None - self.extension_profile = None + self.http_proxy = http_proxy + self.https_proxy = https_proxy + self.no_proxy = no_proxy + self.trusted_ca = trusted_ca -class HciReportedProperties(ReportedProperties): - """The device Configuration for HCI device. +class HybridIdentityMetadata(ProxyResource): + """Defines the HybridIdentityMetadata. 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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 sbe_deployment_package_info: ~azure.mgmt.azurestackhci.models.SbeDeploymentPackageInfo + :vartype system_data: ~azure.mgmt.azurestackhci.models.SystemData + :ivar resource_uid: The unique identifier for the resource. + :vartype resource_uid: str + :ivar public_key: The Public Key. + :vartype public_key: str + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.azurestackhci.models.Identity + :ivar provisioning_state: The provisioning state. + :vartype provisioning_state: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "identity": {"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"}, + "resource_uid": {"key": "properties.resourceUid", "type": "str"}, + "public_key": {"key": "properties.publicKey", "type": "str"}, + "identity": {"key": "properties.identity", "type": "Identity"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + } + + def __init__(self, *, resource_uid: Optional[str] = None, public_key: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword resource_uid: The unique identifier for the resource. + :paramtype resource_uid: str + :keyword public_key: The Public Key. + :paramtype public_key: str + """ + super().__init__(**kwargs) + self.resource_uid = resource_uid + self.public_key = public_key + self.identity = None + self.provisioning_state = None + + +class HybridIdentityMetadataList(_serialization.Model): + """List of HybridIdentityMetadata. + + All required parameters must be populated in order to send to server. + + :ivar next_link: Url to follow for getting next page of HybridIdentityMetadata. + :vartype next_link: str + :ivar value: Array of HybridIdentityMetadata. Required. + :vartype value: list[~azure.mgmt.azurestackhci.models.HybridIdentityMetadata] """ _validation = { - "device_state": {"readonly": True}, - "extension_profile": {"readonly": True}, - "network_profile": {"readonly": True}, - "os_profile": {"readonly": True}, - "sbe_deployment_package_info": {"readonly": True}, + "value": {"required": 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"}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[HybridIdentityMetadata]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: List["_models.HybridIdentityMetadata"], next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword next_link: Url to follow for getting next page of HybridIdentityMetadata. + :paramtype next_link: str + :keyword value: Array of HybridIdentityMetadata. Required. + :paramtype value: list[~azure.mgmt.azurestackhci.models.HybridIdentityMetadata] + """ super().__init__(**kwargs) - self.network_profile = None - self.os_profile = None - self.sbe_deployment_package_info = None + self.next_link = next_link + self.value = value -class HciValidationFailureDetail(_serialization.Model): - """details of validation failure. +class Identity(_serialization.Model): + """Identity for the resource. 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 + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + :ivar type: The identity type. Default value is "SystemAssigned". + :vartype type: str """ _validation = { - "exception": {"readonly": True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, } _attribute_map = { - "exception": {"key": "exception", "type": "str"}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs: Any) -> None: + """ + :keyword type: The identity type. Default value is "SystemAssigned". + :paramtype type: str + """ super().__init__(**kwargs) - self.exception = None + self.principal_id = None + self.tenant_id = None + self.type = type class InfrastructureNetwork(_serialization.Model): @@ -3350,439 +3138,465 @@ def __init__( 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 - """ +class InstanceViewStatus(_serialization.Model): + """Instance view status. - _attribute_map = { - "starting_address": {"key": "startingAddress", "type": "str"}, - "ending_address": {"key": "endingAddress", "type": "str"}, + :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, *, starting_address: Optional[str] = None, ending_address: Optional[str] = None, **kwargs: Any + 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 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 + :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.starting_address = starting_address - self.ending_address = ending_address - + self.code = code + self.level = level + self.display_status = display_status + self.message = message + self.time = time -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. +class Intents(_serialization.Model): + """The Intents of a 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 + :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.VirtualSwitchConfigurationOverrides + :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.AdapterPropertyOverrides """ - _validation = { - "attestation_resource_id": {"readonly": True}, - "relying_party_service_endpoint": {"readonly": True}, - "attestation_service_endpoint": {"readonly": True}, + _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": "VirtualSwitchConfigurationOverrides", + }, + "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": "AdapterPropertyOverrides"}, } + 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.VirtualSwitchConfigurationOverrides"] = None, + override_qos_policy: bool = False, + qos_policy_overrides: Optional["_models.QosPolicyOverrides"] = None, + override_adapter_property: bool = False, + adapter_property_overrides: Optional["_models.AdapterPropertyOverrides"] = 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.VirtualSwitchConfigurationOverrides + :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.AdapterPropertyOverrides + """ + 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 InterfaceDNSSettings(_serialization.Model): + """InterfaceDNSSettings. + + :ivar dns_servers: List of DNS server IP Addresses for the interface. + :vartype dns_servers: list[str] + """ + _attribute_map = { - "attestation_resource_id": {"key": "attestationResourceId", "type": "str"}, - "relying_party_service_endpoint": {"key": "relyingPartyServiceEndpoint", "type": "str"}, - "attestation_service_endpoint": {"key": "attestationServiceEndpoint", "type": "str"}, + "dns_servers": {"key": "dnsServers", "type": "[str]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, dns_servers: Optional[List[str]] = None, **kwargs: Any) -> None: + """ + :keyword dns_servers: List of DNS server IP Addresses for the interface. + :paramtype dns_servers: list[str] + """ super().__init__(**kwargs) - self.attestation_resource_id = None - self.relying_party_service_endpoint = None - self.attestation_service_endpoint = None - + self.dns_servers = dns_servers -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. +class IPConfiguration(_serialization.Model): + """InterfaceIPConfiguration iPConfiguration in a network interface. - :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 + :ivar name: Name - The name of the resource that is unique within a resource group. This name + can be used to access the resource. + :vartype name: str + :ivar properties: InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + :vartype properties: ~azure.mgmt.azurestackhci.models.IPConfigurationProperties """ _validation = { - "error_code": {"readonly": True}, - "error_message": {"readonly": True}, + "name": {"pattern": r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$"}, } _attribute_map = { - "error_code": {"key": "errorCode", "type": "str"}, - "error_message": {"key": "errorMessage", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "properties": {"key": "properties", "type": "IPConfigurationProperties"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + name: Optional[str] = None, + properties: Optional["_models.IPConfigurationProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name - The name of the resource that is unique within a resource group. This + name can be used to access the resource. + :paramtype name: str + :keyword properties: InterfaceIPConfigurationPropertiesFormat properties of IP configuration. + :paramtype properties: ~azure.mgmt.azurestackhci.models.IPConfigurationProperties + """ super().__init__(**kwargs) - self.error_code = None - self.error_message = None + self.name = name + self.properties = properties -class LogCollectionProperties(_serialization.Model): - """Log Collection properties of the cluster. +class IPConfigurationProperties(_serialization.Model): + """InterfaceIPConfigurationPropertiesFormat properties of IP configuration. 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] + :ivar gateway: Gateway for network interface. + :vartype gateway: str + :ivar prefix_length: prefixLength for network interface. + :vartype prefix_length: str + :ivar private_ip_address: PrivateIPAddress - Private IP address of the IP configuration. + :vartype private_ip_address: str + :ivar subnet: Subnet - Name of Subnet bound to the IP configuration. + :vartype subnet: ~azure.mgmt.azurestackhci.models.IPConfigurationPropertiesSubnet """ _validation = { - "from_date": {"readonly": True}, - "to_date": {"readonly": True}, - "last_log_generated": {"readonly": True}, - "log_collection_session_details": {"readonly": True}, + "gateway": {"readonly": True}, + "prefix_length": {"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]"}, + "gateway": {"key": "gateway", "type": "str"}, + "prefix_length": {"key": "prefixLength", "type": "str"}, + "private_ip_address": {"key": "privateIPAddress", "type": "str"}, + "subnet": {"key": "subnet", "type": "IPConfigurationPropertiesSubnet"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + private_ip_address: Optional[str] = None, + subnet: Optional["_models.IPConfigurationPropertiesSubnet"] = None, + **kwargs: Any + ) -> None: + """ + :keyword private_ip_address: PrivateIPAddress - Private IP address of the IP configuration. + :paramtype private_ip_address: str + :keyword subnet: Subnet - Name of Subnet bound to the IP configuration. + :paramtype subnet: ~azure.mgmt.azurestackhci.models.IPConfigurationPropertiesSubnet + """ super().__init__(**kwargs) - self.from_date = None - self.to_date = None - self.last_log_generated = None - self.log_collection_session_details = None + self.gateway = None + self.prefix_length = None + self.private_ip_address = private_ip_address + self.subnet = subnet -class LogCollectionRequest(_serialization.Model): - """Log Collection Request. +class IPConfigurationPropertiesSubnet(_serialization.Model): + """Subnet - Name of Subnet bound to the IP configuration. - :ivar properties: Properties for Log Collection Request. - :vartype properties: ~azure.mgmt.azurestackhci.models.LogCollectionRequestProperties + :ivar id: ID - The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :vartype id: str """ _attribute_map = { - "properties": {"key": "properties", "type": "LogCollectionRequestProperties"}, + "id": {"key": "id", "type": "str"}, } - def __init__(self, *, properties: Optional["_models.LogCollectionRequestProperties"] = None, **kwargs: Any) -> None: + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ - :keyword properties: Properties for Log Collection Request. - :paramtype properties: ~azure.mgmt.azurestackhci.models.LogCollectionRequestProperties + :keyword id: ID - The ARM resource id in the form of + /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + :paramtype id: str """ super().__init__(**kwargs) - self.properties = properties - + self.id = id -class LogCollectionRequestProperties(_serialization.Model): - """Properties for Log Collection Request. - All required parameters must be populated in order to send to server. +class IPPool(_serialization.Model): + """IPPool. - :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 + :ivar name: Name of the IP-Pool. + :vartype name: str + :ivar ip_pool_type: Type of the IP Pool [vm, vippool]. Known values are: "vm" and "vippool". + :vartype ip_pool_type: str or ~azure.mgmt.azurestackhci.models.IPPoolTypeEnum + :ivar start: Start of the IP address pool. + :vartype start: str + :ivar end: End of the IP address pool. + :vartype end: str + :ivar info: + :vartype info: ~azure.mgmt.azurestackhci.models.IPPoolInfo """ - _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"}, + "name": {"key": "name", "type": "str"}, + "ip_pool_type": {"key": "ipPoolType", "type": "str"}, + "start": {"key": "start", "type": "str"}, + "end": {"key": "end", "type": "str"}, + "info": {"key": "info", "type": "IPPoolInfo"}, } - def __init__(self, *, from_date: datetime.datetime, to_date: datetime.datetime, **kwargs: Any) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + ip_pool_type: Optional[Union[str, "_models.IPPoolTypeEnum"]] = None, + start: Optional[str] = None, + end: Optional[str] = None, + info: Optional["_models.IPPoolInfo"] = None, + **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 + :keyword name: Name of the IP-Pool. + :paramtype name: str + :keyword ip_pool_type: Type of the IP Pool [vm, vippool]. Known values are: "vm" and "vippool". + :paramtype ip_pool_type: str or ~azure.mgmt.azurestackhci.models.IPPoolTypeEnum + :keyword start: Start of the IP address pool. + :paramtype start: str + :keyword end: End of the IP address pool. + :paramtype end: str + :keyword info: + :paramtype info: ~azure.mgmt.azurestackhci.models.IPPoolInfo """ super().__init__(**kwargs) - self.from_date = from_date - self.to_date = to_date + self.name = name + self.ip_pool_type = ip_pool_type + self.start = start + self.end = end + self.info = info -class LogCollectionSession(_serialization.Model): - """Log Collection Session details of the cluster. +class IPPoolInfo(_serialization.Model): + """IPPoolInfo. 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 + :ivar used: Number of IP addresses allocated from the IP Pool. + :vartype used: str + :ivar available: Number of IP addresses available in the IP Pool. + :vartype available: str """ _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}, + "used": {"readonly": True}, + "available": {"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"}, + "used": {"key": "used", "type": "str"}, + "available": {"key": "available", "type": "str"}, } 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 + self.used = None + self.available = None -class NetworkController(_serialization.Model): - """network controller config for SDN Integration to deploy AzureStackHCI Cluster. +class IpPools(_serialization.Model): + """The dnsServers of a device. - :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 + :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 = { - "mac_address_pool_start": {"key": "macAddressPoolStart", "type": "str"}, - "mac_address_pool_stop": {"key": "macAddressPoolStop", "type": "str"}, - "network_virtualization_enabled": {"key": "networkVirtualizationEnabled", "type": "bool"}, + "starting_address": {"key": "startingAddress", "type": "str"}, + "ending_address": {"key": "endingAddress", "type": "str"}, } 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 + self, *, starting_address: Optional[str] = None, ending_address: Optional[str] = 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 + :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.mac_address_pool_start = mac_address_pool_start - self.mac_address_pool_stop = mac_address_pool_stop - self.network_virtualization_enabled = network_virtualization_enabled + self.starting_address = starting_address + self.ending_address = ending_address -class NicDetail(_serialization.Model): - """The NIC Detail of a device. +class IsolatedVmAttestationConfiguration(_serialization.Model): + """Attestation configurations for isolated VM (e.g. TVM, CVM) of the cluster. - :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 + 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 = { - "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"}, + "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, - *, - 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 - """ + def __init__(self, **kwargs: Any) -> None: + """ """ 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 + self.attestation_resource_id = None + self.relying_party_service_endpoint = None + self.attestation_service_endpoint = None -class Observability(_serialization.Model): - """The Observability of AzureStackHCI Cluster. +class LogicalNetworkPropertiesDhcpOptions(_serialization.Model): + """DhcpOptions contains an array of DNS servers available to VMs deployed in the logical network. + Standard DHCP option for a subnet overrides logical network DHCP options. - :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 + :ivar dns_servers: The list of DNS servers IP addresses. + :vartype dns_servers: list[str] """ _attribute_map = { - "streaming_data_client": {"key": "streamingDataClient", "type": "bool"}, - "eu_location": {"key": "euLocation", "type": "bool"}, - "episodic_data_upload": {"key": "episodicDataUpload", "type": "bool"}, + "dns_servers": {"key": "dnsServers", "type": "[str]"}, } - def __init__( - self, - *, - streaming_data_client: bool = True, - eu_location: bool = False, - episodic_data_upload: bool = True, - **kwargs: Any - ) -> None: + def __init__(self, *, dns_servers: Optional[List[str]] = None, **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 + :keyword dns_servers: The list of DNS servers IP addresses. + :paramtype dns_servers: list[str] """ super().__init__(**kwargs) - self.streaming_data_client = streaming_data_client - self.eu_location = eu_location - self.episodic_data_upload = episodic_data_upload + self.dns_servers = dns_servers -class Offer(ProxyResource): - """Offer details. +class LogicalNetworks(TrackedResource): # pylint: disable=too-many-instance-attributes + """The logical network resource definition. 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 + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -3792,17 +3606,24 @@ class Offer(ProxyResource): :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] + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :ivar dhcp_options: DhcpOptions contains an array of DNS servers available to VMs deployed in + the logical network. Standard DHCP option for a subnet overrides logical network DHCP options. + :vartype dhcp_options: ~azure.mgmt.azurestackhci.models.LogicalNetworkPropertiesDhcpOptions + :ivar subnets: Subnet - list of subnets under the logical network. + :vartype subnets: list[~azure.mgmt.azurestackhci.models.Subnet] + :ivar provisioning_state: Provisioning state of the logical network. Known values are: + "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningStateEnum + :ivar vm_switch_name: name of the network switch to be used for VMs. + :vartype vm_switch_name: str + :ivar status: The observed state of logical networks. + :vartype status: ~azure.mgmt.azurestackhci.models.LogicalNetworkStatus """ _validation = { @@ -3810,7 +3631,9 @@ class Offer(ProxyResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, + "location": {"required": True}, "provisioning_state": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { @@ -3818,1900 +3641,1933 @@ class Offer(ProxyResource): "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"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "dhcp_options": {"key": "properties.dhcpOptions", "type": "LogicalNetworkPropertiesDhcpOptions"}, + "subnets": {"key": "properties.subnets", "type": "[Subnet]"}, "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]"}, + "vm_switch_name": {"key": "properties.vmSwitchName", "type": "str"}, + "status": {"key": "properties.status", "type": "LogicalNetworkStatus"}, } def __init__( self, *, - publisher_id: Optional[str] = None, - content: Optional[str] = None, - content_version: Optional[str] = None, - sku_mappings: Optional[List["_models.SkuMappings"]] = None, + location: str, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + dhcp_options: Optional["_models.LogicalNetworkPropertiesDhcpOptions"] = None, + subnets: Optional[List["_models.Subnet"]] = None, + vm_switch_name: Optional[str] = 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] + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword extended_location: The extendedLocation of the resource. + :paramtype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :keyword dhcp_options: DhcpOptions contains an array of DNS servers available to VMs deployed + in the logical network. Standard DHCP option for a subnet overrides logical network DHCP + options. + :paramtype dhcp_options: ~azure.mgmt.azurestackhci.models.LogicalNetworkPropertiesDhcpOptions + :keyword subnets: Subnet - list of subnets under the logical network. + :paramtype subnets: list[~azure.mgmt.azurestackhci.models.Subnet] + :keyword vm_switch_name: name of the network switch to be used for VMs. + :paramtype vm_switch_name: str """ - super().__init__(**kwargs) + super().__init__(tags=tags, location=location, **kwargs) + self.extended_location = extended_location + self.dhcp_options = dhcp_options + self.subnets = subnets self.provisioning_state = None - self.publisher_id = publisher_id - self.content = content - self.content_version = content_version - self.sku_mappings = sku_mappings - + self.vm_switch_name = vm_switch_name + self.status = None -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. +class LogicalNetworksListResult(_serialization.Model): + """LogicalNetworksListResult. - :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. + :ivar value: + :vartype value: list[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :ivar next_link: :vartype next_link: str """ - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[Offer]"}, + "value": {"key": "value", "type": "[LogicalNetworks]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, value: Optional[List["_models.LogicalNetworks"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: + :paramtype value: list[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :keyword next_link: + :paramtype next_link: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None - + self.value = value + self.next_link = next_link -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. +class LogicalNetworkStatus(_serialization.Model): + """The observed state of logical networks. - :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 + :ivar error_code: LogicalNetwork provisioning error code. + :vartype error_code: str + :ivar error_message: Descriptive error message. + :vartype error_message: str + :ivar provisioning_status: + :vartype provisioning_status: + ~azure.mgmt.azurestackhci.models.LogicalNetworkStatusProvisioningStatus """ - _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"}, + "error_code": {"key": "errorCode", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "LogicalNetworkStatusProvisioningStatus"}, } - def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + provisioning_status: Optional["_models.LogicalNetworkStatusProvisioningStatus"] = None, + **kwargs: Any + ) -> None: """ - :keyword display: Localized display information for this particular operation. - :paramtype display: ~azure.mgmt.azurestackhci.models.OperationDisplay + :keyword error_code: LogicalNetwork provisioning error code. + :paramtype error_code: str + :keyword error_message: Descriptive error message. + :paramtype error_message: str + :keyword provisioning_status: + :paramtype provisioning_status: + ~azure.mgmt.azurestackhci.models.LogicalNetworkStatusProvisioningStatus """ super().__init__(**kwargs) - self.name = None - self.is_data_action = None - self.display = display - self.origin = None - self.action_type = None + self.error_code = error_code + self.error_message = error_message + self.provisioning_status = provisioning_status -class OperationDisplay(_serialization.Model): - """Localized display information for this particular operation. +class LogicalNetworkStatusProvisioningStatus(_serialization.Model): + """LogicalNetworkStatusProvisioningStatus. - 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}, - } + :ivar operation_id: The ID of the operation performed on the logical network. + :vartype operation_id: str + :ivar status: The status of the operation performed on the logical network [Succeeded, Failed, + InProgress]. 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 + """ _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, + "operation_id": {"key": "operationId", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + operation_id: Optional[str] = None, + status: Optional[Union[str, "_models.Status"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword operation_id: The ID of the operation performed on the logical network. + :paramtype operation_id: str + :keyword status: The status of the operation performed on the logical network [Succeeded, + Failed, InProgress]. 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 + """ super().__init__(**kwargs) - self.provider = None - self.resource = None - self.operation = None - self.description = None - + self.operation_id = operation_id + self.status = status -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. +class LogicalNetworksUpdateRequest(_serialization.Model): + """The logical network resource patch definition. - :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 + :ivar tags: Resource tags. + :vartype tags: dict[str, str] """ - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.tags = tags -class OptionalServices(_serialization.Model): - """The OptionalServices of AzureStackHCI Cluster. +class MarketplaceGalleryImages(TrackedResource): # pylint: disable=too-many-instance-attributes + """The marketplace gallery image resource definition. - :ivar custom_location: The name of custom location. - :vartype custom_location: str + 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. Ex - + /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 extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :ivar container_id: Storage ContainerID of the storage container to be used for marketplace + gallery image. + :vartype container_id: str + :ivar os_type: Operating system type that the gallery image uses [Windows, Linux]. Known values + are: "Windows" and "Linux". + :vartype os_type: str or ~azure.mgmt.azurestackhci.models.OperatingSystemTypes + :ivar cloud_init_data_source: Datasource for the gallery image when provisioning with + cloud-init [NoCloud, Azure]. Known values are: "NoCloud" and "Azure". + :vartype cloud_init_data_source: str or ~azure.mgmt.azurestackhci.models.CloudInitDataSource + :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine [V1, V2]. Known + values are: "V1" and "V2". + :vartype hyper_v_generation: str or ~azure.mgmt.azurestackhci.models.HyperVGeneration + :ivar identifier: This is the gallery image definition identifier. + :vartype identifier: ~azure.mgmt.azurestackhci.models.GalleryImageIdentifier + :ivar version: Specifies information about the gallery image version that you want to create or + update. + :vartype version: ~azure.mgmt.azurestackhci.models.GalleryImageVersion + :ivar provisioning_state: Provisioning state of the marketplace gallery image. Known values + are: "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningStateEnum + :ivar status: The observed state of marketplace gallery images. + :vartype status: ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImageStatus """ + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "status": {"readonly": True}, + } + _attribute_map = { - "custom_location": {"key": "customLocation", "type": "str"}, + "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"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "container_id": {"key": "properties.containerId", "type": "str"}, + "os_type": {"key": "properties.osType", "type": "str"}, + "cloud_init_data_source": {"key": "properties.cloudInitDataSource", "type": "str"}, + "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, + "identifier": {"key": "properties.identifier", "type": "GalleryImageIdentifier"}, + "version": {"key": "properties.version", "type": "GalleryImageVersion"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "status": {"key": "properties.status", "type": "MarketplaceGalleryImageStatus"}, } - def __init__(self, *, custom_location: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + container_id: Optional[str] = None, + os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, + cloud_init_data_source: Optional[Union[str, "_models.CloudInitDataSource"]] = None, + hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, + identifier: Optional["_models.GalleryImageIdentifier"] = None, + version: Optional["_models.GalleryImageVersion"] = None, + **kwargs: Any + ) -> None: """ - :keyword custom_location: The name of custom location. - :paramtype custom_location: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword extended_location: The extendedLocation of the resource. + :paramtype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :keyword container_id: Storage ContainerID of the storage container to be used for marketplace + gallery image. + :paramtype container_id: str + :keyword os_type: Operating system type that the gallery image uses [Windows, Linux]. Known + values are: "Windows" and "Linux". + :paramtype os_type: str or ~azure.mgmt.azurestackhci.models.OperatingSystemTypes + :keyword cloud_init_data_source: Datasource for the gallery image when provisioning with + cloud-init [NoCloud, Azure]. Known values are: "NoCloud" and "Azure". + :paramtype cloud_init_data_source: str or ~azure.mgmt.azurestackhci.models.CloudInitDataSource + :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine [V1, V2]. Known + values are: "V1" and "V2". + :paramtype hyper_v_generation: str or ~azure.mgmt.azurestackhci.models.HyperVGeneration + :keyword identifier: This is the gallery image definition identifier. + :paramtype identifier: ~azure.mgmt.azurestackhci.models.GalleryImageIdentifier + :keyword version: Specifies information about the gallery image version that you want to create + or update. + :paramtype version: ~azure.mgmt.azurestackhci.models.GalleryImageVersion """ - super().__init__(**kwargs) - self.custom_location = custom_location + super().__init__(tags=tags, location=location, **kwargs) + self.extended_location = extended_location + self.container_id = container_id + self.os_type = os_type + self.cloud_init_data_source = cloud_init_data_source + self.hyper_v_generation = hyper_v_generation + self.identifier = identifier + self.version = version + self.provisioning_state = None + self.status = None -class PackageVersionInfo(_serialization.Model): - """Current version of each updatable component. +class MarketplaceGalleryImagesListResult(_serialization.Model): + """MarketplaceGalleryImagesListResult. - :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 + :ivar value: + :vartype value: list[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :ivar next_link: + :vartype next_link: str """ _attribute_map = { - "package_type": {"key": "packageType", "type": "str"}, - "version": {"key": "version", "type": "str"}, - "last_updated": {"key": "lastUpdated", "type": "iso-8601"}, + "value": {"key": "value", "type": "[MarketplaceGalleryImages]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - package_type: Optional[str] = None, - version: Optional[str] = None, - last_updated: Optional[datetime.datetime] = None, + value: Optional[List["_models.MarketplaceGalleryImages"]] = None, + next_link: Optional[str] = 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 + :keyword value: + :paramtype value: list[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :keyword next_link: + :paramtype next_link: str """ super().__init__(**kwargs) - self.package_type = package_type - self.version = version - self.last_updated = last_updated + self.value = value + self.next_link = next_link -class PasswordCredential(_serialization.Model): - """PasswordCredential. +class MarketplaceGalleryImageStatus(_serialization.Model): + """The observed state of marketplace gallery images. - :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 + :ivar error_code: MarketplaceGalleryImage provisioning error code. + :vartype error_code: str + :ivar error_message: Descriptive error message. + :vartype error_message: str + :ivar provisioning_status: + :vartype provisioning_status: + ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImageStatusProvisioningStatus + :ivar download_status: The download status of the gallery image. + :vartype download_status: + ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImageStatusDownloadStatus + :ivar progress_percentage: The progress of the operation in percentage. + :vartype progress_percentage: int """ _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"}, + "error_code": {"key": "errorCode", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "MarketplaceGalleryImageStatusProvisioningStatus"}, + "download_status": {"key": "downloadStatus", "type": "MarketplaceGalleryImageStatusDownloadStatus"}, + "progress_percentage": {"key": "progressPercentage", "type": "int"}, } 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, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + provisioning_status: Optional["_models.MarketplaceGalleryImageStatusProvisioningStatus"] = None, + download_status: Optional["_models.MarketplaceGalleryImageStatusDownloadStatus"] = None, + progress_percentage: Optional[int] = 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 + :keyword error_code: MarketplaceGalleryImage provisioning error code. + :paramtype error_code: str + :keyword error_message: Descriptive error message. + :paramtype error_message: str + :keyword provisioning_status: + :paramtype provisioning_status: + ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImageStatusProvisioningStatus + :keyword download_status: The download status of the gallery image. + :paramtype download_status: + ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImageStatusDownloadStatus + :keyword progress_percentage: The progress of the operation in percentage. + :paramtype progress_percentage: int """ 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 - + self.error_code = error_code + self.error_message = error_message + self.provisioning_status = provisioning_status + self.download_status = download_status + self.progress_percentage = progress_percentage -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. +class MarketplaceGalleryImageStatusDownloadStatus(_serialization.Model): # pylint: disable=name-too-long + """The download status of the gallery image. - :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 + :ivar download_size_in_mb: The downloaded sized of the image in MB. + :vartype download_size_in_mb: int """ - _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"}, + "download_size_in_mb": {"key": "downloadSizeInMB", "type": "int"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, download_size_in_mb: Optional[int] = None, **kwargs: Any) -> None: + """ + :keyword download_size_in_mb: The downloaded sized of the image in MB. + :paramtype download_size_in_mb: int + """ super().__init__(**kwargs) - self.name = None - self.extension = None - self.type_handler_version = None - self.state = None - self.instance_view = None + self.download_size_in_mb = download_size_in_mb -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. +class MarketplaceGalleryImageStatusProvisioningStatus(_serialization.Model): # pylint: disable=name-too-long + """MarketplaceGalleryImageStatusProvisioningStatus. - :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 + :ivar operation_id: The ID of the operation performed on the gallery image. + :vartype operation_id: str + :ivar status: The status of the operation performed on the gallery image [Succeeded, Failed, + InProgress]. 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 """ - _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"}, + "operation_id": {"key": "operationId", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + operation_id: Optional[str] = None, + status: Optional[Union[str, "_models.Status"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword operation_id: The ID of the operation performed on the gallery image. + :paramtype operation_id: str + :keyword status: The status of the operation performed on the gallery image [Succeeded, Failed, + InProgress]. 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 + """ super().__init__(**kwargs) - self.session_start_time = None - self.session_end_time = None - self.node_name = None - self.duration = None - self.access_level = None + self.operation_id = operation_id + self.status = status -class PerNodeState(_serialization.Model): - """Status of Arc agent for a particular node in HCI Cluster. +class MarketplaceGalleryImagesUpdateRequest(_serialization.Model): + """The marketplace gallery image resource patch definition. - 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 name: Name of the Node in HCI Cluster. + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class NetworkInterfaces(TrackedResource): # pylint: disable=too-many-instance-attributes + """The network interface resource definition. + + 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. Ex - + /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 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 + :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 extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :ivar ip_configurations: IPConfigurations - A list of IPConfigurations of the network + interface. + :vartype ip_configurations: list[~azure.mgmt.azurestackhci.models.IPConfiguration] + :ivar mac_address: MacAddress - The MAC address of the network interface. + :vartype mac_address: str + :ivar dns_settings: DNS Settings for the interface. + :vartype dns_settings: ~azure.mgmt.azurestackhci.models.InterfaceDNSSettings + :ivar provisioning_state: Provisioning state of the network interface. Known values are: + "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningStateEnum + :ivar status: The observed state of network interfaces. + :vartype status: ~azure.mgmt.azurestackhci.models.NetworkInterfaceStatus """ _validation = { + "id": {"readonly": True}, "name": {"readonly": True}, - "arc_instance": {"readonly": True}, - "arc_node_service_principal_object_id": {"readonly": True}, - "state": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { + "id": {"key": "id", "type": "str"}, "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"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "ip_configurations": {"key": "properties.ipConfigurations", "type": "[IPConfiguration]"}, + "mac_address": {"key": "properties.macAddress", "type": "str"}, + "dns_settings": {"key": "properties.dnsSettings", "type": "InterfaceDNSSettings"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "status": {"key": "properties.status", "type": "NetworkInterfaceStatus"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + ip_configurations: Optional[List["_models.IPConfiguration"]] = None, + mac_address: Optional[str] = None, + dns_settings: Optional["_models.InterfaceDNSSettings"] = 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 extended_location: The extendedLocation of the resource. + :paramtype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :keyword ip_configurations: IPConfigurations - A list of IPConfigurations of the network + interface. + :paramtype ip_configurations: list[~azure.mgmt.azurestackhci.models.IPConfiguration] + :keyword mac_address: MacAddress - The MAC address of the network interface. + :paramtype mac_address: str + :keyword dns_settings: DNS Settings for the interface. + :paramtype dns_settings: ~azure.mgmt.azurestackhci.models.InterfaceDNSSettings + """ + super().__init__(tags=tags, location=location, **kwargs) + self.extended_location = extended_location + self.ip_configurations = ip_configurations + self.mac_address = mac_address + self.dns_settings = dns_settings + self.provisioning_state = None + self.status = None + + +class NetworkInterfacesListResult(_serialization.Model): + """NetworkInterfacesListResult. + + :ivar value: + :vartype value: list[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :ivar next_link: + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[NetworkInterfaces]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.NetworkInterfaces"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: + :paramtype value: list[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :keyword next_link: + :paramtype next_link: str + """ super().__init__(**kwargs) - self.name = None - self.arc_instance = None - self.arc_node_service_principal_object_id = None - self.state = None + self.value = value + self.next_link = next_link -class PhysicalNodes(_serialization.Model): - """The PhysicalNodes of a cluster. +class NetworkInterfaceStatus(_serialization.Model): + """The observed state of network interfaces. - :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 + :ivar error_code: NetworkInterface provisioning error code. + :vartype error_code: str + :ivar error_message: Descriptive error message. + :vartype error_message: str + :ivar provisioning_status: + :vartype provisioning_status: + ~azure.mgmt.azurestackhci.models.NetworkInterfaceStatusProvisioningStatus """ _attribute_map = { - "name": {"key": "name", "type": "str"}, - "ipv4_address": {"key": "ipv4Address", "type": "str"}, + "error_code": {"key": "errorCode", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "NetworkInterfaceStatusProvisioningStatus"}, } - def __init__(self, *, name: Optional[str] = None, ipv4_address: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + provisioning_status: Optional["_models.NetworkInterfaceStatusProvisioningStatus"] = 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 + :keyword error_code: NetworkInterface provisioning error code. + :paramtype error_code: str + :keyword error_message: Descriptive error message. + :paramtype error_message: str + :keyword provisioning_status: + :paramtype provisioning_status: + ~azure.mgmt.azurestackhci.models.NetworkInterfaceStatusProvisioningStatus """ super().__init__(**kwargs) - self.name = name - self.ipv4_address = ipv4_address + self.error_code = error_code + self.error_message = error_message + self.provisioning_status = provisioning_status -class PrecheckResult(_serialization.Model): # pylint: disable=too-many-instance-attributes - """PrecheckResult. +class NetworkInterfaceStatusProvisioningStatus(_serialization.Model): + """NetworkInterfaceStatusProvisioningStatus. - :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". + :ivar operation_id: The ID of the operation performed on the network interface. + :vartype operation_id: str + :ivar status: The status of the operation performed on the network interface [Succeeded, + Failed, InProgress]. 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"}, + "operation_id": {"key": "operationId", "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, + operation_id: 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". + :keyword operation_id: The ID of the operation performed on the network interface. + :paramtype operation_id: str + :keyword status: The status of the operation performed on the network interface [Succeeded, + Failed, InProgress]. 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.operation_id = operation_id 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. +class NetworkInterfacesUpdateRequest(_serialization.Model): + """The network interface resource patch definition. - :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 + :ivar tags: Resource tags. + :vartype tags: dict[str, str] """ _attribute_map = { - "key": {"key": "key", "type": "str"}, - "value": {"key": "value", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, key: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: + def __init__(self, *, tags: Optional[Dict[str, 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 + :keyword tags: Resource tags. + :paramtype tags: dict[str, 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 + self.tags = tags -class QosPolicyOverrides(_serialization.Model): - """The QoSPolicyOverrides of a cluster. +class NetworkProfileUpdate(_serialization.Model): + """NetworkProfile - describes the network update configuration the virtual machine instance. - :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 + :ivar network_interfaces: NetworkInterfaces - list of network interfaces to be attached to the + virtual machine instance. + :vartype network_interfaces: + list[~azure.mgmt.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem] """ _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"}, + "network_interfaces": {"key": "networkInterfaces", "type": "[NetworkProfileUpdateNetworkInterfacesItem]"}, } def __init__( self, *, - priority_value8021_action_cluster: Optional[str] = None, - priority_value8021_action_smb: Optional[str] = None, - bandwidth_percentage_smb: Optional[str] = None, + network_interfaces: Optional[List["_models.NetworkProfileUpdateNetworkInterfacesItem"]] = 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] + :keyword network_interfaces: NetworkInterfaces - list of network interfaces to be attached to + the virtual machine instance. + :paramtype network_interfaces: + list[~azure.mgmt.azurestackhci.models.NetworkProfileUpdateNetworkInterfacesItem] """ 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 + self.network_interfaces = network_interfaces -class RemoteSupportRequest(_serialization.Model): - """Remote Support Request. +class NetworkProfileUpdateNetworkInterfacesItem(_serialization.Model): # pylint: disable=name-too-long + """NetworkProfileUpdateNetworkInterfacesItem. - :ivar properties: Properties for Remote Support Request. - :vartype properties: ~azure.mgmt.azurestackhci.models.RemoteSupportRequestProperties + :ivar id: ID - Resource ID of the network interface. + :vartype id: str """ _attribute_map = { - "properties": {"key": "properties", "type": "RemoteSupportRequestProperties"}, + "id": {"key": "id", "type": "str"}, } - def __init__(self, *, properties: Optional["_models.RemoteSupportRequestProperties"] = None, **kwargs: Any) -> None: + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ - :keyword properties: Properties for Remote Support Request. - :paramtype properties: ~azure.mgmt.azurestackhci.models.RemoteSupportRequestProperties + :keyword id: ID - Resource ID of the network interface. + :paramtype id: str """ super().__init__(**kwargs) - self.properties = properties + self.id = id -class RemoteSupportRequestProperties(_serialization.Model): - """Properties for Remote Support Request. +class NicDetail(_serialization.Model): + """The NIC Detail of a device. - 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 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 adapter_name: Adapter Name of NIC. Required. + :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 """ _validation = { - "access_level": {"readonly": True}, + "adapter_name": {"required": True}, } _attribute_map = { - "access_level": {"key": "accessLevel", "type": "str"}, - "expiration_time_stamp": {"key": "expirationTimeStamp", "type": "iso-8601"}, - "remote_support_type": {"key": "remoteSupportType", "type": "str"}, + "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, *, - expiration_time_stamp: Optional[datetime.datetime] = None, - remote_support_type: Optional[Union[str, "_models.RemoteSupportType"]] = None, + adapter_name: str, + 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 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 + :keyword adapter_name: Adapter Name of NIC. Required. + :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.access_level = None - self.expiration_time_stamp = expiration_time_stamp - self.remote_support_type = remote_support_type + 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 SbeCredentials(_serialization.Model): - """secrets used for solution builder extension (SBE) partner extensibility. +class Observability(_serialization.Model): + """The Observability of AzureStackHCI Cluster. - :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 + :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 = { - "secret_name": {"key": "secretName", "type": "str"}, - "ece_secret_name": {"key": "eceSecretName", "type": "str"}, - "secret_location": {"key": "secretLocation", "type": "str"}, + "streaming_data_client": {"key": "streamingDataClient", "type": "bool"}, + "eu_location": {"key": "euLocation", "type": "bool"}, + "episodic_data_upload": {"key": "episodicDataUpload", "type": "bool"}, } def __init__( self, *, - secret_name: Optional[str] = None, - ece_secret_name: Optional[str] = None, - secret_location: Optional[str] = None, + streaming_data_client: bool = True, + eu_location: bool = False, + episodic_data_upload: bool = True, **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 + :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.secret_name = secret_name - self.ece_secret_name = ece_secret_name - self.secret_location = secret_location + self.streaming_data_client = streaming_data_client + self.eu_location = eu_location + self.episodic_data_upload = episodic_data_upload -class SbeDeploymentInfo(_serialization.Model): - """Solution builder extension (SBE) package and manifest information for the solution builder - extension staged for AzureStackHCI cluster deployment. +class Offer(ProxyResource): + """Offer details. - :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 + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 = { - "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"}, + "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, *, - 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, + 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 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 + :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.version = version - self.family = family - self.publisher = publisher - self.sbe_manifest_source = sbe_manifest_source - self.sbe_manifest_creation_date = sbe_manifest_creation_date + self.provisioning_state = None + self.publisher_id = publisher_id + self.content = content + self.content_version = content_version + self.sku_mappings = sku_mappings -class SbeDeploymentPackageInfo(_serialization.Model): - """Solution builder extension (SBE) deployment package information. +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 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 + :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 = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "sbe_manifest": {"readonly": True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "sbe_manifest": {"key": "sbeManifest", "type": "str"}, + "value": {"key": "value", "type": "[Offer]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.code = None - self.message = None - self.sbe_manifest = None + self.value = None + self.next_link = None + +class Operation(_serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. -class SbePartnerInfo(_serialization.Model): - """The solution builder extension (SBE) partner deployment info for cluster. + Variables are only populated by the server, and will be ignored when sending a request. - :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] + :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 = { - "sbe_deployment_info": {"key": "sbeDeploymentInfo", "type": "SbeDeploymentInfo"}, - "partner_properties": {"key": "partnerProperties", "type": "[SbePartnerProperties]"}, - "credential_list": {"key": "credentialList", "type": "[SbeCredentials]"}, + "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, - *, - sbe_deployment_info: Optional["_models.SbeDeploymentInfo"] = None, - partner_properties: Optional[List["_models.SbePartnerProperties"]] = None, - credential_list: Optional[List["_models.SbeCredentials"]] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, display: Optional["_models.OperationDisplay"] = 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] + :keyword display: Localized display information for this particular operation. + :paramtype display: ~azure.mgmt.azurestackhci.models.OperationDisplay """ super().__init__(**kwargs) - self.sbe_deployment_info = sbe_deployment_info - self.partner_properties = partner_properties - self.credential_list = credential_list + self.name = None + self.is_data_action = None + self.display = display + self.origin = None + self.action_type = None -class SbePartnerProperties(_serialization.Model): - """Solution builder extension (SBE) partner properties object. +class OperationDisplay(_serialization.Model): + """Localized display information for this particular operation. - :ivar name: SBE partner property name. - :vartype name: str - :ivar value: SBE partner property value. - :vartype value: str + 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 = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "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 - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.name = name - self.value = value + self.provider = None + self.resource = None + self.operation = None + self.description = None -class ScaleUnits(_serialization.Model): - """Scale units will contains list of deployment data. +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. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :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 + :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 = { - "deployment_data": {"required": True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - "deployment_data": {"key": "deploymentData", "type": "DeploymentData"}, - "sbe_partner_info": {"key": "sbePartnerInfo", "type": "SbePartnerInfo"}, + "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 OsProfileUpdate(_serialization.Model): + """OsProfile - describes the update configuration of the operating system. + + :ivar computer_name: ComputerName - name of the computer. + :vartype computer_name: str + :ivar linux_configuration: + :vartype linux_configuration: + ~azure.mgmt.azurestackhci.models.OsProfileUpdateLinuxConfiguration + :ivar windows_configuration: + :vartype windows_configuration: + ~azure.mgmt.azurestackhci.models.OsProfileUpdateWindowsConfiguration + """ + + _attribute_map = { + "computer_name": {"key": "computerName", "type": "str"}, + "linux_configuration": {"key": "linuxConfiguration", "type": "OsProfileUpdateLinuxConfiguration"}, + "windows_configuration": {"key": "windowsConfiguration", "type": "OsProfileUpdateWindowsConfiguration"}, } def __init__( self, *, - deployment_data: "_models.DeploymentData", - sbe_partner_info: Optional["_models.SbePartnerInfo"] = None, + computer_name: Optional[str] = None, + linux_configuration: Optional["_models.OsProfileUpdateLinuxConfiguration"] = None, + windows_configuration: Optional["_models.OsProfileUpdateWindowsConfiguration"] = 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 + :keyword computer_name: ComputerName - name of the computer. + :paramtype computer_name: str + :keyword linux_configuration: + :paramtype linux_configuration: + ~azure.mgmt.azurestackhci.models.OsProfileUpdateLinuxConfiguration + :keyword windows_configuration: + :paramtype windows_configuration: + ~azure.mgmt.azurestackhci.models.OsProfileUpdateWindowsConfiguration """ super().__init__(**kwargs) - self.deployment_data = deployment_data - self.sbe_partner_info = sbe_partner_info + self.computer_name = computer_name + self.linux_configuration = linux_configuration + self.windows_configuration = windows_configuration -class SdnIntegration(_serialization.Model): - """SDN Integration config to deploy AzureStackHCI Cluster. +class OsProfileUpdateLinuxConfiguration(_serialization.Model): + """OsProfileUpdateLinuxConfiguration. - :ivar network_controller: network controller config for SDN Integration to deploy AzureStackHCI - Cluster. - :vartype network_controller: ~azure.mgmt.azurestackhci.models.NetworkController + :ivar provision_vm_agent: Used to indicate whether Arc for Servers agent onboarding should be + triggered during the virtual machine instance creation process. + :vartype provision_vm_agent: bool + :ivar provision_vm_config_agent: Used to indicate whether the VM Config Agent should be + installed during the virtual machine creation process. + :vartype provision_vm_config_agent: bool """ _attribute_map = { - "network_controller": {"key": "networkController", "type": "NetworkController"}, + "provision_vm_agent": {"key": "provisionVMAgent", "type": "bool"}, + "provision_vm_config_agent": {"key": "provisionVMConfigAgent", "type": "bool"}, } - def __init__(self, *, network_controller: Optional["_models.NetworkController"] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + provision_vm_agent: Optional[bool] = None, + provision_vm_config_agent: Optional[bool] = 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 + :keyword provision_vm_agent: Used to indicate whether Arc for Servers agent onboarding should + be triggered during the virtual machine instance creation process. + :paramtype provision_vm_agent: bool + :keyword provision_vm_config_agent: Used to indicate whether the VM Config Agent should be + installed during the virtual machine creation process. + :paramtype provision_vm_config_agent: bool """ super().__init__(**kwargs) - self.network_controller = network_controller + self.provision_vm_agent = provision_vm_agent + self.provision_vm_config_agent = provision_vm_config_agent -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. +class OsProfileUpdateWindowsConfiguration(_serialization.Model): + """OsProfileUpdateWindowsConfiguration. - :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 + :ivar provision_vm_agent: Used to indicate whether Arc for Servers agent onboarding should be + triggered during the virtual machine instance creation process. + :vartype provision_vm_agent: bool + :ivar provision_vm_config_agent: Used to indicate whether the VM Config Agent should be + installed during the virtual machine creation process. + :vartype provision_vm_config_agent: bool """ - _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"}, + "provision_vm_agent": {"key": "provisionVMAgent", "type": "bool"}, + "provision_vm_config_agent": {"key": "provisionVMConfigAgent", "type": "bool"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + provision_vm_agent: Optional[bool] = None, + provision_vm_config_agent: Optional[bool] = None, + **kwargs: Any + ) -> None: + """ + :keyword provision_vm_agent: Used to indicate whether Arc for Servers agent onboarding should + be triggered during the virtual machine instance creation process. + :paramtype provision_vm_agent: bool + :keyword provision_vm_config_agent: Used to indicate whether the VM Config Agent should be + installed during the virtual machine creation process. + :paramtype provision_vm_config_agent: bool + """ 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 - + self.provision_vm_agent = provision_vm_agent + self.provision_vm_config_agent = provision_vm_config_agent -class SecuritySetting(ProxyResource): - """Security settings proxy resource. - Variables are only populated by the server, and will be ignored when sending a request. +class PackageVersionInfo(_serialization.Model): + """Current version of each updatable component. - :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 + :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 """ - _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"}, + "package_type": {"key": "packageType", "type": "str"}, + "version": {"key": "version", "type": "str"}, + "last_updated": {"key": "lastUpdated", "type": "iso-8601"}, } 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, + package_type: Optional[str] = None, + version: Optional[str] = None, + last_updated: Optional[datetime.datetime] = 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 + :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.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 - + self.package_type = package_type + self.version = version + self.last_updated = last_updated -class SecuritySettingListResult(_serialization.Model): - """The response of a SecuritySetting list operation. - All required parameters must be populated in order to send to server. +class PasswordCredential(_serialization.Model): + """PasswordCredential. - :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 + :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 """ - _validation = { - "value": {"required": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[SecuritySetting]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "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, *, value: List["_models.SecuritySetting"], next_link: Optional[str] = None, **kwargs: Any + 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 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 + :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.value = value - self.next_link = next_link + 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 ServiceConfiguration(_serialization.Model): - """Service configuration details. +class PerNodeExtensionState(_serialization.Model): + """Status of Arc Extension for a particular node in HCI Cluster. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :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 + :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 = { - "service_name": {"required": True}, - "port": {"required": True}, + "name": {"readonly": True}, + "extension": {"readonly": True}, + "type_handler_version": {"readonly": True}, + "state": {"readonly": True}, + "instance_view": {"readonly": True}, } _attribute_map = { - "service_name": {"key": "serviceName", "type": "str"}, - "port": {"key": "port", "type": "int"}, + "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, *, 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 - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.service_name = service_name - self.port = port + self.name = None + self.extension = None + self.type_handler_version = None + self.state = None + self.instance_view = None -class Sku(ProxyResource): - """Sku details. +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 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. + :ivar name: Name of the Node in HCI Cluster. :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] + :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 = { - "id": {"readonly": True}, "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } + "arc_instance": {"readonly": True}, + "arc_node_service_principal_object_id": {"readonly": True}, + "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]"}, + "arc_instance": {"key": "arcInstance", "type": "str"}, + "arc_node_service_principal_object_id": {"key": "arcNodeServicePrincipalObjectId", "type": "str"}, + "state": {"key": "state", "type": "str"}, } - 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] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ 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 - + self.name = None + self.arc_instance = None + self.arc_node_service_principal_object_id = None + self.state = None -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. +class PhysicalNodes(_serialization.Model): + """The PhysicalNodes of a cluster. - :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 + :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 """ - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[Sku]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "ipv4_address": {"key": "ipv4Address", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + 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.value = None - self.next_link = None + self.name = name + self.ipv4_address = ipv4_address -class SkuMappings(_serialization.Model): - """SKU Mapping details. +class PrecheckResult(_serialization.Model): # pylint: disable=too-many-instance-attributes + """PrecheckResult. - :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] + :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 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 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 = { - "catalog_plan_id": {"key": "catalogPlanId", "type": "str"}, - "marketplace_sku_id": {"key": "marketplaceSkuId", "type": "str"}, - "marketplace_sku_versions": {"key": "marketplaceSkuVersions", "type": "[str]"}, + "name": {"key": "name", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "tags": {"key": "tags", "type": "PrecheckResultTags"}, + "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"}, + "timestamp": {"key": "timestamp", "type": "iso-8601"}, + "additional_data": {"key": "additionalData", "type": "str"}, + "health_check_source": {"key": "healthCheckSource", "type": "str"}, } def __init__( self, *, - catalog_plan_id: Optional[str] = None, - marketplace_sku_id: Optional[str] = None, - marketplace_sku_versions: Optional[List[str]] = None, + name: Optional[str] = None, + display_name: Optional[str] = None, + tags: Optional["_models.PrecheckResultTags"] = 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, + timestamp: Optional[datetime.datetime] = None, + additional_data: Optional[str] = None, + health_check_source: Optional[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] + :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 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 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.catalog_plan_id = catalog_plan_id - self.marketplace_sku_id = marketplace_sku_id - self.marketplace_sku_versions = marketplace_sku_versions + self.name = name + self.display_name = display_name + self.tags = 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.timestamp = timestamp + self.additional_data = additional_data + self.health_check_source = health_check_source -class SoftwareAssuranceChangeRequest(_serialization.Model): - """SoftwareAssuranceChangeRequest. +class PrecheckResultTags(_serialization.Model): + """Key-value pairs that allow grouping/filtering individual tests. - :ivar properties: - :vartype properties: ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequestProperties + :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 = { - "properties": {"key": "properties", "type": "SoftwareAssuranceChangeRequestProperties"}, + "key": {"key": "key", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, *, properties: Optional["_models.SoftwareAssuranceChangeRequestProperties"] = None, **kwargs: Any - ) -> None: + def __init__(self, *, key: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword properties: - :paramtype properties: - ~azure.mgmt.azurestackhci.models.SoftwareAssuranceChangeRequestProperties + :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.properties = properties + self.key = key + self.value = value -class SoftwareAssuranceChangeRequestProperties(_serialization.Model): - """SoftwareAssuranceChangeRequestProperties. +class Publisher(ProxyResource): + """Publisher details. - :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 + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 = { - "software_assurance_intent": {"key": "softwareAssuranceIntent", "type": "str"}, + "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, - *, - 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 - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.software_assurance_intent = software_assurance_intent + self.provisioning_state = None -class SoftwareAssuranceProperties(_serialization.Model): - """Software Assurance properties of the cluster. +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 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 + :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 = { - "software_assurance_status": {"readonly": True}, - "last_updated": {"readonly": True}, + "value": {"readonly": True}, + "next_link": {"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"}, + "value": {"key": "value", "type": "[Publisher]"}, + "next_link": {"key": "nextLink", "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 - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.software_assurance_status = None - self.software_assurance_intent = software_assurance_intent - self.last_updated = None + self.value = None + self.next_link = None -class Step(_serialization.Model): - """Progress representation of the update run steps. +class QosPolicyOverrides(_serialization.Model): + """The QoSPolicyOverrides of a cluster. - :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] + :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 = { - "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]"}, + "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, *, - 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, + priority_value8021_action_cluster: Optional[str] = None, + priority_value8021_action_smb: Optional[str] = None, + bandwidth_percentage_smb: Optional[str] = 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] + :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.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 + 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 Storage(_serialization.Model): - """The Storage config of AzureStackHCI Cluster. +class RawCertificateData(_serialization.Model): + """RawCertificateData. - :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 + :ivar certificates: + :vartype certificates: list[str] """ _attribute_map = { - "configuration_mode": {"key": "configurationMode", "type": "str"}, + "certificates": {"key": "certificates", "type": "[str]"}, } - def __init__(self, *, configuration_mode: str = "Express", **kwargs: Any) -> None: + def __init__(self, *, certificates: Optional[List[str]] = None, **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 + :keyword certificates: + :paramtype certificates: list[str] """ super().__init__(**kwargs) - self.configuration_mode = configuration_mode + self.certificates = certificates -class SwitchDetail(_serialization.Model): - """List of switch details for edge device. +class ReportedProperties(_serialization.Model): + """The DeploymentStatus of AzureStackHCI Cluster. 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] + :ivar validation_status: validation status of AzureStackHCI Cluster Deployment. + :vartype validation_status: ~azure.mgmt.azurestackhci.models.ValidationStatus + :ivar deployment_status: Deployment status of AzureStackHCI Cluster Deployment. + :vartype deployment_status: ~azure.mgmt.azurestackhci.models.DeploymentStatus """ _validation = { - "switch_name": {"readonly": True}, - "switch_type": {"readonly": True}, - "extensions": {"readonly": True}, + "validation_status": {"readonly": True}, + "deployment_status": {"readonly": True}, } _attribute_map = { - "switch_name": {"key": "switchName", "type": "str"}, - "switch_type": {"key": "switchType", "type": "str"}, - "extensions": {"key": "extensions", "type": "[SwitchExtension]"}, + "validation_status": {"key": "validationStatus", "type": "ValidationStatus"}, + "deployment_status": {"key": "deploymentStatus", "type": "DeploymentStatus"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.switch_name = None - self.switch_type = None - self.extensions = None - + self.validation_status = None + self.deployment_status = 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. +class Route(_serialization.Model): + """Route - Route resource. - :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 + :ivar name: Name - name of the subnet. + :vartype name: str + :ivar address_prefix: The destination CIDR to which the route applies. + :vartype address_prefix: str + :ivar next_hop_ip_address: The IP address packets should be forwarded to. Next hop values are + only allowed in routes where the next hop type is VirtualAppliance. + :vartype next_hop_ip_address: str """ _validation = { - "switch_id": {"readonly": True}, - "extension_name": {"readonly": True}, - "extension_enabled": {"readonly": True}, + "name": {"pattern": r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$"}, } _attribute_map = { - "switch_id": {"key": "switchId", "type": "str"}, - "extension_name": {"key": "extensionName", "type": "str"}, - "extension_enabled": {"key": "extensionEnabled", "type": "bool"}, + "name": {"key": "name", "type": "str"}, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "next_hop_ip_address": {"key": "properties.nextHopIpAddress", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + name: Optional[str] = None, + address_prefix: Optional[str] = None, + next_hop_ip_address: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name - name of the subnet. + :paramtype name: str + :keyword address_prefix: The destination CIDR to which the route applies. + :paramtype address_prefix: str + :keyword next_hop_ip_address: The IP address packets should be forwarded to. Next hop values + are only allowed in routes where the next hop type is VirtualAppliance. + :paramtype next_hop_ip_address: str + """ super().__init__(**kwargs) - self.switch_id = None - self.extension_name = None - self.extension_enabled = None + self.name = name + self.address_prefix = address_prefix + self.next_hop_ip_address = next_hop_ip_address -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. +class RouteTable(_serialization.Model): + """Route table 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 + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar routes: Collection of routes contained within a route table. + :vartype routes: list[~azure.mgmt.azurestackhci.models.Route] """ - _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"}, + _validation = { + "etag": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } - 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: + _attribute_map = { + "etag": {"key": "etag", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "routes": {"key": "properties.routes", "type": "[Route]"}, + } + + def __init__(self, *, routes: Optional[List["_models.Route"]] = 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 + :keyword routes: Collection of routes contained within a route table. + :paramtype routes: list[~azure.mgmt.azurestackhci.models.Route] """ 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 + self.etag = None + self.name = None + self.type = None + self.routes = routes -class Update(ProxyResource): # pylint: disable=too-many-instance-attributes - """Update details. +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 + """ + + _validation = { + "deployment_data": {"required": True}, + } + + _attribute_map = { + "deployment_data": {"key": "deploymentData", "type": "DeploymentData"}, + } + + def __init__(self, *, deployment_data: "_models.DeploymentData", **kwargs: Any) -> None: + """ + :keyword deployment_data: Deployment Data to deploy AzureStackHCI Cluster. Required. + :paramtype deployment_data: ~azure.mgmt.azurestackhci.models.DeploymentData + """ + super().__init__(**kwargs) + self.deployment_data = deployment_data + + +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 + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 @@ -5721,69 +5577,17 @@ class Update(ProxyResource): # pylint: disable=too-many-instance-attributes :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". + :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 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 - :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 = { @@ -5791,7 +5595,7 @@ class Update(ProxyResource): # pylint: disable=too-many-instance-attributes "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, + "security_compliance_status": {"readonly": True}, } _attribute_map = { @@ -5799,674 +5603,3027 @@ class Update(ProxyResource): # pylint: disable=too-many-instance-attributes "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "location": {"key": "location", "type": "str"}, + "secured_core_compliance_assignment": {"key": "properties.securedCoreComplianceAssignment", "type": "str"}, + "security_compliance_status": { + "key": "properties.securityComplianceStatus", + "type": "SecurityComplianceStatus", + }, "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 + def __init__( 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, + secured_core_compliance_assignment: Optional[Union[str, "_models.ComplianceAssignmentType"]] = None, + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = 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 + :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 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.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. Ex - + /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 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 + :paramtype content_version: str + :keyword sku_mappings: Array of SKU mappings. + :paramtype sku_mappings: list[~azure.mgmt.azurestackhci.models.SkuMappings] """ 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 + 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 SshConfiguration(_serialization.Model): + """SSH configuration for Linux based VMs running on Azure. + + :ivar public_keys: The list of SSH public keys used to authenticate with linux based VMs. + :vartype public_keys: list[~azure.mgmt.azurestackhci.models.SshPublicKey] + """ + + _attribute_map = { + "public_keys": {"key": "publicKeys", "type": "[SshPublicKey]"}, + } + + def __init__(self, *, public_keys: Optional[List["_models.SshPublicKey"]] = None, **kwargs: Any) -> None: + """ + :keyword public_keys: The list of SSH public keys used to authenticate with linux based VMs. + :paramtype public_keys: list[~azure.mgmt.azurestackhci.models.SshPublicKey] + """ + super().__init__(**kwargs) + self.public_keys = public_keys + + +class SshPublicKey(_serialization.Model): + """Contains information about SSH certificate public key and the path on the Linux VM where the + public key is placed. + + :ivar path: Specifies the full path on the created VM where ssh public key is stored. If the + file already exists, the specified key is appended to the file. Example: + /home/user/.ssh/authorized_keys. + :vartype path: str + :ivar key_data: SSH public key certificate used to authenticate with the VM through ssh. The + key needs to be at least 2048-bit and in ssh-rsa format. :code:`
`:code:`
` For creating + ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in + Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + :vartype key_data: str + """ + + _attribute_map = { + "path": {"key": "path", "type": "str"}, + "key_data": {"key": "keyData", "type": "str"}, + } + + def __init__(self, *, path: Optional[str] = None, key_data: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword path: Specifies the full path on the created VM where ssh public key is stored. If the + file already exists, the specified key is appended to the file. Example: + /home/user/.ssh/authorized_keys. + :paramtype path: str + :keyword key_data: SSH public key certificate used to authenticate with the VM through ssh. The + key needs to be at least 2048-bit and in ssh-rsa format. :code:`
`:code:`
` For creating + ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in + Azure]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + :paramtype key_data: str + """ + super().__init__(**kwargs) + self.path = path + self.key_data = key_data + + +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 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"}, + "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, + 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 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.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 StorageContainers(TrackedResource): + """The storage container resource definition. + + 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. Ex - + /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 extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :ivar path: Path of the storage container on the disk. + :vartype path: str + :ivar provisioning_state: Provisioning state of the storage container. Known values are: + "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningStateEnum + :ivar status: The observed state of storage containers. + :vartype status: ~azure.mgmt.azurestackhci.models.StorageContainerStatus + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "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"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "path": {"key": "properties.path", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "status": {"key": "properties.status", "type": "StorageContainerStatus"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + path: Optional[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 + :keyword extended_location: The extendedLocation of the resource. + :paramtype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :keyword path: Path of the storage container on the disk. + :paramtype path: str + """ + super().__init__(tags=tags, location=location, **kwargs) + self.extended_location = extended_location + self.path = path + self.provisioning_state = None + self.status = None + + +class StorageContainersListResult(_serialization.Model): + """StorageContainersListResult. + + :ivar value: + :vartype value: list[~azure.mgmt.azurestackhci.models.StorageContainers] + :ivar next_link: + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[StorageContainers]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.StorageContainers"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: + :paramtype value: list[~azure.mgmt.azurestackhci.models.StorageContainers] + :keyword next_link: + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class StorageContainerStatus(_serialization.Model): + """The observed state of storage containers. + + :ivar error_code: StorageContainer provisioning error code. + :vartype error_code: str + :ivar error_message: Descriptive error message. + :vartype error_message: str + :ivar available_size_mb: Amount of space available on the disk in MB. + :vartype available_size_mb: int + :ivar container_size_mb: Total size of the disk in MB. + :vartype container_size_mb: int + :ivar provisioning_status: + :vartype provisioning_status: + ~azure.mgmt.azurestackhci.models.StorageContainerStatusProvisioningStatus + """ + + _attribute_map = { + "error_code": {"key": "errorCode", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "available_size_mb": {"key": "availableSizeMB", "type": "int"}, + "container_size_mb": {"key": "containerSizeMB", "type": "int"}, + "provisioning_status": {"key": "provisioningStatus", "type": "StorageContainerStatusProvisioningStatus"}, + } + + def __init__( + self, + *, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + available_size_mb: Optional[int] = None, + container_size_mb: Optional[int] = None, + provisioning_status: Optional["_models.StorageContainerStatusProvisioningStatus"] = None, + **kwargs: Any + ) -> None: + """ + :keyword error_code: StorageContainer provisioning error code. + :paramtype error_code: str + :keyword error_message: Descriptive error message. + :paramtype error_message: str + :keyword available_size_mb: Amount of space available on the disk in MB. + :paramtype available_size_mb: int + :keyword container_size_mb: Total size of the disk in MB. + :paramtype container_size_mb: int + :keyword provisioning_status: + :paramtype provisioning_status: + ~azure.mgmt.azurestackhci.models.StorageContainerStatusProvisioningStatus + """ + super().__init__(**kwargs) + self.error_code = error_code + self.error_message = error_message + self.available_size_mb = available_size_mb + self.container_size_mb = container_size_mb + self.provisioning_status = provisioning_status + + +class StorageContainerStatusProvisioningStatus(_serialization.Model): + """StorageContainerStatusProvisioningStatus. + + :ivar operation_id: The ID of the operation performed on the storage container. + :vartype operation_id: str + :ivar status: The status of the operation performed on the storage container [Succeeded, + Failed, InProgress]. 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 + """ + + _attribute_map = { + "operation_id": {"key": "operationId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__( + self, + *, + operation_id: Optional[str] = None, + status: Optional[Union[str, "_models.Status"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword operation_id: The ID of the operation performed on the storage container. + :paramtype operation_id: str + :keyword status: The status of the operation performed on the storage container [Succeeded, + Failed, InProgress]. 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 + """ + super().__init__(**kwargs) + self.operation_id = operation_id + self.status = status + + +class StorageContainersUpdateRequest(_serialization.Model): + """The storage container resource patch definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class StorageNetworks(_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 + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "network_adapter_name": {"key": "networkAdapterName", "type": "str"}, + "vlan_id": {"key": "vlanId", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + network_adapter_name: Optional[str] = None, + vlan_id: Optional[str] = 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 + """ + super().__init__(**kwargs) + self.name = name + self.network_adapter_name = network_adapter_name + self.vlan_id = vlan_id + + +class StorageProfileUpdate(_serialization.Model): + """StorageProfileUpdate. + + :ivar data_disks: adds data disks to the virtual machine instance for the update call. + :vartype data_disks: list[~azure.mgmt.azurestackhci.models.StorageProfileUpdateDataDisksItem] + """ + + _attribute_map = { + "data_disks": {"key": "dataDisks", "type": "[StorageProfileUpdateDataDisksItem]"}, + } + + def __init__( + self, *, data_disks: Optional[List["_models.StorageProfileUpdateDataDisksItem"]] = None, **kwargs: Any + ) -> None: + """ + :keyword data_disks: adds data disks to the virtual machine instance for the update call. + :paramtype data_disks: list[~azure.mgmt.azurestackhci.models.StorageProfileUpdateDataDisksItem] + """ + super().__init__(**kwargs) + self.data_disks = data_disks + + +class StorageProfileUpdateDataDisksItem(_serialization.Model): + """StorageProfileUpdateDataDisksItem. + + :ivar id: + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class Subnet(_serialization.Model): + """Subnet. + + :ivar name: Name - The name of the resource that is unique within a resource group. This name + can be used to access the resource. + :vartype name: str + :ivar address_prefix: The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6. + :vartype address_prefix: str + :ivar address_prefixes: List of address prefixes for the subnet. + :vartype address_prefixes: list[str] + :ivar ip_allocation_method: IPAllocationMethod - The IP address allocation method. Possible + values include: 'Static', 'Dynamic'. Known values are: "Dynamic" and "Static". + :vartype ip_allocation_method: str or ~azure.mgmt.azurestackhci.models.IpAllocationMethodEnum + :ivar ip_configuration_references: IPConfigurationReferences - list of + IPConfigurationReferences. + :vartype ip_configuration_references: + list[~azure.mgmt.azurestackhci.models.SubnetPropertiesFormatIpConfigurationReferencesItem] + :ivar route_table: Route table resource. + :vartype route_table: ~azure.mgmt.azurestackhci.models.RouteTable + :ivar ip_pools: network associated pool of IP Addresses. + :vartype ip_pools: list[~azure.mgmt.azurestackhci.models.IPPool] + :ivar vlan: Vlan to use for the subnet. + :vartype vlan: int + """ + + _validation = { + "name": {"pattern": r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$"}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "address_prefix": {"key": "properties.addressPrefix", "type": "str"}, + "address_prefixes": {"key": "properties.addressPrefixes", "type": "[str]"}, + "ip_allocation_method": {"key": "properties.ipAllocationMethod", "type": "str"}, + "ip_configuration_references": { + "key": "properties.ipConfigurationReferences", + "type": "[SubnetPropertiesFormatIpConfigurationReferencesItem]", + }, + "route_table": {"key": "properties.routeTable", "type": "RouteTable"}, + "ip_pools": {"key": "properties.ipPools", "type": "[IPPool]"}, + "vlan": {"key": "properties.vlan", "type": "int"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + address_prefix: Optional[str] = None, + address_prefixes: Optional[List[str]] = None, + ip_allocation_method: Optional[Union[str, "_models.IpAllocationMethodEnum"]] = None, + ip_configuration_references: Optional[ + List["_models.SubnetPropertiesFormatIpConfigurationReferencesItem"] + ] = None, + route_table: Optional["_models.RouteTable"] = None, + ip_pools: Optional[List["_models.IPPool"]] = None, + vlan: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name - The name of the resource that is unique within a resource group. This + name can be used to access the resource. + :paramtype name: str + :keyword address_prefix: The address prefix for the subnet: Cidr for this subnet - IPv4, IPv6. + :paramtype address_prefix: str + :keyword address_prefixes: List of address prefixes for the subnet. + :paramtype address_prefixes: list[str] + :keyword ip_allocation_method: IPAllocationMethod - The IP address allocation method. Possible + values include: 'Static', 'Dynamic'. Known values are: "Dynamic" and "Static". + :paramtype ip_allocation_method: str or ~azure.mgmt.azurestackhci.models.IpAllocationMethodEnum + :keyword ip_configuration_references: IPConfigurationReferences - list of + IPConfigurationReferences. + :paramtype ip_configuration_references: + list[~azure.mgmt.azurestackhci.models.SubnetPropertiesFormatIpConfigurationReferencesItem] + :keyword route_table: Route table resource. + :paramtype route_table: ~azure.mgmt.azurestackhci.models.RouteTable + :keyword ip_pools: network associated pool of IP Addresses. + :paramtype ip_pools: list[~azure.mgmt.azurestackhci.models.IPPool] + :keyword vlan: Vlan to use for the subnet. + :paramtype vlan: int + """ + super().__init__(**kwargs) + self.name = name + self.address_prefix = address_prefix + self.address_prefixes = address_prefixes + self.ip_allocation_method = ip_allocation_method + self.ip_configuration_references = ip_configuration_references + self.route_table = route_table + self.ip_pools = ip_pools + self.vlan = vlan + + +class SubnetPropertiesFormatIpConfigurationReferencesItem(_serialization.Model): # pylint: disable=name-too-long + """IPConfigurationReference - Describes a IPConfiguration under the virtual network. + + :ivar id: IPConfigurationID. + :vartype id: str + """ + + _attribute_map = { + "id": {"key": "ID", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: IPConfigurationID. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +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. Ex - + /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 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"}, + "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, + 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 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.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. Ex - + /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 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"}, + "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, + 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 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.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. Ex - + /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 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 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"}, + "hardware_model": {"key": "properties.hardwareModel", "type": "str"}, + "package_versions": {"key": "properties.packageVersions", "type": "[PackageVersionInfo]"}, + "current_version": {"key": "properties.currentVersion", "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, + hardware_model: Optional[str] = None, + package_versions: Optional[List["_models.PackageVersionInfo"]] = None, + current_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 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 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.hardware_model = hardware_model + self.package_versions = package_versions + self.current_version = current_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 + + +class ValidationStatus(_serialization.Model): + """The ValidationStatus of AzureStackHCI Cluster. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: Status of 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 VirtualHardDisks(TrackedResource): # pylint: disable=too-many-instance-attributes + """The virtual hard disk resource definition. + + 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. Ex - + /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 extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :ivar block_size_bytes: + :vartype block_size_bytes: int + :ivar disk_size_gb: Size of the disk in GB. + :vartype disk_size_gb: int + :ivar dynamic: Boolean for enabling dynamic sizing on the virtual hard disk. + :vartype dynamic: bool + :ivar logical_sector_bytes: + :vartype logical_sector_bytes: int + :ivar physical_sector_bytes: + :vartype physical_sector_bytes: int + :ivar hyper_v_generation: The hypervisor generation of the Virtual Machine [V1, V2]. Known + values are: "V1" and "V2". + :vartype hyper_v_generation: str or ~azure.mgmt.azurestackhci.models.HyperVGeneration + :ivar disk_file_format: The format of the actual VHD file [vhd, vhdx]. Known values are: "vhdx" + and "vhd". + :vartype disk_file_format: str or ~azure.mgmt.azurestackhci.models.DiskFileFormat + :ivar provisioning_state: Provisioning state of the virtual hard disk. Known values are: + "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningStateEnum + :ivar container_id: Storage ContainerID of the storage container to be used for VHD. + :vartype container_id: str + :ivar status: The observed state of virtual hard disks. + :vartype status: ~azure.mgmt.azurestackhci.models.VirtualHardDiskStatus + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "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"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "block_size_bytes": {"key": "properties.blockSizeBytes", "type": "int"}, + "disk_size_gb": {"key": "properties.diskSizeGB", "type": "int"}, + "dynamic": {"key": "properties.dynamic", "type": "bool"}, + "logical_sector_bytes": {"key": "properties.logicalSectorBytes", "type": "int"}, + "physical_sector_bytes": {"key": "properties.physicalSectorBytes", "type": "int"}, + "hyper_v_generation": {"key": "properties.hyperVGeneration", "type": "str"}, + "disk_file_format": {"key": "properties.diskFileFormat", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "container_id": {"key": "properties.containerId", "type": "str"}, + "status": {"key": "properties.status", "type": "VirtualHardDiskStatus"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + block_size_bytes: Optional[int] = None, + disk_size_gb: Optional[int] = None, + dynamic: Optional[bool] = None, + logical_sector_bytes: Optional[int] = None, + physical_sector_bytes: Optional[int] = None, + hyper_v_generation: Optional[Union[str, "_models.HyperVGeneration"]] = None, + disk_file_format: Optional[Union[str, "_models.DiskFileFormat"]] = None, + container_id: Optional[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 + :keyword extended_location: The extendedLocation of the resource. + :paramtype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :keyword block_size_bytes: + :paramtype block_size_bytes: int + :keyword disk_size_gb: Size of the disk in GB. + :paramtype disk_size_gb: int + :keyword dynamic: Boolean for enabling dynamic sizing on the virtual hard disk. + :paramtype dynamic: bool + :keyword logical_sector_bytes: + :paramtype logical_sector_bytes: int + :keyword physical_sector_bytes: + :paramtype physical_sector_bytes: int + :keyword hyper_v_generation: The hypervisor generation of the Virtual Machine [V1, V2]. Known + values are: "V1" and "V2". + :paramtype hyper_v_generation: str or ~azure.mgmt.azurestackhci.models.HyperVGeneration + :keyword disk_file_format: The format of the actual VHD file [vhd, vhdx]. Known values are: + "vhdx" and "vhd". + :paramtype disk_file_format: str or ~azure.mgmt.azurestackhci.models.DiskFileFormat + :keyword container_id: Storage ContainerID of the storage container to be used for VHD. + :paramtype container_id: str + """ + super().__init__(tags=tags, location=location, **kwargs) + self.extended_location = extended_location + self.block_size_bytes = block_size_bytes + self.disk_size_gb = disk_size_gb + self.dynamic = dynamic + self.logical_sector_bytes = logical_sector_bytes + self.physical_sector_bytes = physical_sector_bytes + self.hyper_v_generation = hyper_v_generation + self.disk_file_format = disk_file_format + self.provisioning_state = None + self.container_id = container_id + self.status = None + + +class VirtualHardDisksListResult(_serialization.Model): + """VirtualHardDisksListResult. + + :ivar value: + :vartype value: list[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :ivar next_link: + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualHardDisks]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VirtualHardDisks"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: + :paramtype value: list[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :keyword next_link: + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualHardDiskStatus(_serialization.Model): + """The observed state of virtual hard disks. + + :ivar error_code: VirtualHardDisk provisioning error code. + :vartype error_code: str + :ivar error_message: Descriptive error message. + :vartype error_message: str + :ivar provisioning_status: + :vartype provisioning_status: + ~azure.mgmt.azurestackhci.models.VirtualHardDiskStatusProvisioningStatus + """ + + _attribute_map = { + "error_code": {"key": "errorCode", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "VirtualHardDiskStatusProvisioningStatus"}, + } + + def __init__( + self, + *, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + provisioning_status: Optional["_models.VirtualHardDiskStatusProvisioningStatus"] = None, + **kwargs: Any + ) -> None: + """ + :keyword error_code: VirtualHardDisk provisioning error code. + :paramtype error_code: str + :keyword error_message: Descriptive error message. + :paramtype error_message: str + :keyword provisioning_status: + :paramtype provisioning_status: + ~azure.mgmt.azurestackhci.models.VirtualHardDiskStatusProvisioningStatus + """ + super().__init__(**kwargs) + self.error_code = error_code + self.error_message = error_message + self.provisioning_status = provisioning_status + + +class VirtualHardDiskStatusProvisioningStatus(_serialization.Model): + """VirtualHardDiskStatusProvisioningStatus. + + :ivar operation_id: The ID of the operation performed on the virtual hard disk. + :vartype operation_id: str + :ivar status: The status of the operation performed on the virtual hard disk [Succeeded, + Failed, InProgress]. 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 + """ + + _attribute_map = { + "operation_id": {"key": "operationId", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__( + self, + *, + operation_id: Optional[str] = None, + status: Optional[Union[str, "_models.Status"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword operation_id: The ID of the operation performed on the virtual hard disk. + :paramtype operation_id: str + :keyword status: The status of the operation performed on the virtual hard disk [Succeeded, + Failed, InProgress]. 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 + """ + super().__init__(**kwargs) + self.operation_id = operation_id + self.status = status + + +class VirtualHardDisksUpdateRequest(_serialization.Model): + """The virtual hard disk resource patch definition. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "tags": {"key": "tags", "type": "{str}"}, + } + + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags + + +class VirtualMachineConfigAgentInstanceView(_serialization.Model): + """The instance view of the VM Config Agent running on the virtual machine. + + :ivar vm_config_agent_version: The VM Config Agent full version. + :vartype vm_config_agent_version: str + :ivar statuses: The resource status information. + :vartype statuses: list[~azure.mgmt.azurestackhci.models.InstanceViewStatus] + """ + + _attribute_map = { + "vm_config_agent_version": {"key": "vmConfigAgentVersion", "type": "str"}, + "statuses": {"key": "statuses", "type": "[InstanceViewStatus]"}, + } + + def __init__( + self, + *, + vm_config_agent_version: Optional[str] = None, + statuses: Optional[List["_models.InstanceViewStatus"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword vm_config_agent_version: The VM Config Agent full version. + :paramtype vm_config_agent_version: str + :keyword statuses: The resource status information. + :paramtype statuses: list[~azure.mgmt.azurestackhci.models.InstanceViewStatus] + """ + super().__init__(**kwargs) + self.vm_config_agent_version = vm_config_agent_version + self.statuses = statuses + + +class VirtualMachineInstance(ProxyResource): # pylint: disable=too-many-instance-attributes + """The virtual machine instance resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /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 extended_location: The extendedLocation of the resource. + :vartype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.azurestackhci.models.Identity + :ivar hardware_profile: HardwareProfile - Specifies the hardware settings for the virtual + machine instance. + :vartype hardware_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfile + :ivar network_profile: NetworkProfile - describes the network configuration the virtual machine + instance. + :vartype network_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfile + :ivar os_profile: OsProfile - describes the configuration of the operating system and sets + login data. + :vartype os_profile: ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesOsProfile + :ivar security_profile: SecurityProfile - Specifies the security settings for the virtual + machine instance. + :vartype security_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfile + :ivar storage_profile: StorageProfile - contains information about the disks and storage + information for the virtual machine instance. + :vartype storage_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile + :ivar http_proxy_config: HTTP Proxy configuration for the VM. + :vartype http_proxy_config: ~azure.mgmt.azurestackhci.models.HttpProxyConfiguration + :ivar provisioning_state: Provisioning state of the virtual machine instance. Known values are: + "Succeeded", "Failed", "InProgress", "Accepted", "Deleting", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.azurestackhci.models.ProvisioningStateEnum + :ivar instance_view: The virtual machine instance view. + :vartype instance_view: ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceView + :ivar status: The observed state of virtual machine instances. + :vartype status: ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceStatus + :ivar guest_agent_install_status: Guest agent install status. + :vartype guest_agent_install_status: ~azure.mgmt.azurestackhci.models.GuestAgentInstallStatus + :ivar vm_id: Unique identifier for the vm resource. + :vartype vm_id: str + :ivar resource_uid: Unique identifier defined by ARC to identify the guest of the VM. + :vartype resource_uid: str + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "instance_view": {"readonly": True}, + "status": {"readonly": True}, + "vm_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"}, + "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, + "identity": {"key": "identity", "type": "Identity"}, + "hardware_profile": { + "key": "properties.hardwareProfile", + "type": "VirtualMachineInstancePropertiesHardwareProfile", + }, + "network_profile": { + "key": "properties.networkProfile", + "type": "VirtualMachineInstancePropertiesNetworkProfile", + }, + "os_profile": {"key": "properties.osProfile", "type": "VirtualMachineInstancePropertiesOsProfile"}, + "security_profile": { + "key": "properties.securityProfile", + "type": "VirtualMachineInstancePropertiesSecurityProfile", + }, + "storage_profile": { + "key": "properties.storageProfile", + "type": "VirtualMachineInstancePropertiesStorageProfile", + }, + "http_proxy_config": {"key": "properties.httpProxyConfig", "type": "HttpProxyConfiguration"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "instance_view": {"key": "properties.instanceView", "type": "VirtualMachineInstanceView"}, + "status": {"key": "properties.status", "type": "VirtualMachineInstanceStatus"}, + "guest_agent_install_status": {"key": "properties.guestAgentInstallStatus", "type": "GuestAgentInstallStatus"}, + "vm_id": {"key": "properties.vmId", "type": "str"}, + "resource_uid": {"key": "properties.resourceUid", "type": "str"}, + } + + def __init__( + self, + *, + extended_location: Optional["_models.ExtendedLocation"] = None, + identity: Optional["_models.Identity"] = None, + hardware_profile: Optional["_models.VirtualMachineInstancePropertiesHardwareProfile"] = None, + network_profile: Optional["_models.VirtualMachineInstancePropertiesNetworkProfile"] = None, + os_profile: Optional["_models.VirtualMachineInstancePropertiesOsProfile"] = None, + security_profile: Optional["_models.VirtualMachineInstancePropertiesSecurityProfile"] = None, + storage_profile: Optional["_models.VirtualMachineInstancePropertiesStorageProfile"] = None, + http_proxy_config: Optional["_models.HttpProxyConfiguration"] = None, + guest_agent_install_status: Optional["_models.GuestAgentInstallStatus"] = None, + resource_uid: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword extended_location: The extendedLocation of the resource. + :paramtype extended_location: ~azure.mgmt.azurestackhci.models.ExtendedLocation + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.azurestackhci.models.Identity + :keyword hardware_profile: HardwareProfile - Specifies the hardware settings for the virtual + machine instance. + :paramtype hardware_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfile + :keyword network_profile: NetworkProfile - describes the network configuration the virtual + machine instance. + :paramtype network_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfile + :keyword os_profile: OsProfile - describes the configuration of the operating system and sets + login data. + :paramtype os_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesOsProfile + :keyword security_profile: SecurityProfile - Specifies the security settings for the virtual + machine instance. + :paramtype security_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfile + :keyword storage_profile: StorageProfile - contains information about the disks and storage + information for the virtual machine instance. + :paramtype storage_profile: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfile + :keyword http_proxy_config: HTTP Proxy configuration for the VM. + :paramtype http_proxy_config: ~azure.mgmt.azurestackhci.models.HttpProxyConfiguration + :keyword guest_agent_install_status: Guest agent install status. + :paramtype guest_agent_install_status: ~azure.mgmt.azurestackhci.models.GuestAgentInstallStatus + :keyword resource_uid: Unique identifier defined by ARC to identify the guest of the VM. + :paramtype resource_uid: str + """ + super().__init__(**kwargs) + self.extended_location = extended_location + self.identity = identity + self.hardware_profile = hardware_profile + self.network_profile = network_profile + self.os_profile = os_profile + self.security_profile = security_profile + self.storage_profile = storage_profile + self.http_proxy_config = http_proxy_config + self.provisioning_state = None + self.instance_view = None + self.status = None + self.guest_agent_install_status = guest_agent_install_status + self.vm_id = None + self.resource_uid = resource_uid + + +class VirtualMachineInstanceListResult(_serialization.Model): + """VirtualMachineInstanceListResult. + + :ivar value: + :vartype value: list[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :ivar next_link: + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[VirtualMachineInstance]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.VirtualMachineInstance"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: + :paramtype value: list[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :keyword next_link: + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VirtualMachineInstancePropertiesHardwareProfile(_serialization.Model): # pylint: disable=name-too-long + """HardwareProfile - Specifies the hardware settings for the virtual machine instance. + + :ivar vm_size: Known values are: "Default", "Standard_A2_v2", "Standard_A4_v2", + "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", + "Standard_D32s_v3", "Standard_DS2_v2", "Standard_DS3_v2", "Standard_DS4_v2", "Standard_DS5_v2", + "Standard_DS13_v2", "Standard_K8S_v1", "Standard_K8S2_v1", "Standard_K8S3_v1", + "Standard_K8S4_v1", "Standard_NK6", "Standard_NK12", "Standard_NV6", "Standard_NV12", + "Standard_K8S5_v1", and "Custom". + :vartype vm_size: str or ~azure.mgmt.azurestackhci.models.VmSizeEnum + :ivar processors: number of processors for the virtual machine instance. + :vartype processors: int + :ivar memory_mb: RAM in MB for the virtual machine instance. + :vartype memory_mb: int + :ivar dynamic_memory_config: + :vartype dynamic_memory_config: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig + """ + + _attribute_map = { + "vm_size": {"key": "vmSize", "type": "str"}, + "processors": {"key": "processors", "type": "int"}, + "memory_mb": {"key": "memoryMB", "type": "int"}, + "dynamic_memory_config": { + "key": "dynamicMemoryConfig", + "type": "VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig", + }, + } + + def __init__( + self, + *, + vm_size: Optional[Union[str, "_models.VmSizeEnum"]] = None, + processors: Optional[int] = None, + memory_mb: Optional[int] = None, + dynamic_memory_config: Optional[ + "_models.VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig" + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword vm_size: Known values are: "Default", "Standard_A2_v2", "Standard_A4_v2", + "Standard_D2s_v3", "Standard_D4s_v3", "Standard_D8s_v3", "Standard_D16s_v3", + "Standard_D32s_v3", "Standard_DS2_v2", "Standard_DS3_v2", "Standard_DS4_v2", "Standard_DS5_v2", + "Standard_DS13_v2", "Standard_K8S_v1", "Standard_K8S2_v1", "Standard_K8S3_v1", + "Standard_K8S4_v1", "Standard_NK6", "Standard_NK12", "Standard_NV6", "Standard_NV12", + "Standard_K8S5_v1", and "Custom". + :paramtype vm_size: str or ~azure.mgmt.azurestackhci.models.VmSizeEnum + :keyword processors: number of processors for the virtual machine instance. + :paramtype processors: int + :keyword memory_mb: RAM in MB for the virtual machine instance. + :paramtype memory_mb: int + :keyword dynamic_memory_config: + :paramtype dynamic_memory_config: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig + """ + super().__init__(**kwargs) + self.vm_size = vm_size + self.processors = processors + self.memory_mb = memory_mb + self.dynamic_memory_config = dynamic_memory_config + + +class VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig( + _serialization.Model +): # pylint: disable=name-too-long + """VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig. + + :ivar maximum_memory_mb: + :vartype maximum_memory_mb: int + :ivar minimum_memory_mb: + :vartype minimum_memory_mb: int + :ivar target_memory_buffer: Defines the amount of extra memory that should be reserved for a + virtual machine instance at runtime, as a percentage of the total memory that the virtual + machine instance is thought to need. This only applies to virtual systems with dynamic memory + enabled. This property can be in the range of 5 to 2000. + :vartype target_memory_buffer: int + """ + + _attribute_map = { + "maximum_memory_mb": {"key": "maximumMemoryMB", "type": "int"}, + "minimum_memory_mb": {"key": "minimumMemoryMB", "type": "int"}, + "target_memory_buffer": {"key": "targetMemoryBuffer", "type": "int"}, + } + + def __init__( + self, + *, + maximum_memory_mb: Optional[int] = None, + minimum_memory_mb: Optional[int] = None, + target_memory_buffer: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword maximum_memory_mb: + :paramtype maximum_memory_mb: int + :keyword minimum_memory_mb: + :paramtype minimum_memory_mb: int + :keyword target_memory_buffer: Defines the amount of extra memory that should be reserved for a + virtual machine instance at runtime, as a percentage of the total memory that the virtual + machine instance is thought to need. This only applies to virtual systems with dynamic memory + enabled. This property can be in the range of 5 to 2000. + :paramtype target_memory_buffer: int + """ + super().__init__(**kwargs) + self.maximum_memory_mb = maximum_memory_mb + self.minimum_memory_mb = minimum_memory_mb + self.target_memory_buffer = target_memory_buffer + + +class VirtualMachineInstancePropertiesNetworkProfile(_serialization.Model): # pylint: disable=name-too-long + """NetworkProfile - describes the network configuration the virtual machine instance. + + :ivar network_interfaces: NetworkInterfaces - list of network interfaces to be attached to the + virtual machine instance. + :vartype network_interfaces: + list[~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem] + """ + + _attribute_map = { + "network_interfaces": { + "key": "networkInterfaces", + "type": "[VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem]", + }, + } + + def __init__( + self, + *, + network_interfaces: Optional[ + List["_models.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem"] + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_interfaces: NetworkInterfaces - list of network interfaces to be attached to + the virtual machine instance. + :paramtype network_interfaces: + list[~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem] + """ + super().__init__(**kwargs) + self.network_interfaces = network_interfaces -class UpdateList(_serialization.Model): - """List of Updates. - Variables are only populated by the server, and will be ignored when sending a request. +class VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem( + _serialization.Model +): # pylint: disable=name-too-long + """VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem. - :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 + :ivar id: ID - Resource Id of the network interface. + :vartype id: str """ - _validation = { - "next_link": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[Update]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "id": {"key": "id", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Update"]] = None, **kwargs: Any) -> None: + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ - :keyword value: List of Updates. - :paramtype value: list[~azure.mgmt.azurestackhci.models.Update] + :keyword id: ID - Resource Id of the network interface. + :paramtype id: str """ super().__init__(**kwargs) - self.value = value - self.next_link = None + self.id = id -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. +class VirtualMachineInstancePropertiesOsProfile(_serialization.Model): # pylint: disable=name-too-long + """OsProfile - describes the configuration of the operating system and sets login data. - :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 + :ivar admin_password: AdminPassword - admin password. + :vartype admin_password: str + :ivar admin_username: AdminUsername - admin username. + :vartype admin_username: str + :ivar computer_name: ComputerName - name of the compute. + :vartype computer_name: str + :ivar linux_configuration: LinuxConfiguration - linux specific configuration values for the + virtual machine instance. + :vartype linux_configuration: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesOsProfileLinuxConfiguration + :ivar windows_configuration: Windows Configuration for the virtual machine instance. + :vartype windows_configuration: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesOsProfileWindowsConfiguration """ _attribute_map = { - "update_type": {"key": "updateType", "type": "str"}, - "version": {"key": "version", "type": "str"}, - "package_name": {"key": "packageName", "type": "str"}, + "admin_password": {"key": "adminPassword", "type": "str"}, + "admin_username": {"key": "adminUsername", "type": "str"}, + "computer_name": {"key": "computerName", "type": "str"}, + "linux_configuration": { + "key": "linuxConfiguration", + "type": "VirtualMachineInstancePropertiesOsProfileLinuxConfiguration", + }, + "windows_configuration": { + "key": "windowsConfiguration", + "type": "VirtualMachineInstancePropertiesOsProfileWindowsConfiguration", + }, } def __init__( self, *, - update_type: Optional[str] = None, - version: Optional[str] = None, - package_name: Optional[str] = None, + admin_password: Optional[str] = None, + admin_username: Optional[str] = None, + computer_name: Optional[str] = None, + linux_configuration: Optional["_models.VirtualMachineInstancePropertiesOsProfileLinuxConfiguration"] = None, + windows_configuration: Optional["_models.VirtualMachineInstancePropertiesOsProfileWindowsConfiguration"] = 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 + :keyword admin_password: AdminPassword - admin password. + :paramtype admin_password: str + :keyword admin_username: AdminUsername - admin username. + :paramtype admin_username: str + :keyword computer_name: ComputerName - name of the compute. + :paramtype computer_name: str + :keyword linux_configuration: LinuxConfiguration - linux specific configuration values for the + virtual machine instance. + :paramtype linux_configuration: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesOsProfileLinuxConfiguration + :keyword windows_configuration: Windows Configuration for the virtual machine instance. + :paramtype windows_configuration: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesOsProfileWindowsConfiguration """ 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] + self.admin_password = admin_password + self.admin_username = admin_username + self.computer_name = computer_name + self.linux_configuration = linux_configuration + self.windows_configuration = windows_configuration + + +class VirtualMachineInstancePropertiesOsProfileLinuxConfiguration( + _serialization.Model +): # pylint: disable=name-too-long + """LinuxConfiguration - linux specific configuration values for the virtual machine instance. + + :ivar disable_password_authentication: DisablePasswordAuthentication - whether password + authentication should be disabled. + :vartype disable_password_authentication: bool + :ivar ssh: Specifies the ssh key configuration for a Linux OS. + :vartype ssh: ~azure.mgmt.azurestackhci.models.SshConfiguration + :ivar provision_vm_agent: Used to indicate whether Arc for Servers agent onboarding should be + triggered during the virtual machine instance creation process. + :vartype provision_vm_agent: bool + :ivar provision_vm_config_agent: Used to indicate whether the VM Config Agent should be + installed during the virtual machine creation process. + :vartype provision_vm_config_agent: bool """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, + _attribute_map = { + "disable_password_authentication": {"key": "disablePasswordAuthentication", "type": "bool"}, + "ssh": {"key": "ssh", "type": "SshConfiguration"}, + "provision_vm_agent": {"key": "provisionVMAgent", "type": "bool"}, + "provision_vm_config_agent": {"key": "provisionVMConfigAgent", "type": "bool"}, } + def __init__( + self, + *, + disable_password_authentication: Optional[bool] = None, + ssh: Optional["_models.SshConfiguration"] = None, + provision_vm_agent: bool = True, + provision_vm_config_agent: bool = True, + **kwargs: Any + ) -> None: + """ + :keyword disable_password_authentication: DisablePasswordAuthentication - whether password + authentication should be disabled. + :paramtype disable_password_authentication: bool + :keyword ssh: Specifies the ssh key configuration for a Linux OS. + :paramtype ssh: ~azure.mgmt.azurestackhci.models.SshConfiguration + :keyword provision_vm_agent: Used to indicate whether Arc for Servers agent onboarding should + be triggered during the virtual machine instance creation process. + :paramtype provision_vm_agent: bool + :keyword provision_vm_config_agent: Used to indicate whether the VM Config Agent should be + installed during the virtual machine creation process. + :paramtype provision_vm_config_agent: bool + """ + super().__init__(**kwargs) + self.disable_password_authentication = disable_password_authentication + self.ssh = ssh + self.provision_vm_agent = provision_vm_agent + self.provision_vm_config_agent = provision_vm_config_agent + + +class VirtualMachineInstancePropertiesOsProfileWindowsConfiguration( + _serialization.Model +): # pylint: disable=name-too-long + """Windows Configuration for the virtual machine instance. + + :ivar enable_automatic_updates: Whether to EnableAutomaticUpdates on the machine. + :vartype enable_automatic_updates: bool + :ivar ssh: Specifies the ssh key configuration for Windows OS. + :vartype ssh: ~azure.mgmt.azurestackhci.models.SshConfiguration + :ivar time_zone: TimeZone for the virtual machine instance. + :vartype time_zone: str + :ivar provision_vm_agent: Used to indicate whether Arc for Servers agent onboarding should be + triggered during the virtual machine instance creation process. + :vartype provision_vm_agent: bool + :ivar provision_vm_config_agent: Used to indicate whether the VM Config Agent should be + installed during the virtual machine creation process. + :vartype provision_vm_config_agent: bool + """ + _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]"}, + "enable_automatic_updates": {"key": "enableAutomaticUpdates", "type": "bool"}, + "ssh": {"key": "ssh", "type": "SshConfiguration"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "provision_vm_agent": {"key": "provisionVMAgent", "type": "bool"}, + "provision_vm_config_agent": {"key": "provisionVMConfigAgent", "type": "bool"}, } 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, + enable_automatic_updates: Optional[bool] = None, + ssh: Optional["_models.SshConfiguration"] = None, + time_zone: Optional[str] = None, + provision_vm_agent: bool = True, + provision_vm_config_agent: bool = True, **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] + :keyword enable_automatic_updates: Whether to EnableAutomaticUpdates on the machine. + :paramtype enable_automatic_updates: bool + :keyword ssh: Specifies the ssh key configuration for Windows OS. + :paramtype ssh: ~azure.mgmt.azurestackhci.models.SshConfiguration + :keyword time_zone: TimeZone for the virtual machine instance. + :paramtype time_zone: str + :keyword provision_vm_agent: Used to indicate whether Arc for Servers agent onboarding should + be triggered during the virtual machine instance creation process. + :paramtype provision_vm_agent: bool + :keyword provision_vm_config_agent: Used to indicate whether the VM Config Agent should be + installed during the virtual machine creation process. + :paramtype provision_vm_config_agent: bool """ 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 - + self.enable_automatic_updates = enable_automatic_updates + self.ssh = ssh + self.time_zone = time_zone + self.provision_vm_agent = provision_vm_agent + self.provision_vm_config_agent = provision_vm_config_agent -class UpdateRunList(_serialization.Model): - """List of Update runs. - Variables are only populated by the server, and will be ignored when sending a request. +class VirtualMachineInstancePropertiesSecurityProfile(_serialization.Model): # pylint: disable=name-too-long + """SecurityProfile - Specifies the security settings for the virtual machine instance. - :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 + :ivar enable_tpm: + :vartype enable_tpm: bool + :ivar uefi_settings: + :vartype uefi_settings: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfileUefiSettings + :ivar security_type: Specifies the SecurityType of the virtual machine. EnableTPM and + SecureBootEnabled must be set to true for SecurityType to function. Known values are: + "TrustedLaunch" and "ConfidentialVM". + :vartype security_type: str or ~azure.mgmt.azurestackhci.models.SecurityTypes """ - _validation = { - "next_link": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[UpdateRun]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "enable_tpm": {"key": "enableTPM", "type": "bool"}, + "uefi_settings": {"key": "uefiSettings", "type": "VirtualMachineInstancePropertiesSecurityProfileUefiSettings"}, + "security_type": {"key": "securityType", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.UpdateRun"]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + enable_tpm: bool = False, + uefi_settings: Optional["_models.VirtualMachineInstancePropertiesSecurityProfileUefiSettings"] = None, + security_type: Optional[Union[str, "_models.SecurityTypes"]] = None, + **kwargs: Any + ) -> None: """ - :keyword value: List of Update runs. - :paramtype value: list[~azure.mgmt.azurestackhci.models.UpdateRun] + :keyword enable_tpm: + :paramtype enable_tpm: bool + :keyword uefi_settings: + :paramtype uefi_settings: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesSecurityProfileUefiSettings + :keyword security_type: Specifies the SecurityType of the virtual machine. EnableTPM and + SecureBootEnabled must be set to true for SecurityType to function. Known values are: + "TrustedLaunch" and "ConfidentialVM". + :paramtype security_type: str or ~azure.mgmt.azurestackhci.models.SecurityTypes """ 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. + self.enable_tpm = enable_tpm + self.uefi_settings = uefi_settings + self.security_type = security_type - :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 + +class VirtualMachineInstancePropertiesSecurityProfileUefiSettings( + _serialization.Model +): # pylint: disable=name-too-long + """VirtualMachineInstancePropertiesSecurityProfileUefiSettings. + + :ivar secure_boot_enabled: Specifies whether secure boot should be enabled on the virtual + machine instance. + :vartype secure_boot_enabled: bool """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, + _attribute_map = { + "secure_boot_enabled": {"key": "secureBootEnabled", "type": "bool"}, } + def __init__(self, *, secure_boot_enabled: bool = False, **kwargs: Any) -> None: + """ + :keyword secure_boot_enabled: Specifies whether secure boot should be enabled on the virtual + machine instance. + :paramtype secure_boot_enabled: bool + """ + super().__init__(**kwargs) + self.secure_boot_enabled = secure_boot_enabled + + +class VirtualMachineInstancePropertiesStorageProfile(_serialization.Model): # pylint: disable=name-too-long + """StorageProfile - contains information about the disks and storage information for the virtual + machine instance. + + :ivar data_disks: adds data disks to the virtual machine instance. + :vartype data_disks: + list[~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileDataDisksItem] + :ivar image_reference: Which Image to use for the virtual machine instance. + :vartype image_reference: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileImageReference + :ivar os_disk: VHD to attach as OS disk. + :vartype os_disk: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileOsDisk + :ivar vm_config_storage_path_id: Id of the storage container that hosts the VM configuration + file. + :vartype vm_config_storage_path_id: str + """ + _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"}, + "data_disks": {"key": "dataDisks", "type": "[VirtualMachineInstancePropertiesStorageProfileDataDisksItem]"}, + "image_reference": { + "key": "imageReference", + "type": "VirtualMachineInstancePropertiesStorageProfileImageReference", + }, + "os_disk": {"key": "osDisk", "type": "VirtualMachineInstancePropertiesStorageProfileOsDisk"}, + "vm_config_storage_path_id": {"key": "vmConfigStoragePathId", "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, + data_disks: Optional[List["_models.VirtualMachineInstancePropertiesStorageProfileDataDisksItem"]] = None, + image_reference: Optional["_models.VirtualMachineInstancePropertiesStorageProfileImageReference"] = None, + os_disk: Optional["_models.VirtualMachineInstancePropertiesStorageProfileOsDisk"] = None, + vm_config_storage_path_id: Optional[str] = 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 + :keyword data_disks: adds data disks to the virtual machine instance. + :paramtype data_disks: + list[~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileDataDisksItem] + :keyword image_reference: Which Image to use for the virtual machine instance. + :paramtype image_reference: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileImageReference + :keyword os_disk: VHD to attach as OS disk. + :paramtype os_disk: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstancePropertiesStorageProfileOsDisk + :keyword vm_config_storage_path_id: Id of the storage container that hosts the VM configuration + file. + :paramtype vm_config_storage_path_id: str """ 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 + self.data_disks = data_disks + self.image_reference = image_reference + self.os_disk = os_disk + self.vm_config_storage_path_id = vm_config_storage_path_id -class UpdateSummariesList(_serialization.Model): - """List of Update Summaries. - - Variables are only populated by the server, and will be ignored when sending a request. +class VirtualMachineInstancePropertiesStorageProfileDataDisksItem( + _serialization.Model +): # pylint: disable=name-too-long + """VirtualMachineInstancePropertiesStorageProfileDataDisksItem. - :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 + :ivar id: Resource ID of the data disk. + :vartype id: str """ - _validation = { - "next_link": {"readonly": True}, + _attribute_map = { + "id": {"key": "id", "type": "str"}, } + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Resource ID of the data disk. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id = id + + +class VirtualMachineInstancePropertiesStorageProfileImageReference( + _serialization.Model +): # pylint: disable=name-too-long + """Which Image to use for the virtual machine instance. + + :ivar id: Resource ID of the image. + :vartype id: str + """ + _attribute_map = { - "value": {"key": "value", "type": "[UpdateSummaries]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "id": {"key": "id", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.UpdateSummaries"]] = None, **kwargs: Any) -> None: + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ - :keyword value: List of Update Summaries. - :paramtype value: list[~azure.mgmt.azurestackhci.models.UpdateSummaries] + :keyword id: Resource ID of the image. + :paramtype id: str """ super().__init__(**kwargs) - self.value = value - self.next_link = None + self.id = id -class UploadCertificateRequest(_serialization.Model): - """UploadCertificateRequest. +class VirtualMachineInstancePropertiesStorageProfileOsDisk(_serialization.Model): # pylint: disable=name-too-long + """VHD to attach as OS disk. - :ivar properties: - :vartype properties: ~azure.mgmt.azurestackhci.models.RawCertificateData + :ivar id: Resource ID of the OS disk. + :vartype id: str + :ivar os_type: This property allows you to specify the type of the OS that is included in the + disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** + **Linux.**. Known values are: "Windows" and "Linux". + :vartype os_type: str or ~azure.mgmt.azurestackhci.models.OperatingSystemTypes """ _attribute_map = { - "properties": {"key": "properties", "type": "RawCertificateData"}, + "id": {"key": "id", "type": "str"}, + "os_type": {"key": "osType", "type": "str"}, } - def __init__(self, *, properties: Optional["_models.RawCertificateData"] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + os_type: Optional[Union[str, "_models.OperatingSystemTypes"]] = None, + **kwargs: Any + ) -> None: """ - :keyword properties: - :paramtype properties: ~azure.mgmt.azurestackhci.models.RawCertificateData + :keyword id: Resource ID of the OS disk. + :paramtype id: str + :keyword os_type: This property allows you to specify the type of the OS that is included in + the disk if creating a VM from user-image or a specialized VHD. Possible values are: + **Windows,** **Linux.**. Known values are: "Windows" and "Linux". + :paramtype os_type: str or ~azure.mgmt.azurestackhci.models.OperatingSystemTypes """ super().__init__(**kwargs) - self.properties = properties + self.id = id + self.os_type = os_type -class UserAssignedIdentity(_serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. +class VirtualMachineInstanceStatus(_serialization.Model): + """The observed state of virtual machine instances. - :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 + :ivar error_code: VirtualMachine provisioning error code. + :vartype error_code: str + :ivar error_message: Descriptive error message. + :vartype error_message: str + :ivar power_state: The power state of the virtual machine instance. Known values are: + "Deallocated", "Deallocating", "Running", "Starting", "Stopped", "Stopping", and "Unknown". + :vartype power_state: str or ~azure.mgmt.azurestackhci.models.PowerStateEnum + :ivar provisioning_status: + :vartype provisioning_status: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceStatusProvisioningStatus """ - _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, + _attribute_map = { + "error_code": {"key": "errorCode", "type": "str"}, + "error_message": {"key": "errorMessage", "type": "str"}, + "power_state": {"key": "powerState", "type": "str"}, + "provisioning_status": {"key": "provisioningStatus", "type": "VirtualMachineInstanceStatusProvisioningStatus"}, } + def __init__( + self, + *, + error_code: Optional[str] = None, + error_message: Optional[str] = None, + power_state: Optional[Union[str, "_models.PowerStateEnum"]] = None, + provisioning_status: Optional["_models.VirtualMachineInstanceStatusProvisioningStatus"] = None, + **kwargs: Any + ) -> None: + """ + :keyword error_code: VirtualMachine provisioning error code. + :paramtype error_code: str + :keyword error_message: Descriptive error message. + :paramtype error_message: str + :keyword power_state: The power state of the virtual machine instance. Known values are: + "Deallocated", "Deallocating", "Running", "Starting", "Stopped", "Stopping", and "Unknown". + :paramtype power_state: str or ~azure.mgmt.azurestackhci.models.PowerStateEnum + :keyword provisioning_status: + :paramtype provisioning_status: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceStatusProvisioningStatus + """ + super().__init__(**kwargs) + self.error_code = error_code + self.error_message = error_message + self.power_state = power_state + self.provisioning_status = provisioning_status + + +class VirtualMachineInstanceStatusProvisioningStatus(_serialization.Model): # pylint: disable=name-too-long + """VirtualMachineInstanceStatusProvisioningStatus. + + :ivar operation_id: The ID of the operation performed on the virtual machine instance. + :vartype operation_id: str + :ivar status: The status of the operation performed on the virtual machine instance [Succeeded, + Failed, InProgress]. 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 + """ + _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, + "operation_id": {"key": "operationId", "type": "str"}, + "status": {"key": "status", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + operation_id: Optional[str] = None, + status: Optional[Union[str, "_models.Status"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword operation_id: The ID of the operation performed on the virtual machine instance. + :paramtype operation_id: str + :keyword status: The status of the operation performed on the virtual machine instance + [Succeeded, Failed, InProgress]. 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 + """ super().__init__(**kwargs) - self.principal_id = None - self.client_id = None - + self.operation_id = operation_id + self.status = status -class ValidateRequest(_serialization.Model): - """The validate request for Edge Device. - All required parameters must be populated in order to send to server. +class VirtualMachineInstanceUpdateProperties(_serialization.Model): + """Defines the resource properties for the update. - :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 + :ivar hardware_profile: HardwareProfile - Specifies the hardware settings for the virtual + machine instance. + :vartype hardware_profile: ~azure.mgmt.azurestackhci.models.HardwareProfileUpdate + :ivar storage_profile: + :vartype storage_profile: ~azure.mgmt.azurestackhci.models.StorageProfileUpdate + :ivar network_profile: NetworkProfile - describes the network update configuration the virtual + machine instance. + :vartype network_profile: ~azure.mgmt.azurestackhci.models.NetworkProfileUpdate + :ivar os_profile: OsProfile - describes the update configuration of the operating system. + :vartype os_profile: ~azure.mgmt.azurestackhci.models.OsProfileUpdate """ - _validation = { - "edge_device_ids": {"required": True}, + _attribute_map = { + "hardware_profile": {"key": "hardwareProfile", "type": "HardwareProfileUpdate"}, + "storage_profile": {"key": "storageProfile", "type": "StorageProfileUpdate"}, + "network_profile": {"key": "networkProfile", "type": "NetworkProfileUpdate"}, + "os_profile": {"key": "osProfile", "type": "OsProfileUpdate"}, } + def __init__( + self, + *, + hardware_profile: Optional["_models.HardwareProfileUpdate"] = None, + storage_profile: Optional["_models.StorageProfileUpdate"] = None, + network_profile: Optional["_models.NetworkProfileUpdate"] = None, + os_profile: Optional["_models.OsProfileUpdate"] = None, + **kwargs: Any + ) -> None: + """ + :keyword hardware_profile: HardwareProfile - Specifies the hardware settings for the virtual + machine instance. + :paramtype hardware_profile: ~azure.mgmt.azurestackhci.models.HardwareProfileUpdate + :keyword storage_profile: + :paramtype storage_profile: ~azure.mgmt.azurestackhci.models.StorageProfileUpdate + :keyword network_profile: NetworkProfile - describes the network update configuration the + virtual machine instance. + :paramtype network_profile: ~azure.mgmt.azurestackhci.models.NetworkProfileUpdate + :keyword os_profile: OsProfile - describes the update configuration of the operating system. + :paramtype os_profile: ~azure.mgmt.azurestackhci.models.OsProfileUpdate + """ + super().__init__(**kwargs) + self.hardware_profile = hardware_profile + self.storage_profile = storage_profile + self.network_profile = network_profile + self.os_profile = os_profile + + +class VirtualMachineInstanceUpdateRequest(_serialization.Model): + """The virtual machine instance resource patch definition. + + :ivar properties: Defines the resource properties for the update. + :vartype properties: ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceUpdateProperties + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.azurestackhci.models.Identity + """ + _attribute_map = { - "edge_device_ids": {"key": "edgeDeviceIds", "type": "[str]"}, - "additional_info": {"key": "additionalInfo", "type": "str"}, + "properties": {"key": "properties", "type": "VirtualMachineInstanceUpdateProperties"}, + "identity": {"key": "identity", "type": "Identity"}, } - def __init__(self, *, edge_device_ids: List[str], additional_info: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + properties: Optional["_models.VirtualMachineInstanceUpdateProperties"] = None, + identity: Optional["_models.Identity"] = 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 + :keyword properties: Defines the resource properties for the update. + :paramtype properties: ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceUpdateProperties + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.azurestackhci.models.Identity """ super().__init__(**kwargs) - self.edge_device_ids = edge_device_ids - self.additional_info = additional_info - + self.properties = properties + self.identity = identity -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. +class VirtualMachineInstanceView(_serialization.Model): + """The instance view of a virtual machine. - :ivar status: edge device validation status. - :vartype status: str + :ivar vm_agent: The VM Config Agent running on the virtual machine. + :vartype vm_agent: ~azure.mgmt.azurestackhci.models.VirtualMachineConfigAgentInstanceView """ - _validation = { - "status": {"readonly": True}, + _attribute_map = { + "vm_agent": {"key": "vmAgent", "type": "VirtualMachineConfigAgentInstanceView"}, } + def __init__( + self, *, vm_agent: Optional["_models.VirtualMachineConfigAgentInstanceView"] = None, **kwargs: Any + ) -> None: + """ + :keyword vm_agent: The VM Config Agent running on the virtual machine. + :paramtype vm_agent: ~azure.mgmt.azurestackhci.models.VirtualMachineConfigAgentInstanceView + """ + super().__init__(**kwargs) + self.vm_agent = vm_agent + + +class VirtualSwitchConfigurationOverrides(_serialization.Model): + """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 = { - "status": {"key": "status", "type": "str"}, + "enable_iov": {"key": "enableIov", "type": "str"}, + "load_balancing_algorithm": {"key": "loadBalancingAlgorithm", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + 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.status = None + self.enable_iov = enable_iov + self.load_balancing_algorithm = load_balancing_algorithm 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..2eed2d52b4ab 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 @@ -11,14 +11,24 @@ from ._deployment_settings_operations import DeploymentSettingsOperations from ._edge_devices_operations import EdgeDevicesOperations from ._extensions_operations import ExtensionsOperations +from ._gallery_images_operations import GalleryImagesOperations +from ._logical_networks_operations import LogicalNetworksOperations +from ._marketplace_gallery_images_operations import MarketplaceGalleryImagesOperations +from ._network_interfaces_operations import NetworkInterfacesOperations 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 ._storage_containers_operations import StorageContainersOperations from ._update_runs_operations import UpdateRunsOperations from ._update_summaries_operations import UpdateSummariesOperations from ._updates_operations import UpdatesOperations +from ._virtual_hard_disks_operations import VirtualHardDisksOperations +from ._virtual_machine_instances_operations import VirtualMachineInstancesOperations +from ._hybrid_identity_metadata_operations import HybridIdentityMetadataOperations +from ._guest_agent_operations import GuestAgentOperations +from ._guest_agents_operations import GuestAgentsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -30,14 +40,24 @@ "DeploymentSettingsOperations", "EdgeDevicesOperations", "ExtensionsOperations", + "GalleryImagesOperations", + "LogicalNetworksOperations", + "MarketplaceGalleryImagesOperations", + "NetworkInterfacesOperations", "OffersOperations", "Operations", "PublishersOperations", "SecuritySettingsOperations", "SkusOperations", + "StorageContainersOperations", "UpdateRunsOperations", "UpdateSummariesOperations", "UpdatesOperations", + "VirtualHardDisksOperations", + "VirtualMachineInstancesOperations", + "HybridIdentityMetadataOperations", + "GuestAgentOperations", + "GuestAgentsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _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 index 3bb5c547ac00..cc71b3deb7f7 100644 --- 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 @@ -50,7 +50,7 @@ def build_list_by_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_by_cluster_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -83,7 +83,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_get_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -117,7 +117,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -127,7 +127,7 @@ def build_create_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -154,7 +154,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -164,7 +164,7 @@ def build_update_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -191,7 +191,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +200,7 @@ def build_delete_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -225,7 +225,7 @@ def build_generate_password_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -234,7 +234,7 @@ def build_generate_password_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -259,7 +259,7 @@ def build_create_identity_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +268,7 @@ def build_create_identity_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -293,7 +293,7 @@ def build_consent_and_install_default_extensions_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -302,7 +302,7 @@ def build_consent_and_install_default_extensions_request( # pylint: disable=nam "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -327,7 +327,7 @@ def build_initialize_disable_process_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -336,7 +336,7 @@ def build_initialize_disable_process_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), 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 index 11118ad65e70..019627d8254a 100644 --- 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 @@ -48,13 +48,13 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_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", "2024-01-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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -72,7 +72,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_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", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/clusters", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -102,7 +102,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_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", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +111,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -135,7 +135,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +145,7 @@ def build_create_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -171,7 +171,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -181,7 +181,7 @@ def build_update_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -207,7 +207,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +216,7 @@ def build_delete_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -240,7 +240,7 @@ def build_upload_certificate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -250,7 +250,7 @@ def build_upload_certificate_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -276,7 +276,7 @@ def build_create_identity_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -285,7 +285,7 @@ def build_create_identity_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -309,7 +309,7 @@ def build_extend_software_assurance_benefit_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -319,79 +319,7 @@ def build_extend_software_assurance_benefit_request( # pylint: disable=name-too "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -1493,397 +1421,3 @@ def get_long_running_output(pipeline_response): 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 index c2e131079977..d72786ba31a7 100644 --- 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 @@ -50,7 +50,7 @@ def build_list_by_clusters_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_by_clusters_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -87,7 +87,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -127,7 +127,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,7 +137,7 @@ def build_create_or_update_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -170,7 +170,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +179,7 @@ def build_delete_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), 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 index 0024b796a4e7..1858f1f44d3d 100644 --- 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 @@ -48,7 +48,7 @@ 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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,7 @@ def build_get_request(resource_uri: str, edge_device_name: str = "default", **kw _headers = case_insensitive_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", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_create_or_update_request(resource_uri: str, edge_device_name: str = "d _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -125,7 +125,7 @@ def build_delete_request(resource_uri: str, edge_device_name: str = "default", * _headers = case_insensitive_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", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +150,7 @@ def build_validate_request(resource_uri: str, edge_device_name: str = "default", _headers = case_insensitive_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", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") 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 index 347c045fd2b9..a08a49e92da8 100644 --- 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 @@ -50,7 +50,7 @@ def build_list_by_arc_setting_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_by_arc_setting_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -89,7 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_get_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -129,7 +129,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -139,7 +139,7 @@ def build_create_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -172,7 +172,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -182,7 +182,7 @@ def build_update_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -215,7 +215,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -224,7 +224,7 @@ def build_delete_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -255,7 +255,7 @@ def build_upgrade_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -265,7 +265,7 @@ def build_upgrade_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_gallery_images_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_gallery_images_operations.py new file mode 100644 index 000000000000..37ce63ffd088 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_gallery_images_operations.py @@ -0,0 +1,1000 @@ +# 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_get_request( + resource_group_name: str, gallery_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", "2024-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "galleryImageName": _SERIALIZER.url( + "gallery_image_name", + gallery_image_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$", + ), + } + + _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, gallery_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", "2024-01-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/galleryImages/{galleryImageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "galleryImageName": _SERIALIZER.url( + "gallery_image_name", + gallery_image_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$", + ), + } + + _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, gallery_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", "2024-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages/{galleryImageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "galleryImageName": _SERIALIZER.url( + "gallery_image_name", + gallery_image_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$", + ), + } + + _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_update_request( + resource_group_name: str, gallery_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", "2024-01-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/galleryImages/{galleryImageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "galleryImageName": _SERIALIZER.url( + "gallery_image_name", + gallery_image_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$", + ), + } + + _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_list_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/galleryImages", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "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_list_all_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/galleryImages") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", 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) + + +class GalleryImagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`gallery_images` 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 get(self, resource_group_name: str, gallery_image_name: str, **kwargs: Any) -> _models.GalleryImages: + """Gets a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :return: GalleryImages or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.GalleryImages + :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.GalleryImages] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + gallery_image_name=gallery_image_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("GalleryImages", 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, + gallery_image_name: str, + gallery_images: Union[_models.GalleryImages, 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(gallery_images, (IOBase, bytes)): + _content = gallery_images + else: + _json = self._serialize.body(gallery_images, "GalleryImages") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + gallery_image_name=gallery_image_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_or_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: _models.GalleryImages, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GalleryImages]: + """The operation to create or update a gallery image. Please note some properties can be set only + during gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Required. + :type gallery_images: ~azure.mgmt.azurestackhci.models.GalleryImages + :keyword content_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 GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GalleryImages]: + """The operation to create or update a gallery image. Please note some properties can be set only + during gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Required. + :type gallery_images: 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 GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: Union[_models.GalleryImages, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.GalleryImages]: + """The operation to create or update a gallery image. Please note some properties can be set only + during gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Is either a GalleryImages type or a IO[bytes] type. Required. + :type gallery_images: ~azure.mgmt.azurestackhci.models.GalleryImages or IO[bytes] + :return: An instance of LROPoller that returns either GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :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.GalleryImages] = 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, + gallery_image_name=gallery_image_name, + gallery_images=gallery_images, + 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("GalleryImages", 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.GalleryImages].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GalleryImages]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, gallery_image_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, + gallery_image_name=gallery_image_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 [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["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, gallery_image_name: str, **kwargs: Any) -> LROPoller[None]: + """The operation to delete a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_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, + gallery_image_name=gallery_image_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 _update_initial( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: Union[_models.GalleryImagesUpdateRequest, 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(gallery_images, (IOBase, bytes)): + _content = gallery_images + else: + _json = self._serialize.body(gallery_images, "GalleryImagesUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + gallery_image_name=gallery_image_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_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: _models.GalleryImagesUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GalleryImages]: + """The operation to update a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Required. + :type gallery_images: ~azure.mgmt.azurestackhci.models.GalleryImagesUpdateRequest + :keyword content_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 GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GalleryImages]: + """The operation to update a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Required. + :type gallery_images: 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 GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + gallery_image_name: str, + gallery_images: Union[_models.GalleryImagesUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.GalleryImages]: + """The operation to update a gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param gallery_image_name: Name of the gallery image. Required. + :type gallery_image_name: str + :param gallery_images: Is either a GalleryImagesUpdateRequest type or a IO[bytes] type. + Required. + :type gallery_images: ~azure.mgmt.azurestackhci.models.GalleryImagesUpdateRequest or IO[bytes] + :return: An instance of LROPoller that returns either GalleryImages or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.GalleryImages] + :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.GalleryImages] = 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, + gallery_image_name=gallery_image_name, + gallery_images=gallery_images, + 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("GalleryImages", 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.GalleryImages].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GalleryImages]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.GalleryImages"]: + """Lists all of the gallery images in the specified resource group. Use the nextLink property in + the response to get the next page of gallery images. + + :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 GalleryImages or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.GalleryImages] + :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.GalleryImagesListResult] = 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, + 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("GalleryImagesListResult", 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_all(self, **kwargs: Any) -> Iterable["_models.GalleryImages"]: + """Lists all of the gallery images in the specified subscription. Use the nextLink property in the + response to get the next page of gallery images. + + :return: An iterator like instance of either GalleryImages or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.GalleryImages] + :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.GalleryImagesListResult] = 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_all_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("GalleryImagesListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_guest_agent_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_guest_agent_operations.py new file mode 100644 index 000000000000..af7ed5fa02e8 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_guest_agent_operations.py @@ -0,0 +1,485 @@ +# 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, Iterator, Optional, Type, TypeVar, Union, cast, overload + +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 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_create_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-01-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/virtualMachineInstances/default/guestAgents/default", + ) # pylint: disable=line-too-long + 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 + 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_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default", + ) # pylint: disable=line-too-long + 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_delete_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default", + ) # pylint: disable=line-too-long + 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class GuestAgentOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`guest_agent` 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 _create_initial( + self, resource_uri: str, body: Optional[Union[_models.GuestAgent, IO[bytes]]] = None, **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(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "GuestAgent") + else: + _json = None + + _request = build_create_request( + resource_uri=resource_uri, + 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_uri: str, + body: Optional[_models.GuestAgent] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GuestAgent]: + """Implements GuestAgent PUT method. + + Create Or Update GuestAgent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param body: Request payload. Default value is None. + :type body: ~azure.mgmt.azurestackhci.models.GuestAgent + :keyword content_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 GuestAgent or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.GuestAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_uri: str, + body: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.GuestAgent]: + """Implements GuestAgent PUT method. + + Create Or Update GuestAgent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param body: Request payload. Default value is None. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns either GuestAgent or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.GuestAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, resource_uri: str, body: Optional[Union[_models.GuestAgent, IO[bytes]]] = None, **kwargs: Any + ) -> LROPoller[_models.GuestAgent]: + """Implements GuestAgent PUT method. + + Create Or Update GuestAgent. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param body: Request payload. Is either a GuestAgent type or a IO[bytes] type. Default value is + None. + :type body: ~azure.mgmt.azurestackhci.models.GuestAgent or IO[bytes] + :return: An instance of LROPoller that returns either GuestAgent or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.GuestAgent] + :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.GuestAgent] = 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_uri=resource_uri, + body=body, + 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("GuestAgent", 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.GuestAgent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.GuestAgent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get(self, resource_uri: str, **kwargs: Any) -> _models.GuestAgent: + """Gets GuestAgent. + + Implements GuestAgent GET method. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: GuestAgent or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.GuestAgent + :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.GuestAgent] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_uri=resource_uri, + 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("GuestAgent", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial(self, resource_uri: 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_uri=resource_uri, + 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["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, **kwargs: Any) -> LROPoller[None]: + """Deleted an GuestAgent. + + Implements GuestAgent DELETE method. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: 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, + 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 diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_guest_agents_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_guest_agents_operations.py new file mode 100644 index 000000000000..618b7605705a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_guest_agents_operations.py @@ -0,0 +1,165 @@ +# 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_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents" + ) # pylint: disable=line-too-long + 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) + + +class GuestAgentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`guest_agents` 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.GuestAgent"]: + """Implements GET GuestAgent in a vm. + + Returns the list of GuestAgent of the given vm. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An iterator like instance of either GuestAgent or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.GuestAgent] + :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.GuestAgentList] = 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("GuestAgentList", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_hybrid_identity_metadata_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_hybrid_identity_metadata_operations.py new file mode 100644 index 000000000000..33dd118753f8 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_hybrid_identity_metadata_operations.py @@ -0,0 +1,248 @@ +# 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_get_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata/default", + ) # pylint: disable=line-too-long + 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_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata", + ) # pylint: disable=line-too-long + 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) + + +class HybridIdentityMetadataOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`hybrid_identity_metadata` 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 get(self, resource_uri: str, **kwargs: Any) -> _models.HybridIdentityMetadata: + """Gets HybridIdentityMetadata. + + Implements HybridIdentityMetadata GET method. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: HybridIdentityMetadata or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.HybridIdentityMetadata + :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.HybridIdentityMetadata] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_uri=resource_uri, + 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("HybridIdentityMetadata", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.HybridIdentityMetadata"]: + """Implements GET HybridIdentityMetadata in a vm. + + Returns the list of HybridIdentityMetadata of the given vm. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An iterator like instance of either HybridIdentityMetadata or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.HybridIdentityMetadata] + :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.HybridIdentityMetadataList] = 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("HybridIdentityMetadataList", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_logical_networks_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_logical_networks_operations.py new file mode 100644 index 000000000000..d4ed92dc3b84 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_logical_networks_operations.py @@ -0,0 +1,1003 @@ +# 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_get_request( + resource_group_name: str, logical_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "logicalNetworkName": _SERIALIZER.url( + "logical_network_name", + logical_network_name, + "str", + max_length=64, + min_length=2, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[_a-zA-Z0-9]$", + ), + } + + _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, logical_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-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/logicalNetworks/{logicalNetworkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "logicalNetworkName": _SERIALIZER.url( + "logical_network_name", + logical_network_name, + "str", + max_length=64, + min_length=2, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[_a-zA-Z0-9]$", + ), + } + + _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, logical_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks/{logicalNetworkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "logicalNetworkName": _SERIALIZER.url( + "logical_network_name", + logical_network_name, + "str", + max_length=64, + min_length=2, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[_a-zA-Z0-9]$", + ), + } + + _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_update_request( + resource_group_name: str, logical_network_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-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/logicalNetworks/{logicalNetworkName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "logicalNetworkName": _SERIALIZER.url( + "logical_network_name", + logical_network_name, + "str", + max_length=64, + min_length=2, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[_a-zA-Z0-9]$", + ), + } + + _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_list_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/logicalNetworks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "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_list_all_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/logicalNetworks" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", 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) + + +class LogicalNetworksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`logical_networks` 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 get(self, resource_group_name: str, logical_network_name: str, **kwargs: Any) -> _models.LogicalNetworks: + """get. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :return: LogicalNetworks or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.LogicalNetworks + :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.LogicalNetworks] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + logical_network_name=logical_network_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("LogicalNetworks", 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, + logical_network_name: str, + logical_networks: Union[_models.LogicalNetworks, 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(logical_networks, (IOBase, bytes)): + _content = logical_networks + else: + _json = self._serialize.body(logical_networks, "LogicalNetworks") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + logical_network_name=logical_network_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_or_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: _models.LogicalNetworks, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LogicalNetworks]: + """The operation to create or update a logical network. Please note some properties can be set + only during logical network creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Required. + :type logical_networks: ~azure.mgmt.azurestackhci.models.LogicalNetworks + :keyword content_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 LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LogicalNetworks]: + """The operation to create or update a logical network. Please note some properties can be set + only during logical network creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Required. + :type logical_networks: 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 LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: Union[_models.LogicalNetworks, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LogicalNetworks]: + """The operation to create or update a logical network. Please note some properties can be set + only during logical network creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Is either a LogicalNetworks type or a IO[bytes] type. Required. + :type logical_networks: ~azure.mgmt.azurestackhci.models.LogicalNetworks or IO[bytes] + :return: An instance of LROPoller that returns either LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :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.LogicalNetworks] = 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, + logical_network_name=logical_network_name, + logical_networks=logical_networks, + 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("LogicalNetworks", 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.LogicalNetworks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LogicalNetworks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, logical_network_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, + logical_network_name=logical_network_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 [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["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, logical_network_name: str, **kwargs: Any) -> LROPoller[None]: + """The operation to delete a logical network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_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, + logical_network_name=logical_network_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 _update_initial( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: Union[_models.LogicalNetworksUpdateRequest, 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(logical_networks, (IOBase, bytes)): + _content = logical_networks + else: + _json = self._serialize.body(logical_networks, "LogicalNetworksUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + logical_network_name=logical_network_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_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: _models.LogicalNetworksUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LogicalNetworks]: + """The operation to update a logical network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Required. + :type logical_networks: ~azure.mgmt.azurestackhci.models.LogicalNetworksUpdateRequest + :keyword content_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 LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LogicalNetworks]: + """The operation to update a logical network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Required. + :type logical_networks: 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 LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + logical_network_name: str, + logical_networks: Union[_models.LogicalNetworksUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LogicalNetworks]: + """The operation to update a logical network. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param logical_network_name: Name of the logical network. Required. + :type logical_network_name: str + :param logical_networks: Is either a LogicalNetworksUpdateRequest type or a IO[bytes] type. + Required. + :type logical_networks: ~azure.mgmt.azurestackhci.models.LogicalNetworksUpdateRequest or + IO[bytes] + :return: An instance of LROPoller that returns either LogicalNetworks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :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.LogicalNetworks] = 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, + logical_network_name=logical_network_name, + logical_networks=logical_networks, + 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("LogicalNetworks", 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.LogicalNetworks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LogicalNetworks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.LogicalNetworks"]: + """Lists all of the logical networks in the specified resource group. Use the nextLink property in + the response to get the next page of logical networks. + + :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 LogicalNetworks or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :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.LogicalNetworksListResult] = 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, + 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("LogicalNetworksListResult", 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_all(self, **kwargs: Any) -> Iterable["_models.LogicalNetworks"]: + """Lists all of the logical networks in the specified subscription. Use the nextLink property in + the response to get the next page of logical networks. + + :return: An iterator like instance of either LogicalNetworks or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.LogicalNetworks] + :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.LogicalNetworksListResult] = 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_all_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("LogicalNetworksListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_marketplace_gallery_images_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_marketplace_gallery_images_operations.py new file mode 100644 index 000000000000..823d7364bfb5 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_marketplace_gallery_images_operations.py @@ -0,0 +1,1020 @@ +# 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_get_request( + resource_group_name: str, marketplace_gallery_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", "2024-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "marketplaceGalleryImageName": _SERIALIZER.url( + "marketplace_gallery_image_name", + marketplace_gallery_image_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$", + ), + } + + _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, marketplace_gallery_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", "2024-01-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/marketplaceGalleryImages/{marketplaceGalleryImageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "marketplaceGalleryImageName": _SERIALIZER.url( + "marketplace_gallery_image_name", + marketplace_gallery_image_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$", + ), + } + + _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, marketplace_gallery_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", "2024-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/{marketplaceGalleryImageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "marketplaceGalleryImageName": _SERIALIZER.url( + "marketplace_gallery_image_name", + marketplace_gallery_image_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$", + ), + } + + _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_update_request( + resource_group_name: str, marketplace_gallery_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", "2024-01-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/marketplaceGalleryImages/{marketplaceGalleryImageName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "marketplaceGalleryImageName": _SERIALIZER.url( + "marketplace_gallery_image_name", + marketplace_gallery_image_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[a-zA-Z0-9]$", + ), + } + + _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_list_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "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_list_all_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages" + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", 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) + + +class MarketplaceGalleryImagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`marketplace_gallery_images` 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 get( + self, resource_group_name: str, marketplace_gallery_image_name: str, **kwargs: Any + ) -> _models.MarketplaceGalleryImages: + """Gets a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :return: MarketplaceGalleryImages or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages + :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.MarketplaceGalleryImages] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + marketplace_gallery_image_name=marketplace_gallery_image_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("MarketplaceGalleryImages", 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, + marketplace_gallery_image_name: str, + marketplace_gallery_images: Union[_models.MarketplaceGalleryImages, 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(marketplace_gallery_images, (IOBase, bytes)): + _content = marketplace_gallery_images + else: + _json = self._serialize.body(marketplace_gallery_images, "MarketplaceGalleryImages") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + marketplace_gallery_image_name=marketplace_gallery_image_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_or_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: _models.MarketplaceGalleryImages, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MarketplaceGalleryImages]: + """The operation to create or update a marketplace gallery image. Please note some properties can + be set only during marketplace gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Required. + :type marketplace_gallery_images: ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages + :keyword content_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 MarketplaceGalleryImages or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MarketplaceGalleryImages]: + """The operation to create or update a marketplace gallery image. Please note some properties can + be set only during marketplace gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Required. + :type marketplace_gallery_images: 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 MarketplaceGalleryImages or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: Union[_models.MarketplaceGalleryImages, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.MarketplaceGalleryImages]: + """The operation to create or update a marketplace gallery image. Please note some properties can + be set only during marketplace gallery image creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Is either a MarketplaceGalleryImages type or a IO[bytes] + type. Required. + :type marketplace_gallery_images: ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages or + IO[bytes] + :return: An instance of LROPoller that returns either MarketplaceGalleryImages or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :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.MarketplaceGalleryImages] = 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, + marketplace_gallery_image_name=marketplace_gallery_image_name, + marketplace_gallery_images=marketplace_gallery_images, + 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("MarketplaceGalleryImages", 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.MarketplaceGalleryImages].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MarketplaceGalleryImages]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, marketplace_gallery_image_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, + marketplace_gallery_image_name=marketplace_gallery_image_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 [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["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, marketplace_gallery_image_name: str, **kwargs: Any + ) -> LROPoller[None]: + """The operation to delete a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_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, + marketplace_gallery_image_name=marketplace_gallery_image_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 _update_initial( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: Union[_models.MarketplaceGalleryImagesUpdateRequest, 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(marketplace_gallery_images, (IOBase, bytes)): + _content = marketplace_gallery_images + else: + _json = self._serialize.body(marketplace_gallery_images, "MarketplaceGalleryImagesUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + marketplace_gallery_image_name=marketplace_gallery_image_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_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: _models.MarketplaceGalleryImagesUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MarketplaceGalleryImages]: + """The operation to update a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Required. + :type marketplace_gallery_images: + ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest + :keyword content_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 MarketplaceGalleryImages or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MarketplaceGalleryImages]: + """The operation to update a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Required. + :type marketplace_gallery_images: 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 MarketplaceGalleryImages or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + marketplace_gallery_image_name: str, + marketplace_gallery_images: Union[_models.MarketplaceGalleryImagesUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.MarketplaceGalleryImages]: + """The operation to update a marketplace gallery image. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param marketplace_gallery_image_name: Name of the marketplace gallery image. Required. + :type marketplace_gallery_image_name: str + :param marketplace_gallery_images: Is either a MarketplaceGalleryImagesUpdateRequest type or a + IO[bytes] type. Required. + :type marketplace_gallery_images: + ~azure.mgmt.azurestackhci.models.MarketplaceGalleryImagesUpdateRequest or IO[bytes] + :return: An instance of LROPoller that returns either MarketplaceGalleryImages or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :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.MarketplaceGalleryImages] = 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, + marketplace_gallery_image_name=marketplace_gallery_image_name, + marketplace_gallery_images=marketplace_gallery_images, + 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("MarketplaceGalleryImages", 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.MarketplaceGalleryImages].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MarketplaceGalleryImages]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.MarketplaceGalleryImages"]: + """Lists all of the marketplace gallery images in the specified resource group. Use the nextLink + property in the response to get the next page of marketplace gallery images. + + :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 MarketplaceGalleryImages or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :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.MarketplaceGalleryImagesListResult] = 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, + 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("MarketplaceGalleryImagesListResult", 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_all(self, **kwargs: Any) -> Iterable["_models.MarketplaceGalleryImages"]: + """Lists all of the marketplace gallery images in the specified subscription. Use the nextLink + property in the response to get the next page of marketplace gallery images. + + :return: An iterator like instance of either MarketplaceGalleryImages or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.MarketplaceGalleryImages] + :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.MarketplaceGalleryImagesListResult] = 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_all_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("MarketplaceGalleryImagesListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_network_interfaces_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_network_interfaces_operations.py new file mode 100644 index 000000000000..b08530795772 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_network_interfaces_operations.py @@ -0,0 +1,1003 @@ +# 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_get_request( + resource_group_name: str, network_interface_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkInterfaceName": _SERIALIZER.url( + "network_interface_name", + network_interface_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$", + ), + } + + _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, network_interface_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-01-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/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkInterfaceName": _SERIALIZER.url( + "network_interface_name", + network_interface_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$", + ), + } + + _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, network_interface_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkInterfaceName": _SERIALIZER.url( + "network_interface_name", + network_interface_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$", + ), + } + + _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_update_request( + resource_group_name: str, network_interface_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-01-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/networkInterfaces/{networkInterfaceName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkInterfaceName": _SERIALIZER.url( + "network_interface_name", + network_interface_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$", + ), + } + + _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_list_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/networkInterfaces", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "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_list_all_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/networkInterfaces" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", 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) + + +class NetworkInterfacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`network_interfaces` 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 get(self, resource_group_name: str, network_interface_name: str, **kwargs: Any) -> _models.NetworkInterfaces: + """Gets a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :return: NetworkInterfaces or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.NetworkInterfaces + :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.NetworkInterfaces] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_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("NetworkInterfaces", 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, + network_interface_name: str, + network_interfaces: Union[_models.NetworkInterfaces, 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(network_interfaces, (IOBase, bytes)): + _content = network_interfaces + else: + _json = self._serialize.body(network_interfaces, "NetworkInterfaces") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_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_or_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: _models.NetworkInterfaces, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterfaces]: + """The operation to create or update a network interface. Please note some properties can be set + only during network interface creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Required. + :type network_interfaces: ~azure.mgmt.azurestackhci.models.NetworkInterfaces + :keyword content_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 NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterfaces]: + """The operation to create or update a network interface. Please note some properties can be set + only during network interface creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Required. + :type network_interfaces: 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 NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: Union[_models.NetworkInterfaces, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkInterfaces]: + """The operation to create or update a network interface. Please note some properties can be set + only during network interface creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Is either a NetworkInterfaces type or a IO[bytes] type. Required. + :type network_interfaces: ~azure.mgmt.azurestackhci.models.NetworkInterfaces or IO[bytes] + :return: An instance of LROPoller that returns either NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :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.NetworkInterfaces] = 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, + network_interface_name=network_interface_name, + network_interfaces=network_interfaces, + 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("NetworkInterfaces", 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.NetworkInterfaces].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkInterfaces]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, network_interface_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, + network_interface_name=network_interface_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 [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["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, network_interface_name: str, **kwargs: Any) -> LROPoller[None]: + """The operation to delete a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_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, + network_interface_name=network_interface_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 _update_initial( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: Union[_models.NetworkInterfacesUpdateRequest, 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(network_interfaces, (IOBase, bytes)): + _content = network_interfaces + else: + _json = self._serialize.body(network_interfaces, "NetworkInterfacesUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + network_interface_name=network_interface_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_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: _models.NetworkInterfacesUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterfaces]: + """The operation to update a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Required. + :type network_interfaces: ~azure.mgmt.azurestackhci.models.NetworkInterfacesUpdateRequest + :keyword content_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 NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkInterfaces]: + """The operation to update a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Required. + :type network_interfaces: 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 NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + network_interface_name: str, + network_interfaces: Union[_models.NetworkInterfacesUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NetworkInterfaces]: + """The operation to update a network interface. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_interface_name: Name of the network interface. Required. + :type network_interface_name: str + :param network_interfaces: Is either a NetworkInterfacesUpdateRequest type or a IO[bytes] type. + Required. + :type network_interfaces: ~azure.mgmt.azurestackhci.models.NetworkInterfacesUpdateRequest or + IO[bytes] + :return: An instance of LROPoller that returns either NetworkInterfaces or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :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.NetworkInterfaces] = 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, + network_interface_name=network_interface_name, + network_interfaces=network_interfaces, + 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("NetworkInterfaces", 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.NetworkInterfaces].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkInterfaces]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkInterfaces"]: + """Lists all of the network interfaces in the specified resource group. Use the nextLink property + in the response to get the next page of network interfaces. + + :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 NetworkInterfaces or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :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.NetworkInterfacesListResult] = 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, + 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("NetworkInterfacesListResult", 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_all(self, **kwargs: Any) -> Iterable["_models.NetworkInterfaces"]: + """Lists all of the network interfaces in the specified subscription. Use the nextLink property in + the response to get the next page of network interfaces. + + :return: An iterator like instance of either NetworkInterfaces or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.NetworkInterfaces] + :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.NetworkInterfacesListResult] = 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_all_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("NetworkInterfacesListResult", 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) 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 index 245a00461fa3..09d23a1b47d1 100644 --- 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 @@ -51,7 +51,7 @@ def build_list_by_publisher_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -60,7 +60,7 @@ def build_list_by_publisher_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -87,7 +87,7 @@ def build_list_by_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_list_by_cluster_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -129,7 +129,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +138,7 @@ def build_get_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), 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..9ddb3062d073 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 @@ -41,7 +41,7 @@ def build_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", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL 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 index 80c1cb9f78be..5913e5eca090 100644 --- 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 @@ -45,7 +45,7 @@ def build_list_by_cluster_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +54,7 @@ def build_list_by_cluster_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -78,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +87,7 @@ def build_get_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), 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 index 50cdaf9b7be6..51e18e09f972 100644 --- 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 @@ -50,7 +50,7 @@ def build_list_by_clusters_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_by_clusters_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -87,7 +87,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +96,7 @@ def build_get_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -127,7 +127,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -137,7 +137,7 @@ def build_create_or_update_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -170,7 +170,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +179,7 @@ def build_delete_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), 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 index 952c762fb280..b721abb12dc4 100644 --- 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 @@ -52,7 +52,7 @@ def build_list_by_offer_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +61,7 @@ def build_list_by_offer_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -97,7 +97,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,7 +106,7 @@ def build_get_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_storage_containers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_storage_containers_operations.py new file mode 100644 index 000000000000..a704c6db8744 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_storage_containers_operations.py @@ -0,0 +1,1003 @@ +# 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_get_request( + resource_group_name: str, storage_container_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "storageContainerName": _SERIALIZER.url( + "storage_container_name", + storage_container_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$", + ), + } + + _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, storage_container_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-01-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/storageContainers/{storageContainerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "storageContainerName": _SERIALIZER.url( + "storage_container_name", + storage_container_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$", + ), + } + + _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, storage_container_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers/{storageContainerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "storageContainerName": _SERIALIZER.url( + "storage_container_name", + storage_container_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$", + ), + } + + _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_update_request( + resource_group_name: str, storage_container_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-01-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/storageContainers/{storageContainerName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "storageContainerName": _SERIALIZER.url( + "storage_container_name", + storage_container_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,78}[_a-zA-Z0-9]$", + ), + } + + _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_list_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/storageContainers", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "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_list_all_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/storageContainers" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", 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) + + +class StorageContainersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`storage_containers` 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 get(self, resource_group_name: str, storage_container_name: str, **kwargs: Any) -> _models.StorageContainers: + """Gets a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :return: StorageContainers or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.StorageContainers + :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.StorageContainers] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + storage_container_name=storage_container_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("StorageContainers", 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, + storage_container_name: str, + storage_containers: Union[_models.StorageContainers, 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(storage_containers, (IOBase, bytes)): + _content = storage_containers + else: + _json = self._serialize.body(storage_containers, "StorageContainers") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + storage_container_name=storage_container_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_or_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: _models.StorageContainers, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.StorageContainers]: + """The operation to create or update a storage container. Please note some properties can be set + only during storage container creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Required. + :type storage_containers: ~azure.mgmt.azurestackhci.models.StorageContainers + :keyword content_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 StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.StorageContainers]: + """The operation to create or update a storage container. Please note some properties can be set + only during storage container creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Required. + :type storage_containers: 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 StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: Union[_models.StorageContainers, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.StorageContainers]: + """The operation to create or update a storage container. Please note some properties can be set + only during storage container creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Is either a StorageContainers type or a IO[bytes] type. Required. + :type storage_containers: ~azure.mgmt.azurestackhci.models.StorageContainers or IO[bytes] + :return: An instance of LROPoller that returns either StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :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.StorageContainers] = 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, + storage_container_name=storage_container_name, + storage_containers=storage_containers, + 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("StorageContainers", 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.StorageContainers].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.StorageContainers]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, storage_container_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, + storage_container_name=storage_container_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 [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["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, storage_container_name: str, **kwargs: Any) -> LROPoller[None]: + """The operation to delete a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_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, + storage_container_name=storage_container_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 _update_initial( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: Union[_models.StorageContainersUpdateRequest, 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(storage_containers, (IOBase, bytes)): + _content = storage_containers + else: + _json = self._serialize.body(storage_containers, "StorageContainersUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + storage_container_name=storage_container_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_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: _models.StorageContainersUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.StorageContainers]: + """The operation to update a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Required. + :type storage_containers: ~azure.mgmt.azurestackhci.models.StorageContainersUpdateRequest + :keyword content_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 StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.StorageContainers]: + """The operation to update a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Required. + :type storage_containers: 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 StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + storage_container_name: str, + storage_containers: Union[_models.StorageContainersUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.StorageContainers]: + """The operation to update a storage container. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param storage_container_name: Name of the storage container. Required. + :type storage_container_name: str + :param storage_containers: Is either a StorageContainersUpdateRequest type or a IO[bytes] type. + Required. + :type storage_containers: ~azure.mgmt.azurestackhci.models.StorageContainersUpdateRequest or + IO[bytes] + :return: An instance of LROPoller that returns either StorageContainers or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.StorageContainers] + :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.StorageContainers] = 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, + storage_container_name=storage_container_name, + storage_containers=storage_containers, + 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("StorageContainers", 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.StorageContainers].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.StorageContainers]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.StorageContainers"]: + """Lists all of the storage containers in the specified resource group. Use the nextLink property + in the response to get the next page of storage containers. + + :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 StorageContainers or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.StorageContainers] + :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.StorageContainersListResult] = 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, + 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("StorageContainersListResult", 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_all(self, **kwargs: Any) -> Iterable["_models.StorageContainers"]: + """Lists all of the storage containers in the specified subscription. Use the nextLink property in + the response to get the next page of storage containers. + + :return: An iterator like instance of either StorageContainers or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.StorageContainers] + :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.StorageContainersListResult] = 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_all_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("StorageContainersListResult", 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) 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 index 7137c3a98f09..0c227b397596 100644 --- 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 @@ -50,7 +50,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -89,7 +89,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +98,7 @@ def build_delete_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -129,7 +129,7 @@ def build_put_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -139,7 +139,7 @@ def build_put_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -172,7 +172,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +181,7 @@ def build_get_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), 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 index e3d799cf5430..de95377eb05a 100644 --- 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 @@ -48,7 +48,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_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", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +57,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -81,7 +81,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +90,7 @@ def build_delete_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -112,7 +112,7 @@ def build_put_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_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", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -122,7 +122,7 @@ def build_put_request(resource_group_name: str, cluster_name: str, subscription_ "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -146,7 +146,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_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", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,7 +155,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), 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 index 8932dff5387c..132f961a5115 100644 --- 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 @@ -50,7 +50,7 @@ def build_post_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_post_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -82,7 +82,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_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", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +91,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -115,7 +115,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,7 +124,7 @@ def build_delete_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -149,7 +149,7 @@ def build_put_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,7 +159,7 @@ def build_put_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -186,7 +186,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +195,7 @@ def build_get_request( "/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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_virtual_hard_disks_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_virtual_hard_disks_operations.py new file mode 100644 index 000000000000..dcfa5f77bef7 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_virtual_hard_disks_operations.py @@ -0,0 +1,1003 @@ +# 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_get_request( + resource_group_name: str, virtual_hard_disk_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "virtualHardDiskName": _SERIALIZER.url( + "virtual_hard_disk_name", + virtual_hard_disk_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$", + ), + } + + _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, virtual_hard_disk_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-01-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/virtualHardDisks/{virtualHardDiskName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "virtualHardDiskName": _SERIALIZER.url( + "virtual_hard_disk_name", + virtual_hard_disk_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$", + ), + } + + _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, virtual_hard_disk_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "virtualHardDiskName": _SERIALIZER.url( + "virtual_hard_disk_name", + virtual_hard_disk_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$", + ), + } + + _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_update_request( + resource_group_name: str, virtual_hard_disk_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-01-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/virtualHardDisks/{virtualHardDiskName}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "virtualHardDiskName": _SERIALIZER.url( + "virtual_hard_disk_name", + virtual_hard_disk_name, + "str", + max_length=80, + min_length=1, + pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-._a-zA-Z0-9]{0,62}[a-zA-Z0-9]$", + ), + } + + _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_list_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "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_list_all_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.AzureStackHCI/virtualHardDisks" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", 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) + + +class VirtualHardDisksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`virtual_hard_disks` 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 get(self, resource_group_name: str, virtual_hard_disk_name: str, **kwargs: Any) -> _models.VirtualHardDisks: + """Gets a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :return: VirtualHardDisks or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.VirtualHardDisks + :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.VirtualHardDisks] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + virtual_hard_disk_name=virtual_hard_disk_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("VirtualHardDisks", 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, + virtual_hard_disk_name: str, + virtual_hard_disks: Union[_models.VirtualHardDisks, 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(virtual_hard_disks, (IOBase, bytes)): + _content = virtual_hard_disks + else: + _json = self._serialize.body(virtual_hard_disks, "VirtualHardDisks") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + virtual_hard_disk_name=virtual_hard_disk_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_or_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: _models.VirtualHardDisks, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHardDisks]: + """The operation to create or update a virtual hard disk. Please note some properties can be set + only during virtual hard disk creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Required. + :type virtual_hard_disks: ~azure.mgmt.azurestackhci.models.VirtualHardDisks + :keyword content_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 VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHardDisks]: + """The operation to create or update a virtual hard disk. Please note some properties can be set + only during virtual hard disk creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Required. + :type virtual_hard_disks: 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 VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: Union[_models.VirtualHardDisks, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualHardDisks]: + """The operation to create or update a virtual hard disk. Please note some properties can be set + only during virtual hard disk creation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Is either a VirtualHardDisks type or a IO[bytes] type. Required. + :type virtual_hard_disks: ~azure.mgmt.azurestackhci.models.VirtualHardDisks or IO[bytes] + :return: An instance of LROPoller that returns either VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :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.VirtualHardDisks] = 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, + virtual_hard_disk_name=virtual_hard_disk_name, + virtual_hard_disks=virtual_hard_disks, + 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("VirtualHardDisks", 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.VirtualHardDisks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualHardDisks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, virtual_hard_disk_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, + virtual_hard_disk_name=virtual_hard_disk_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 [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["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, virtual_hard_disk_name: str, **kwargs: Any) -> LROPoller[None]: + """The operation to delete a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_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, + virtual_hard_disk_name=virtual_hard_disk_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 _update_initial( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: Union[_models.VirtualHardDisksUpdateRequest, 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(virtual_hard_disks, (IOBase, bytes)): + _content = virtual_hard_disks + else: + _json = self._serialize.body(virtual_hard_disks, "VirtualHardDisksUpdateRequest") + + _request = build_update_request( + resource_group_name=resource_group_name, + virtual_hard_disk_name=virtual_hard_disk_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_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: _models.VirtualHardDisksUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHardDisks]: + """The operation to update a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Required. + :type virtual_hard_disks: ~azure.mgmt.azurestackhci.models.VirtualHardDisksUpdateRequest + :keyword content_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 VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualHardDisks]: + """The operation to update a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Required. + :type virtual_hard_disks: 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 VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + virtual_hard_disk_name: str, + virtual_hard_disks: Union[_models.VirtualHardDisksUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualHardDisks]: + """The operation to update a virtual hard disk. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_hard_disk_name: Name of the virtual hard disk. Required. + :type virtual_hard_disk_name: str + :param virtual_hard_disks: Is either a VirtualHardDisksUpdateRequest type or a IO[bytes] type. + Required. + :type virtual_hard_disks: ~azure.mgmt.azurestackhci.models.VirtualHardDisksUpdateRequest or + IO[bytes] + :return: An instance of LROPoller that returns either VirtualHardDisks or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :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.VirtualHardDisks] = 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, + virtual_hard_disk_name=virtual_hard_disk_name, + virtual_hard_disks=virtual_hard_disks, + 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("VirtualHardDisks", 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.VirtualHardDisks].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualHardDisks]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.VirtualHardDisks"]: + """Lists all of the virtual hard disks in the specified resource group. Use the nextLink property + in the response to get the next page of virtual hard disks. + + :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 VirtualHardDisks or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :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.VirtualHardDisksListResult] = 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, + 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("VirtualHardDisksListResult", 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_all(self, **kwargs: Any) -> Iterable["_models.VirtualHardDisks"]: + """Lists all of the virtual hard disks in the specified subscription. Use the nextLink property in + the response to get the next page of virtual hard disks. + + :return: An iterator like instance of either VirtualHardDisks or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.VirtualHardDisks] + :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.VirtualHardDisksListResult] = 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_all_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("VirtualHardDisksListResult", 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) diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_virtual_machine_instances_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_virtual_machine_instances_operations.py new file mode 100644 index 000000000000..18005c9e6222 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/azure/mgmt/azurestackhci/operations/_virtual_machine_instances_operations.py @@ -0,0 +1,1208 @@ +# 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_get_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default" + ) + 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_create_or_update_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-01-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/virtualMachineInstances/default" + ) + 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 + 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, **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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default" + ) + 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_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-01-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/virtualMachineInstances/default" + ) + 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 + 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_start_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/start" + ) # pylint: disable=line-too-long + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_stop_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/stop" + ) # pylint: disable=line-too-long + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restart_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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/restart" + ) # pylint: disable=line-too-long + 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="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +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-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/{resourceUri}/providers/Microsoft.AzureStackHCI/virtualMachineInstances") + 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) + + +class VirtualMachineInstancesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.azurestackhci.AzureStackHCIClient`'s + :attr:`virtual_machine_instances` 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 get(self, resource_uri: str, **kwargs: Any) -> _models.VirtualMachineInstance: + """Gets a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: VirtualMachineInstance or the result of cls(response) + :rtype: ~azure.mgmt.azurestackhci.models.VirtualMachineInstance + :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.VirtualMachineInstance] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_uri=resource_uri, + 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("VirtualMachineInstance", 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, + virtual_machine_instance: Union[_models.VirtualMachineInstance, 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(virtual_machine_instance, (IOBase, bytes)): + _content = virtual_machine_instance + else: + _json = self._serialize.body(virtual_machine_instance, "VirtualMachineInstance") + + _request = build_create_or_update_request( + resource_uri=resource_uri, + 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_or_update( + self, + resource_uri: str, + virtual_machine_instance: _models.VirtualMachineInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualMachineInstance]: + """The operation to create or update a virtual machine instance. Please note some properties can + be set only during virtual machine instance creation. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Required. + :type virtual_machine_instance: ~azure.mgmt.azurestackhci.models.VirtualMachineInstance + :keyword content_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 VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_uri: str, + virtual_machine_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualMachineInstance]: + """The operation to create or update a virtual machine instance. Please note some properties can + be set only during virtual machine instance creation. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Required. + :type virtual_machine_instance: 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 VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_uri: str, + virtual_machine_instance: Union[_models.VirtualMachineInstance, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualMachineInstance]: + """The operation to create or update a virtual machine instance. Please note some properties can + be set only during virtual machine instance creation. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Is either a VirtualMachineInstance type or a IO[bytes] type. + Required. + :type virtual_machine_instance: ~azure.mgmt.azurestackhci.models.VirtualMachineInstance or + IO[bytes] + :return: An instance of LROPoller that returns either VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = 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, + virtual_machine_instance=virtual_machine_instance, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_uri: 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_uri=resource_uri, + 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["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, **kwargs: Any) -> LROPoller[None]: + """The operation to delete a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: 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, + 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 _update_initial( + self, + resource_uri: str, + virtual_machine_instance: Union[_models.VirtualMachineInstanceUpdateRequest, 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(virtual_machine_instance, (IOBase, bytes)): + _content = virtual_machine_instance + else: + _json = self._serialize.body(virtual_machine_instance, "VirtualMachineInstanceUpdateRequest") + + _request = build_update_request( + resource_uri=resource_uri, + 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_update( + self, + resource_uri: str, + virtual_machine_instance: _models.VirtualMachineInstanceUpdateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualMachineInstance]: + """The operation to update a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Required. + :type virtual_machine_instance: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceUpdateRequest + :keyword content_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 VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_uri: str, + virtual_machine_instance: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualMachineInstance]: + """The operation to update a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Required. + :type virtual_machine_instance: 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 VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_uri: str, + virtual_machine_instance: Union[_models.VirtualMachineInstanceUpdateRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualMachineInstance]: + """The operation to update a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :param virtual_machine_instance: Is either a VirtualMachineInstanceUpdateRequest type or a + IO[bytes] type. Required. + :type virtual_machine_instance: + ~azure.mgmt.azurestackhci.models.VirtualMachineInstanceUpdateRequest or IO[bytes] + :return: An instance of LROPoller that returns either VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = 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_uri=resource_uri, + virtual_machine_instance=virtual_machine_instance, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _start_initial(self, resource_uri: 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_start_request( + resource_uri=resource_uri, + 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["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_start(self, resource_uri: str, **kwargs: Any) -> LROPoller[_models.VirtualMachineInstance]: + """The operation to start a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An instance of LROPoller that returns either VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( + resource_uri=resource_uri, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _stop_initial(self, resource_uri: 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_stop_request( + resource_uri=resource_uri, + 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["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_stop(self, resource_uri: str, **kwargs: Any) -> LROPoller[_models.VirtualMachineInstance]: + """The operation to stop a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An instance of LROPoller that returns either VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = 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._stop_initial( + resource_uri=resource_uri, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _restart_initial(self, resource_uri: 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_restart_request( + resource_uri=resource_uri, + 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["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_restart(self, resource_uri: str, **kwargs: Any) -> LROPoller[_models.VirtualMachineInstance]: + """The operation to restart a virtual machine instance. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An instance of LROPoller that returns either VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstance] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._restart_initial( + resource_uri=resource_uri, + 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("VirtualMachineInstance", 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.VirtualMachineInstance].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualMachineInstance]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.VirtualMachineInstance"]: + """Lists all of the virtual machine instances within the specified parent resource. + + :param resource_uri: The fully qualified Azure Resource manager identifier of the Hybrid + Compute machine resource to be extended. Required. + :type resource_uri: str + :return: An iterator like instance of either VirtualMachineInstance or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.azurestackhci.models.VirtualMachineInstance] + :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.VirtualMachineInstanceListResult] = 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("VirtualMachineInstanceListResult", 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) 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..470402d8a3fa 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/consent_and_install_default_extensions.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ConsentAndInstallDefaultExtensions.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..084cf2f33781 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_arc_identity.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/CreateArcIdentity.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..b5fbb2399f5f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster.py @@ -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: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..b32e018a9bf3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_cluster_identity.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/CreateClusterIdentity.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateClusterIdentity.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_guest_agent.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_guest_agent.py new file mode 100644 index 000000000000..555b6f76929b --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_guest_agent.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) AutoRest 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 create_guest_agent.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.guest_agent.begin_create( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/CreateGuestAgent.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..423ba091f354 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_arc_setting.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteArcSetting.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..97ee564ba668 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_cluster.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..82822c47eba8 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_deployment_settings.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteDeploymentSettings.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..63aa33639f25 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 @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteEdgeDevices.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..b4d5e43c9329 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_extension.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteExtension.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_gallery_image.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_gallery_image.py new file mode 100644 index 000000000000..e25888dd5cc1 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_gallery_image.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) AutoRest 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 delete_gallery_image.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + client.gallery_images.begin_delete( + resource_group_name="test-rg", + gallery_image_name="test-gallery-image", + ).result() + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteGalleryImage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_guest_agent.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_guest_agent.py new file mode 100644 index 000000000000..79812802260c --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_guest_agent.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) AutoRest 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 delete_guest_agent.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.guest_agent.begin_delete( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + ).result() + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteGuestAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_logical_network.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_logical_network.py new file mode 100644 index 000000000000..7f5fb28c1bfb --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_logical_network.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) AutoRest 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 delete_logical_network.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + client.logical_networks.begin_delete( + resource_group_name="test-rg", + logical_network_name="test-lnet", + ).result() + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteLogicalNetwork.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_marketplace_gallery_image.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_marketplace_gallery_image.py new file mode 100644 index 000000000000..80d1adf22920 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_marketplace_gallery_image.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) AutoRest 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 delete_marketplace_gallery_image.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + client.marketplace_gallery_images.begin_delete( + resource_group_name="test-rg", + marketplace_gallery_image_name="test-marketplace-gallery-image", + ).result() + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteMarketplaceGalleryImage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_network_interface.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_network_interface.py new file mode 100644 index 000000000000..a4c277cde23b --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_network_interface.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) AutoRest 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 delete_network_interface.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + client.network_interfaces.begin_delete( + resource_group_name="test-rg", + network_interface_name="test-nic", + ).result() + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteNetworkInterface.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..64e0fff6a911 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_security_settings.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteSecuritySettings.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteSecuritySettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_storage_container.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_storage_container.py new file mode 100644 index 000000000000..7660f08a413a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_storage_container.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) AutoRest 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 delete_storage_container.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + client.storage_containers.begin_delete( + resource_group_name="test-rg", + storage_container_name="Default_Container", + ).result() + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteStorageContainer.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..c21b2e9e815e 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_runs.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteUpdateRuns.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..e08c29bb07bb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_update_summaries.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteUpdateSummaries.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..dc5b28b7b6e6 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_updates.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/DeleteUpdates.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_virtual_hard_disk.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_virtual_hard_disk.py new file mode 100644 index 000000000000..5420af0e2c5a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_virtual_hard_disk.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) AutoRest 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 delete_virtual_hard_disk.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + client.virtual_hard_disks.begin_delete( + resource_group_name="test-rg", + virtual_hard_disk_name="test-vhd", + ).result() + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteVirtualHardDisk.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_virtual_machine_instance.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_virtual_machine_instance.py new file mode 100644 index 000000000000..7272513b9a4f --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/delete_virtual_machine_instance.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) AutoRest 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 delete_virtual_machine_instance.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.virtual_machine_instances.begin_delete( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + ).result() + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/DeleteVirtualMachineInstance.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..b49601d4f72b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extend_software_assurance_benefit.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ExtendSoftwareAssuranceBenefit.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..a0d610c5d2e3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/extensions_upgrade.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/Extensions_Upgrade.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..b4cee4ceb668 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/generate_password.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GeneratePassword.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..347a55d64f1b 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_arc_setting.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetArcSetting.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..bb76d19edeba 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_cluster.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..a782f4f04249 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_deployment_settings.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetDeploymentSettings.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..eb5379284d88 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 @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetEdgeDevices.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..26964b55318f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_extension.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetExtension.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_gallery_image.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_gallery_image.py new file mode 100644 index 000000000000..a589bca460c1 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_gallery_image.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python get_gallery_image.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.gallery_images.get( + resource_group_name="test-rg", + gallery_image_name="test-gallery-image", + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetGalleryImage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_guest_agent.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_guest_agent.py new file mode 100644 index 000000000000..a07c68186ef2 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_guest_agent.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python get_guest_agent.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.guest_agent.get( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetGuestAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_hybrid_identity_metadata.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_hybrid_identity_metadata.py new file mode 100644 index 000000000000..041c67a0d416 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_hybrid_identity_metadata.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python get_hybrid_identity_metadata.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.hybrid_identity_metadata.get( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetHybridIdentityMetadata.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_logical_network.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_logical_network.py new file mode 100644 index 000000000000..9a27270d8801 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_logical_network.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python get_logical_network.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.logical_networks.get( + resource_group_name="test-rg", + logical_network_name="test-lnet", + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetLogicalNetwork.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_marketplace_gallery_image.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_marketplace_gallery_image.py new file mode 100644 index 000000000000..b9f1742c1d75 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_marketplace_gallery_image.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python get_marketplace_gallery_image.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.marketplace_gallery_images.get( + resource_group_name="test-rg", + marketplace_gallery_image_name="test-marketplace-gallery-image", + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetMarketplaceGalleryImage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_network_interface.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_network_interface.py new file mode 100644 index 000000000000..4160b7a00afe --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_network_interface.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python get_network_interface.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.network_interfaces.get( + resource_group_name="test-rg", + network_interface_name="test-nic", + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetNetworkInterface.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..02a1e6d7d3c9 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_offer.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetOffer.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..29a62ac85d60 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_publisher.py @@ -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: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..89600fba6683 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_security_settings.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetSecuritySettings.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..dad7547450ae 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_sku.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetSku.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetSku.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_storage_container.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_storage_container.py new file mode 100644 index 000000000000..14ff90a1860c --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_storage_container.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python get_storage_container.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.storage_containers.get( + resource_group_name="test-rg", + storage_container_name="Default_Container", + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetStorageContainer.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..d6401058364e 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_runs.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetUpdateRuns.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..f6e223bb938d 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_update_summaries.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetUpdateSummaries.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..1be25d46dfe7 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_updates.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/GetUpdates.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_virtual_hard_disk.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_virtual_hard_disk.py new file mode 100644 index 000000000000..4eb4fd5788b9 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_virtual_hard_disk.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python get_virtual_hard_disk.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.virtual_hard_disks.get( + resource_group_name="test-rg", + virtual_hard_disk_name="test-vhd", + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetVirtualHardDisk.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_virtual_machine_instance.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_virtual_machine_instance.py new file mode 100644 index 000000000000..59f6788832d2 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/get_virtual_machine_instance.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python get_virtual_machine_instance.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.virtual_machine_instances.get( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + ) + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GetVirtualMachineInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/guest_agent_list.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/guest_agent_list.py new file mode 100644 index 000000000000..2f324979fe23 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/guest_agent_list.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) AutoRest 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 guest_agent_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.guest_agents.list( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/GuestAgent_List.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/hybrid_identity_metadata_list.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/hybrid_identity_metadata_list.py new file mode 100644 index 000000000000..5e0fd98267ac --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/hybrid_identity_metadata_list.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) AutoRest 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 hybrid_identity_metadata_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AzureStackHCIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.hybrid_identity_metadata.list( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/HybridIdentityMetadata_List.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..8c8b1fd2e5a9 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/initialize_disable_process.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/InitializeDisableProcess.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/InitializeDisableProcess.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..3a5b5344f63e 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_arc_settings_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListArcSettingsByCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..7447b6ccb467 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListClustersByResourceGroup.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..ecb42c758efb 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_clusters_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListClustersBySubscription.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..c9ab35756135 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_deployment_settings_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListDeploymentSettingsByCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..28b9d72a6ead 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 @@ -37,6 +37,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: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..193ce281e358 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_extensions_by_arc_setting.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListExtensionsByArcSetting.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListExtensionsByArcSetting.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_gallery_image_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_gallery_image_by_resource_group.py new file mode 100644 index 000000000000..9cbc4d06a699 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_gallery_image_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_gallery_image_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.gallery_images.list( + resource_group_name="test-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListGalleryImageByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_gallery_image_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_gallery_image_by_subscription.py new file mode 100644 index 000000000000..034f0912d63f --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_gallery_image_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_gallery_image_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.gallery_images.list_all() + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListGalleryImageBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_logical_network_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_logical_network_by_resource_group.py new file mode 100644 index 000000000000..4786ef948351 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_logical_network_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_logical_network_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.logical_networks.list( + resource_group_name="test-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListLogicalNetworkByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_logical_network_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_logical_network_by_subscription.py new file mode 100644 index 000000000000..c226b7cd87a1 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_logical_network_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_logical_network_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.logical_networks.list_all() + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListLogicalNetworkBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_marketplace_gallery_image_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_marketplace_gallery_image_by_resource_group.py new file mode 100644 index 000000000000..79b4403b9e6a --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_marketplace_gallery_image_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_marketplace_gallery_image_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.marketplace_gallery_images.list( + resource_group_name="test-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListMarketplaceGalleryImageByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_marketplace_gallery_image_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_marketplace_gallery_image_by_subscription.py new file mode 100644 index 000000000000..02ef33a425de --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_marketplace_gallery_image_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_marketplace_gallery_image_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.marketplace_gallery_images.list_all() + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListMarketplaceGalleryImageBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_network_interface_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_network_interface_by_resource_group.py new file mode 100644 index 000000000000..ec546f1d616f --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_network_interface_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_network_interface_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.network_interfaces.list( + resource_group_name="test-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListNetworkInterfaceByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_network_interface_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_network_interface_by_subscription.py new file mode 100644 index 000000000000..d3aade7760c0 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_network_interface_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_network_interface_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.network_interfaces.list_all() + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListNetworkInterfaceBySubscription.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..eba2f4a37963 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListOffersByCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..225e652e19d3 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_offers_by_publisher.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListOffersByPublisher.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListOffersByPublisher.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/list_operations.py index 299e0fbeebb1..394a76d00cc9 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_operations.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_operations.py @@ -34,6 +34,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/operations/stable/2024-04-01/examples/ListOperations.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListOperations.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..ff52fd15b7c7 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 @@ -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: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..d50d02b053ff 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_security_settings_by_cluster.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListSecuritySettingsByCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..adf1fb1bf268 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_skus_by_offer.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListSkusByOffer.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListSkusByOffer.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_storage_container_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_storage_container_by_resource_group.py new file mode 100644 index 000000000000..3abada8c42ae --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_storage_container_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_storage_container_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.storage_containers.list( + resource_group_name="test-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListStorageContainerByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_storage_container_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_storage_container_by_subscription.py new file mode 100644 index 000000000000..b6e289f57420 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_storage_container_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_storage_container_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.storage_containers.list_all() + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListStorageContainerBySubscription.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..65a9d180fb6c 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_runs.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListUpdateRuns.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..f8c0a323d922 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_update_summaries.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListUpdateSummaries.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..d068673345ad 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_updates.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ListUpdates.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_hard_disk_by_resource_group.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_hard_disk_by_resource_group.py new file mode 100644 index 000000000000..2c250c1e9a86 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_hard_disk_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_virtual_hard_disk_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.virtual_hard_disks.list( + resource_group_name="test-rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListVirtualHardDiskByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_hard_disk_by_subscription.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_hard_disk_by_subscription.py new file mode 100644 index 000000000000..6627bf0b440d --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_hard_disk_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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_virtual_hard_disk_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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.virtual_hard_disks.list_all() + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListVirtualHardDiskBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_machine_instances.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_machine_instances.py new file mode 100644 index 000000000000..83df992e5f2c --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/list_virtual_machine_instances.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python list_virtual_machine_instances.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.virtual_machine_instances.list( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/ListVirtualMachineInstances.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..7c66a70d0709 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_arc_setting.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PatchArcSetting.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..9dde3aae3ea0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/patch_extension.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PatchExtension.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PatchExtension.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..8727fc588706 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/post_updates.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PostUpdates.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..dd49fd1fa0af 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 @@ -53,7 +53,6 @@ def main(): }, "domainFqdn": "ASZ1PLab8.nttest.microsoft.com", "hostNetwork": { - "enableStorageAutoIp": False, "intents": [ { "adapter": ["Port2"], @@ -80,18 +79,7 @@ def main(): ], "storageConnectivitySwitchless": True, "storageNetworks": [ - { - "name": "Storage1Network", - "networkAdapterName": "Port3", - "storageAdapterIPInfo": [ - { - "ipv4Address": "10.57.48.60", - "physicalNode": "string", - "subnetMask": "255.255.248.0", - } - ], - "vlanId": "5", - } + {"name": "Storage1Network", "networkAdapterName": "Port3", "vlanId": "5"} ], }, "infrastructureNetwork": [ @@ -113,25 +101,6 @@ def main(): {"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, @@ -146,40 +115,18 @@ def main(): "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: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutDeploymentSettings.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutDeploymentSettings.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/put_edge_devices.py similarity index 93% rename from sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py rename to sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_edge_devices.py index 9fe8a6f3be8a..297b163aff85 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/create_hci_edge_device.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_edge_devices.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-azurestackhci # USAGE - python create_hci_edge_device.py + python put_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, @@ -33,7 +33,6 @@ 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", resource={ - "kind": "HCI", "properties": { "deviceConfiguration": { "deviceMetadata": "", @@ -51,12 +50,12 @@ def main(): } ], } - }, + } }, ).result() print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/CreateHciEdgeDevice.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutEdgeDevices.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..cb3beba6fdbd 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_extension.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutExtension.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutExtension.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_gallery_image.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_gallery_image.py new file mode 100644 index 000000000000..fe59faa1cd16 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_gallery_image.py @@ -0,0 +1,54 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_gallery_image.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.gallery_images.begin_create_or_update( + resource_group_name="test-rg", + gallery_image_name="test-gallery-image", + gallery_images={ + "extendedLocation": { + "name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "location": "West US2", + "properties": { + "containerId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + "imagePath": "C:\\test.vhdx", + "osType": "Linux", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutGalleryImage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_logical_network.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_logical_network.py new file mode 100644 index 000000000000..c29dac48f808 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_logical_network.py @@ -0,0 +1,49 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_logical_network.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.logical_networks.begin_create_or_update( + resource_group_name="test-rg", + logical_network_name="test-lnet", + logical_networks={ + "extendedLocation": { + "name": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "location": "West US2", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutLogicalNetwork.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_marketplace_gallery_image.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_marketplace_gallery_image.py new file mode 100644 index 000000000000..3f1abcec9ce0 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_marketplace_gallery_image.py @@ -0,0 +1,57 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_marketplace_gallery_image.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.marketplace_gallery_images.begin_create_or_update( + resource_group_name="test-rg", + marketplace_gallery_image_name="test-marketplace-gallery-image", + marketplace_gallery_images={ + "extendedLocation": { + "name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "location": "West US2", + "properties": { + "cloudInitDataSource": "Azure", + "containerId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container", + "hyperVGeneration": "V1", + "identifier": {"offer": "myOfferName", "publisher": "myPublisherName", "sku": "mySkuName"}, + "osType": "Windows", + "version": {"name": "1.0.0"}, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutMarketplaceGalleryImage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_network_interface.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_network_interface.py new file mode 100644 index 000000000000..6730aa60bcde --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_network_interface.py @@ -0,0 +1,52 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_network_interface.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.network_interfaces.begin_create_or_update( + resource_group_name="test-rg", + network_interface_name="test-nic", + network_interfaces={ + "extendedLocation": { + "name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "location": "West US2", + "properties": { + "ipConfigurations": [{"name": "ipconfig-sample", "properties": {"subnet": {"id": "test-lnet"}}}] + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutNetworkInterface.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..6bf4edff2a9a 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 @@ -33,17 +33,11 @@ def main(): response = client.security_settings.begin_create_or_update( resource_group_name="test-rg", cluster_name="myCluster", - resource={ - "properties": { - "securedCoreComplianceAssignment": "Audit", - "smbEncryptionForIntraClusterTrafficComplianceAssignment": "Audit", - "wdacComplianceAssignment": "ApplyAndAutoCorrect", - } - }, + resource={"properties": {"securedCoreComplianceAssignment": "Audit"}}, ).result() print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutSecuritySettings.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutSecuritySettings.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_storage_container.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_storage_container.py new file mode 100644 index 000000000000..f7cdaa1ddc7c --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_storage_container.py @@ -0,0 +1,50 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_storage_container.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.storage_containers.begin_create_or_update( + resource_group_name="test-rg", + storage_container_name="Default_Container", + storage_containers={ + "extendedLocation": { + "name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "location": "West US2", + "properties": {"path": "C:\\container_storage"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutStorageContainer.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..4bcb151c99ca 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_runs.py @@ -64,6 +64,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutUpdateRuns.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..c2fcb253a4a4 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_update_summaries.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutUpdateSummaries.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/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..153370f34411 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_updates.py @@ -65,6 +65,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/PutUpdates.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutUpdates.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_hard_disk.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_hard_disk.py new file mode 100644 index 000000000000..5bbb605f2332 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_hard_disk.py @@ -0,0 +1,50 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_virtual_hard_disk.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.virtual_hard_disks.begin_create_or_update( + resource_group_name="test-rg", + virtual_hard_disk_name="test-vhd", + virtual_hard_disks={ + "extendedLocation": { + "name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "location": "West US2", + "properties": {"diskSizeGB": 32}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutVirtualHardDisk.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_gallery_image.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_gallery_image.py new file mode 100644 index 000000000000..cee50048854e --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_gallery_image.py @@ -0,0 +1,59 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_virtual_machine_instance_with_gallery_image.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.virtual_machine_instances.begin_create_or_update( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + virtual_machine_instance={ + "extendedLocation": { + "name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "properties": { + "hardwareProfile": {"vmSize": "Default"}, + "networkProfile": {"networkInterfaces": [{"id": "test-nic"}]}, + "osProfile": {"adminPassword": "password", "adminUsername": "localadmin", "computerName": "luamaster"}, + "securityProfile": {"enableTPM": True, "uefiSettings": {"secureBootEnabled": True}}, + "storageProfile": { + "imageReference": { + "id": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image" + }, + "vmConfigStoragePathId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutVirtualMachineInstanceWithGalleryImage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_marketplace_gallery_image.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_marketplace_gallery_image.py new file mode 100644 index 000000000000..d5704b3d4b97 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_marketplace_gallery_image.py @@ -0,0 +1,59 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_virtual_machine_instance_with_marketplace_gallery_image.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.virtual_machine_instances.begin_create_or_update( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + virtual_machine_instance={ + "extendedLocation": { + "name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "properties": { + "hardwareProfile": {"vmSize": "Default"}, + "networkProfile": {"networkInterfaces": [{"id": "test-nic"}]}, + "osProfile": {"adminPassword": "password", "adminUsername": "localadmin", "computerName": "luamaster"}, + "securityProfile": {"enableTPM": True, "uefiSettings": {"secureBootEnabled": True}}, + "storageProfile": { + "imageReference": { + "id": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image" + }, + "vmConfigStoragePathId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutVirtualMachineInstanceWithMarketplaceGalleryImage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_os_disk.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_os_disk.py new file mode 100644 index 000000000000..7080230c205b --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_os_disk.py @@ -0,0 +1,58 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_virtual_machine_instance_with_os_disk.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.virtual_machine_instances.begin_create_or_update( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + virtual_machine_instance={ + "extendedLocation": { + "name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "properties": { + "hardwareProfile": {"vmSize": "Default"}, + "networkProfile": {"networkInterfaces": [{"id": "test-nic"}]}, + "securityProfile": {"enableTPM": True, "uefiSettings": {"secureBootEnabled": True}}, + "storageProfile": { + "osDisk": { + "id": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd" + }, + "vmConfigStoragePathId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutVirtualMachineInstanceWithOsDisk.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_vm_config_agent.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_vm_config_agent.py new file mode 100644 index 000000000000..fa145b5df2a1 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/put_virtual_machine_instance_with_vm_config_agent.py @@ -0,0 +1,64 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python put_virtual_machine_instance_with_vm_config_agent.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.virtual_machine_instances.begin_create_or_update( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + virtual_machine_instance={ + "extendedLocation": { + "name": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location", + "type": "CustomLocation", + }, + "properties": { + "hardwareProfile": {"vmSize": "Default"}, + "networkProfile": {"networkInterfaces": [{"id": "test-nic"}]}, + "osProfile": { + "adminPassword": "password", + "adminUsername": "localadmin", + "computerName": "luamaster", + "windowsConfiguration": {"provisionVMConfigAgent": True}, + }, + "securityProfile": {"enableTPM": True, "uefiSettings": {"secureBootEnabled": True}}, + "storageProfile": { + "imageReference": { + "id": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image" + }, + "vmConfigStoragePathId": "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container", + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/PutVirtualMachineInstanceWithVMConfigAgent.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/restart_virtual_machine_instance.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/restart_virtual_machine_instance.py new file mode 100644 index 000000000000..4b0f2a4262f6 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/restart_virtual_machine_instance.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) AutoRest 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 restart_virtual_machine_instance.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.virtual_machine_instances.begin_restart( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/RestartVirtualMachineInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/start_virtual_machine_instance.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/start_virtual_machine_instance.py new file mode 100644 index 000000000000..c47af23db1e9 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/start_virtual_machine_instance.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) AutoRest 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 start_virtual_machine_instance.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.virtual_machine_instances.begin_start( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/StartVirtualMachineInstance.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/stop_virtual_machine_instance.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/stop_virtual_machine_instance.py new file mode 100644 index 000000000000..1682189a8403 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/stop_virtual_machine_instance.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) AutoRest 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 stop_virtual_machine_instance.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.virtual_machine_instances.begin_stop( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/StopVirtualMachineInstance.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..1f0a50787086 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_cluster.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/UpdateCluster.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateCluster.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/update_gallery_image.py similarity index 78% rename from sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py rename to sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_gallery_image.py index 6b9f4c3fd3ab..42168f63c45f 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/trigger_log_collection.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_gallery_image.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-azurestackhci # USAGE - python trigger_log_collection.py + python update_gallery_image.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, @@ -30,16 +30,14 @@ def main(): subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", ) - response = client.clusters.begin_trigger_log_collection( + response = client.gallery_images.begin_update( resource_group_name="test-rg", - cluster_name="mycluster", - log_collection_request={ - "properties": {"fromDate": "2020-01-01T17:18:19.1234567Z", "toDate": "2021-01-01T17:18:19.1234567Z"} - }, + gallery_image_name="test-gallery-image", + gallery_images={"tags": {"additionalProperties": "sample"}}, ).result() print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/TriggerLogCollection.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateGalleryImage.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/update_logical_network.py similarity index 74% rename from sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py rename to sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_logical_network.py index 55dacc4e72f1..98c009cd83d0 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/configure_remote_support.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_logical_network.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-azurestackhci # USAGE - python configure_remote_support.py + python update_logical_network.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, @@ -30,20 +30,14 @@ def main(): subscription_id="fd3c3665-1729-4b7b-9a38-238e83b0f98b", ) - response = client.clusters.begin_configure_remote_support( + response = client.logical_networks.begin_update( resource_group_name="test-rg", - cluster_name="mycluster", - remote_support_request={ - "properties": { - "accessLevel": "Diagnostics", - "expirationTimeStamp": "2020-01-01T17:18:19.1234567Z", - "remoteSupportType": "Enable", - } - }, + logical_network_name="test-lnet", + logical_networks={"tags": {"additionalProperties": "sample"}}, ).result() print(response) -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/ConfigureRemoteSupport.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateLogicalNetwork.json if __name__ == "__main__": main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_marketplace_gallery_image.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_marketplace_gallery_image.py new file mode 100644 index 000000000000..af5ac02dc054 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_marketplace_gallery_image.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) AutoRest 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_marketplace_gallery_image.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.marketplace_gallery_images.begin_update( + resource_group_name="test-rg", + marketplace_gallery_image_name="test-marketplce-gallery-image", + marketplace_gallery_images={"tags": {"additionalProperties": "sample"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateMarketplaceGalleryImage.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_network_interface.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_network_interface.py new file mode 100644 index 000000000000..da73eff2b6cc --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_network_interface.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) AutoRest 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_network_interface.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.network_interfaces.begin_update( + resource_group_name="test-rg", + network_interface_name="test-nic", + network_interfaces={"tags": {"additionalProperties": "sample"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateNetworkInterface.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_storage_container.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_storage_container.py new file mode 100644 index 000000000000..cebfaa10c000 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_storage_container.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) AutoRest 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_storage_container.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.storage_containers.begin_update( + resource_group_name="test-rg", + storage_container_name="Default_Container", + storage_containers={"tags": {"additionalProperties": "sample"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateStorageContainer.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_virtual_hard_disk.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_virtual_hard_disk.py new file mode 100644 index 000000000000..fe6d07910acc --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_virtual_hard_disk.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) AutoRest 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_virtual_hard_disk.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="fd3c3665-1729-4b7b-9a38-238e83b0f98b", + ) + + response = client.virtual_hard_disks.begin_update( + resource_group_name="test-rg", + virtual_hard_disk_name="test-vhd", + virtual_hard_disks={"tags": {"additionalProperties": "sample"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateVirtualHardDisk.json +if __name__ == "__main__": + main() diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_virtual_machine_instance.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_virtual_machine_instance.py new file mode 100644 index 000000000000..921fe870fc93 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/update_virtual_machine_instance.py @@ -0,0 +1,52 @@ +# 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 azure.identity import DefaultAzureCredential + +from azure.mgmt.azurestackhci import AzureStackHCIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-azurestackhci +# USAGE + python update_virtual_machine_instance.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.virtual_machine_instances.begin_update( + resource_uri="subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", + virtual_machine_instance={ + "properties": { + "storageProfile": { + "dataDisks": [ + { + "id": "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd" + } + ] + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UpdateVirtualMachineInstance.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..c7724fafe982 100644 --- a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_samples/upload_certificate.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/StackHCI/stable/2024-04-01/examples/UploadCertificate.json +# x-ms-original-file: specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/examples/UploadCertificate.json if __name__ == "__main__": main() 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..5cd7502cff75 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 @@ -24,7 +24,7 @@ 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", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -75,7 +75,7 @@ def test_create(self, resource_group): }, "type": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -89,7 +89,7 @@ def test_update(self, resource_group): cluster_name="str", arc_setting_name="str", arc_setting={"connectivityProperties": {}, "tags": {"str": "str"}}, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -102,7 +102,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -115,7 +115,7 @@ def test_generate_password(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -128,7 +128,7 @@ def test_begin_create_identity(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -141,7 +141,7 @@ def test_consent_and_install_default_extensions(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -154,7 +154,7 @@ def test_begin_initialize_disable_process(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-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..089dc3223572 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 @@ -25,7 +25,7 @@ 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", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -76,7 +76,7 @@ async def test_create(self, resource_group): }, "type": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -90,7 +90,7 @@ async def test_update(self, resource_group): cluster_name="str", arc_setting_name="str", arc_setting={"connectivityProperties": {}, "tags": {"str": "str"}}, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -104,7 +104,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -118,7 +118,7 @@ async def test_generate_password(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -132,7 +132,7 @@ async def test_begin_create_identity(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -146,7 +146,7 @@ async def test_consent_and_install_default_extensions(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -160,7 +160,7 @@ async def test_begin_initialize_disable_process(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-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..526e6290bfa9 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 @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_list_by_subscription(self, resource_group): response = self.client.clusters.list_by_subscription( - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_list_by_subscription(self, resource_group): 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", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): response = self.client.clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -76,53 +76,10 @@ def test_create(self, resource_group): }, "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", - }, "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", @@ -176,7 +133,7 @@ def test_create(self, resource_group): "type": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -199,7 +156,7 @@ def test_update(self, resource_group): "type": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -211,7 +168,7 @@ def test_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", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -224,7 +181,7 @@ def test_begin_upload_certificate(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", upload_certificate_request={"properties": {"certificates": ["str"]}}, - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -236,7 +193,7 @@ def test_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", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -249,39 +206,7 @@ def test_begin_extend_software_assurance_benefit(self, resource_group): 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 - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_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 - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_configure_remote_support(self, resource_group): - response = self.client.clusters.begin_configure_remote_support( - resource_group_name=resource_group.name, - cluster_name="str", - remote_support_request={ - "properties": { - "accessLevel": "str", - "expirationTimeStamp": "2020-02-20 00:00:00", - "remoteSupportType": "str", - } - }, - api_version="2024-04-01", + api_version="2024-01-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..df9aa031b7b1 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 @@ -23,7 +23,7 @@ def setup_method(self, method): @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", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_list_by_subscription(self, resource_group): 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", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): response = await self.client.clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -77,53 +77,10 @@ async def test_create(self, resource_group): }, "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", - }, "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", @@ -177,7 +134,7 @@ async def test_create(self, resource_group): "type": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -200,7 +157,7 @@ async def test_update(self, resource_group): "type": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -213,7 +170,7 @@ async def test_begin_delete(self, resource_group): await self.client.clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -228,7 +185,7 @@ async def test_begin_upload_certificate(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", upload_certificate_request={"properties": {"certificates": ["str"]}}, - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -242,7 +199,7 @@ async def test_begin_create_identity(self, resource_group): await self.client.clusters.begin_create_identity( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -257,45 +214,7 @@ async def test_begin_extend_software_assurance_benefit(self, resource_group): 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 - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_trigger_log_collection(self, resource_group): - response = await ( - await 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 - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_configure_remote_support(self, resource_group): - response = await ( - await self.client.clusters.begin_configure_remote_support( - resource_group_name=resource_group.name, - cluster_name="str", - remote_support_request={ - "properties": { - "accessLevel": "str", - "expirationTimeStamp": "2020-02-20 00:00:00", - "remoteSupportType": "str", - } - }, - api_version="2024-04-01", + api_version="2024-01-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..7f74ee5c0879 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 @@ -24,7 +24,7 @@ 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", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", deployment_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -91,16 +91,7 @@ def test_begin_create_or_update(self, resource_group): } ], "storageConnectivitySwitchless": False, - "storageNetworks": [ - { - "name": "str", - "networkAdapterName": "str", - "storageAdapterIPInfo": [ - {"ipv4Address": "str", "physicalNode": "str", "subnetMask": "str"} - ], - "vlanId": "str", - } - ], + "storageNetworks": [{"name": "str", "networkAdapterName": "str", "vlanId": "str"}], }, "infrastructureNetwork": [ { @@ -119,14 +110,6 @@ def test_begin_create_or_update(self, resource_group): }, "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, @@ -141,20 +124,7 @@ def test_begin_create_or_update(self, resource_group): "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", - }, - }, + } } ], "version": "str", @@ -162,7 +132,6 @@ def test_begin_create_or_update(self, resource_group): "deploymentMode": "Deploy", "id": "str", "name": "str", - "operationType": "ClusterProvisioning", "provisioningState": "str", "reportedProperties": { "deploymentStatus": { @@ -207,7 +176,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", }, deployment_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -220,7 +189,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", deployment_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-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_deployment_settings_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_deployment_settings_operations_async.py index d2715c1f3951..39c889fe8aa8 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 @@ -25,7 +25,7 @@ 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", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", deployment_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -94,14 +94,7 @@ async def test_begin_create_or_update(self, resource_group): ], "storageConnectivitySwitchless": False, "storageNetworks": [ - { - "name": "str", - "networkAdapterName": "str", - "storageAdapterIPInfo": [ - {"ipv4Address": "str", "physicalNode": "str", "subnetMask": "str"} - ], - "vlanId": "str", - } + {"name": "str", "networkAdapterName": "str", "vlanId": "str"} ], }, "infrastructureNetwork": [ @@ -121,14 +114,6 @@ async def test_begin_create_or_update(self, resource_group): }, "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, @@ -143,20 +128,7 @@ async def test_begin_create_or_update(self, resource_group): "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", - }, - }, + } } ], "version": "str", @@ -164,7 +136,6 @@ async def test_begin_create_or_update(self, resource_group): "deploymentMode": "Deploy", "id": "str", "name": "str", - "operationType": "ClusterProvisioning", "provisioningState": "str", "reportedProperties": { "deploymentStatus": { @@ -209,7 +180,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", }, deployment_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -224,7 +195,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", deployment_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-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_devices_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_edge_devices_operations.py index 0503cdcfb887..57db08839e14 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 @@ -23,7 +23,7 @@ def setup_method(self, method): def test_list(self, resource_group): response = self.client.edge_devices.list( resource_uri="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -35,7 +35,7 @@ def test_get(self, resource_group): response = self.client.edge_devices.get( resource_uri="str", edge_device_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -47,121 +47,25 @@ def test_begin_create_or_update(self, resource_group): response = self.client.edge_devices.begin_create_or_update( resource_uri="str", resource={ - "kind": "HCI", + "deviceConfiguration": { + "deviceMetadata": "str", + "nicDetails": [ + { + "adapterName": "str", + "componentId": "str", + "defaultGateway": "str", + "defaultIsolationId": "str", + "dnsServers": ["str"], + "driverVersion": "str", + "interfaceDescription": "str", + "ip4Address": "str", + "subnetMask": "str", + } + ], + }, "id": "str", "name": "str", - "properties": { - "deviceConfiguration": { - "deviceMetadata": "str", - "nicDetails": [ - { - "adapterName": "str", - "componentId": "str", - "defaultGateway": "str", - "defaultIsolationId": "str", - "dnsServers": ["str"], - "driverVersion": "str", - "interfaceDescription": "str", - "ip4Address": "str", - "subnetMask": "str", - } - ], - }, - "provisioningState": "str", - "reportedProperties": { - "deviceState": "str", - "extensionProfile": { - "extensions": [ - { - "errorDetails": [{"exception": "str"}], - "extensionName": "str", - "extensionResourceId": "str", - "managedBy": "str", - "state": "str", - "typeHandlerVersion": "str", - } - ] - }, - "networkProfile": { - "hostNetwork": { - "enableStorageAutoIp": bool, - "intents": [ - { - "adapterPropertyOverrides": { - "jumboPacket": "str", - "networkDirect": "str", - "networkDirectTechnology": "str", - }, - "intentAdapters": ["str"], - "intentName": "str", - "intentType": 0, - "isComputeIntentSet": bool, - "isManagementIntentSet": bool, - "isNetworkIntentType": bool, - "isOnlyStorage": bool, - "isOnlyStretch": bool, - "isStorageIntentSet": bool, - "isStretchIntentSet": bool, - "overrideAdapterProperty": bool, - "overrideQosPolicy": bool, - "overrideVirtualSwitchConfiguration": bool, - "qosPolicyOverrides": { - "bandwidthPercentage_SMB": "str", - "priorityValue8021Action_Cluster": "str", - "priorityValue8021Action_SMB": "str", - }, - "scope": 0, - "virtualSwitchConfigurationOverrides": { - "enableIov": "str", - "loadBalancingAlgorithm": "str", - }, - } - ], - "storageConnectivitySwitchless": bool, - "storageNetworks": [ - { - "name": "str", - "networkAdapterName": "str", - "storageAdapterIPInfo": [ - {"ipv4Address": "str", "physicalNode": "str", "subnetMask": "str"} - ], - "storageVlanId": "str", - } - ], - }, - "nicDetails": [ - { - "adapterName": "str", - "componentId": "str", - "defaultGateway": "str", - "defaultIsolationId": "str", - "dnsServers": ["str"], - "driverVersion": "str", - "interfaceDescription": "str", - "ip4Address": "str", - "macAddress": "str", - "nicStatus": "str", - "nicType": "str", - "slot": "str", - "subnetMask": "str", - "switchName": "str", - "vlanId": "str", - } - ], - "switchDetails": [ - { - "extensions": [ - {"extensionEnabled": bool, "extensionName": "str", "switchId": "str"} - ], - "switchName": "str", - "switchType": "str", - } - ], - }, - "osProfile": {"assemblyVersion": "str", "bootType": "str"}, - "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, - }, - }, + "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -173,7 +77,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", }, edge_device_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -185,7 +89,7 @@ def test_begin_delete(self, resource_group): response = self.client.edge_devices.begin_delete( resource_uri="str", edge_device_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -198,7 +102,7 @@ def test_begin_validate(self, resource_group): resource_uri="str", validate_request={"edgeDeviceIds": ["str"], "additionalInfo": "str"}, edge_device_name="default", - api_version="2024-04-01", + api_version="2024-01-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..a9abe252fd3c 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 @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_list(self, resource_group): response = self.client.edge_devices.list( resource_uri="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -36,7 +36,7 @@ async def test_get(self, resource_group): response = await self.client.edge_devices.get( resource_uri="str", edge_device_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -49,121 +49,25 @@ async def test_begin_create_or_update(self, resource_group): await self.client.edge_devices.begin_create_or_update( resource_uri="str", resource={ - "kind": "HCI", + "deviceConfiguration": { + "deviceMetadata": "str", + "nicDetails": [ + { + "adapterName": "str", + "componentId": "str", + "defaultGateway": "str", + "defaultIsolationId": "str", + "dnsServers": ["str"], + "driverVersion": "str", + "interfaceDescription": "str", + "ip4Address": "str", + "subnetMask": "str", + } + ], + }, "id": "str", "name": "str", - "properties": { - "deviceConfiguration": { - "deviceMetadata": "str", - "nicDetails": [ - { - "adapterName": "str", - "componentId": "str", - "defaultGateway": "str", - "defaultIsolationId": "str", - "dnsServers": ["str"], - "driverVersion": "str", - "interfaceDescription": "str", - "ip4Address": "str", - "subnetMask": "str", - } - ], - }, - "provisioningState": "str", - "reportedProperties": { - "deviceState": "str", - "extensionProfile": { - "extensions": [ - { - "errorDetails": [{"exception": "str"}], - "extensionName": "str", - "extensionResourceId": "str", - "managedBy": "str", - "state": "str", - "typeHandlerVersion": "str", - } - ] - }, - "networkProfile": { - "hostNetwork": { - "enableStorageAutoIp": bool, - "intents": [ - { - "adapterPropertyOverrides": { - "jumboPacket": "str", - "networkDirect": "str", - "networkDirectTechnology": "str", - }, - "intentAdapters": ["str"], - "intentName": "str", - "intentType": 0, - "isComputeIntentSet": bool, - "isManagementIntentSet": bool, - "isNetworkIntentType": bool, - "isOnlyStorage": bool, - "isOnlyStretch": bool, - "isStorageIntentSet": bool, - "isStretchIntentSet": bool, - "overrideAdapterProperty": bool, - "overrideQosPolicy": bool, - "overrideVirtualSwitchConfiguration": bool, - "qosPolicyOverrides": { - "bandwidthPercentage_SMB": "str", - "priorityValue8021Action_Cluster": "str", - "priorityValue8021Action_SMB": "str", - }, - "scope": 0, - "virtualSwitchConfigurationOverrides": { - "enableIov": "str", - "loadBalancingAlgorithm": "str", - }, - } - ], - "storageConnectivitySwitchless": bool, - "storageNetworks": [ - { - "name": "str", - "networkAdapterName": "str", - "storageAdapterIPInfo": [ - {"ipv4Address": "str", "physicalNode": "str", "subnetMask": "str"} - ], - "storageVlanId": "str", - } - ], - }, - "nicDetails": [ - { - "adapterName": "str", - "componentId": "str", - "defaultGateway": "str", - "defaultIsolationId": "str", - "dnsServers": ["str"], - "driverVersion": "str", - "interfaceDescription": "str", - "ip4Address": "str", - "macAddress": "str", - "nicStatus": "str", - "nicType": "str", - "slot": "str", - "subnetMask": "str", - "switchName": "str", - "vlanId": "str", - } - ], - "switchDetails": [ - { - "extensions": [ - {"extensionEnabled": bool, "extensionName": "str", "switchId": "str"} - ], - "switchName": "str", - "switchType": "str", - } - ], - }, - "osProfile": {"assemblyVersion": "str", "bootType": "str"}, - "sbeDeploymentPackageInfo": {"code": "str", "message": "str", "sbeManifest": "str"}, - }, - }, + "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -175,7 +79,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", }, edge_device_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -189,7 +93,7 @@ async def test_begin_delete(self, resource_group): await self.client.edge_devices.begin_delete( resource_uri="str", edge_device_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -204,7 +108,7 @@ async def test_begin_validate(self, resource_group): resource_uri="str", validate_request={"edgeDeviceIds": ["str"], "additionalInfo": "str"}, edge_device_name="default", - api_version="2024-04-01", + api_version="2024-01-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_extensions_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_extensions_operations.py index 959d8f32460f..b0fb6176ebd7 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 @@ -25,7 +25,7 @@ def test_list_by_arc_setting(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_get(self, resource_group): cluster_name="str", arc_setting_name="str", extension_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -96,7 +96,7 @@ def test_begin_create(self, resource_group): "type": "str", "typeHandlerVersion": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -118,7 +118,7 @@ def test_begin_update(self, resource_group): "typeHandlerVersion": "str", } }, - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -132,7 +132,7 @@ def test_begin_delete(self, resource_group): cluster_name="str", arc_setting_name="str", extension_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -147,7 +147,7 @@ def test_begin_upgrade(self, resource_group): arc_setting_name="str", extension_name="str", extension_upgrade_parameters={"targetVersion": "str"}, - api_version="2024-04-01", + api_version="2024-01-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..9ce48bb35b50 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 @@ -26,7 +26,7 @@ async def test_list_by_arc_setting(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", arc_setting_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_get(self, resource_group): cluster_name="str", arc_setting_name="str", extension_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -98,7 +98,7 @@ async def test_begin_create(self, resource_group): "type": "str", "typeHandlerVersion": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -122,7 +122,7 @@ async def test_begin_update(self, resource_group): "typeHandlerVersion": "str", } }, - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -138,7 +138,7 @@ async def test_begin_delete(self, resource_group): cluster_name="str", arc_setting_name="str", extension_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -155,7 +155,7 @@ 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", + api_version="2024-01-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_gallery_images_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_gallery_images_operations.py new file mode 100644 index 000000000000..3cef592bb8de --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_gallery_images_operations.py @@ -0,0 +1,120 @@ +# 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 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 TestAzureStackHCIGalleryImagesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.gallery_images.get( + resource_group_name=resource_group.name, + gallery_image_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create_or_update(self, resource_group): + response = self.client.gallery_images.begin_create_or_update( + resource_group_name=resource_group.name, + gallery_image_name="str", + gallery_images={ + "location": "str", + "cloudInitDataSource": "str", + "containerId": "str", + "extendedLocation": {"name": "str", "type": "str"}, + "hyperVGeneration": "str", + "id": "str", + "identifier": {"offer": "str", "publisher": "str", "sku": "str"}, + "imagePath": "str", + "name": "str", + "osType": "str", + "provisioningState": "str", + "status": { + "downloadStatus": {"downloadSizeInMB": 0}, + "errorCode": "str", + "errorMessage": "str", + "progressPercentage": 0, + "provisioningStatus": {"operationId": "str", "status": "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", + "version": {"name": "str", "storageProfile": {"osDiskImage": {"sizeInMB": 0}}}, + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = self.client.gallery_images.begin_delete( + resource_group_name=resource_group.name, + gallery_image_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = self.client.gallery_images.begin_update( + resource_group_name=resource_group.name, + gallery_image_name="str", + gallery_images={"tags": {"str": "str"}}, + api_version="2024-01-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.gallery_images.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.gallery_images.list_all( + api_version="2024-01-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_gallery_images_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_gallery_images_operations_async.py new file mode 100644 index 000000000000..e8635ee9db97 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_gallery_images_operations_async.py @@ -0,0 +1,127 @@ +# 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 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 TestAzureStackHCIGalleryImagesOperationsAsync(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_get(self, resource_group): + response = await self.client.gallery_images.get( + resource_group_name=resource_group.name, + gallery_image_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create_or_update(self, resource_group): + response = await ( + await self.client.gallery_images.begin_create_or_update( + resource_group_name=resource_group.name, + gallery_image_name="str", + gallery_images={ + "location": "str", + "cloudInitDataSource": "str", + "containerId": "str", + "extendedLocation": {"name": "str", "type": "str"}, + "hyperVGeneration": "str", + "id": "str", + "identifier": {"offer": "str", "publisher": "str", "sku": "str"}, + "imagePath": "str", + "name": "str", + "osType": "str", + "provisioningState": "str", + "status": { + "downloadStatus": {"downloadSizeInMB": 0}, + "errorCode": "str", + "errorMessage": "str", + "progressPercentage": 0, + "provisioningStatus": {"operationId": "str", "status": "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", + "version": {"name": "str", "storageProfile": {"osDiskImage": {"sizeInMB": 0}}}, + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = await ( + await self.client.gallery_images.begin_delete( + resource_group_name=resource_group.name, + gallery_image_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = await ( + await self.client.gallery_images.begin_update( + resource_group_name=resource_group.name, + gallery_image_name="str", + gallery_images={"tags": {"str": "str"}}, + api_version="2024-01-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.gallery_images.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.gallery_images.list_all( + api_version="2024-01-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_guest_agent_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agent_operations.py new file mode 100644 index 000000000000..ce615e953b5f --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agent_operations.py @@ -0,0 +1,52 @@ +# 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 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 TestAzureStackHCIGuestAgentOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create(self, resource_group): + response = self.client.guest_agent.begin_create( + resource_uri="str", + api_version="2024-01-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_get(self, resource_group): + response = self.client.guest_agent.get( + resource_uri="str", + api_version="2024-01-01", + ) + + # 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.guest_agent.begin_delete( + resource_uri="str", + api_version="2024-01-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_guest_agent_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agent_operations_async.py new file mode 100644 index 000000000000..1c1797a03ff1 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agent_operations_async.py @@ -0,0 +1,57 @@ +# 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 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 TestAzureStackHCIGuestAgentOperationsAsync(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_begin_create(self, resource_group): + response = await ( + await self.client.guest_agent.begin_create( + resource_uri="str", + api_version="2024-01-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_get(self, resource_group): + response = await self.client.guest_agent.get( + resource_uri="str", + api_version="2024-01-01", + ) + + # 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.guest_agent.begin_delete( + resource_uri="str", + api_version="2024-01-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_guest_agents_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agents_operations.py new file mode 100644 index 000000000000..9f48b16d24ca --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agents_operations.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) AutoRest 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 TestAzureStackHCIGuestAgentsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.guest_agents.list( + resource_uri="str", + api_version="2024-01-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_guest_agents_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agents_operations_async.py new file mode 100644 index 000000000000..0aeea451ee51 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_guest_agents_operations_async.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) AutoRest 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 TestAzureStackHCIGuestAgentsOperationsAsync(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_list(self, resource_group): + response = self.client.guest_agents.list( + resource_uri="str", + api_version="2024-01-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_hybrid_identity_metadata_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_hybrid_identity_metadata_operations.py new file mode 100644 index 000000000000..17d317053007 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_hybrid_identity_metadata_operations.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) AutoRest 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 TestAzureStackHCIHybridIdentityMetadataOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.hybrid_identity_metadata.get( + resource_uri="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_list(self, resource_group): + response = self.client.hybrid_identity_metadata.list( + resource_uri="str", + api_version="2024-01-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_hybrid_identity_metadata_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_hybrid_identity_metadata_operations_async.py new file mode 100644 index 000000000000..982d8a290363 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_hybrid_identity_metadata_operations_async.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) AutoRest 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 TestAzureStackHCIHybridIdentityMetadataOperationsAsync(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_get(self, resource_group): + response = await self.client.hybrid_identity_metadata.get( + resource_uri="str", + api_version="2024-01-01", + ) + + # 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.hybrid_identity_metadata.list( + resource_uri="str", + api_version="2024-01-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_logical_networks_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_logical_networks_operations.py new file mode 100644 index 000000000000..6f73b696f143 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_logical_networks_operations.py @@ -0,0 +1,138 @@ +# 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 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 TestAzureStackHCILogicalNetworksOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.logical_networks.get( + resource_group_name=resource_group.name, + logical_network_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create_or_update(self, resource_group): + response = self.client.logical_networks.begin_create_or_update( + resource_group_name=resource_group.name, + logical_network_name="str", + logical_networks={ + "location": "str", + "dhcpOptions": {"dnsServers": ["str"]}, + "extendedLocation": {"name": "str", "type": "str"}, + "id": "str", + "name": "str", + "provisioningState": "str", + "status": { + "errorCode": "str", + "errorMessage": "str", + "provisioningStatus": {"operationId": "str", "status": "str"}, + }, + "subnets": [ + { + "addressPrefix": "str", + "addressPrefixes": ["str"], + "ipAllocationMethod": "str", + "ipConfigurationReferences": [{"ID": "str"}], + "ipPools": [ + { + "end": "str", + "info": {"available": "str", "used": "str"}, + "ipPoolType": "str", + "name": "str", + "start": "str", + } + ], + "name": "str", + "routeTable": { + "etag": "str", + "name": "str", + "routes": [{"addressPrefix": "str", "name": "str", "nextHopIpAddress": "str"}], + "type": "str", + }, + "vlan": 0, + } + ], + "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", + "vmSwitchName": "str", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = self.client.logical_networks.begin_delete( + resource_group_name=resource_group.name, + logical_network_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = self.client.logical_networks.begin_update( + resource_group_name=resource_group.name, + logical_network_name="str", + logical_networks={"tags": {"str": "str"}}, + api_version="2024-01-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.logical_networks.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.logical_networks.list_all( + api_version="2024-01-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_logical_networks_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_logical_networks_operations_async.py new file mode 100644 index 000000000000..af16c1f07959 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_logical_networks_operations_async.py @@ -0,0 +1,145 @@ +# 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 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 TestAzureStackHCILogicalNetworksOperationsAsync(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_get(self, resource_group): + response = await self.client.logical_networks.get( + resource_group_name=resource_group.name, + logical_network_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create_or_update(self, resource_group): + response = await ( + await self.client.logical_networks.begin_create_or_update( + resource_group_name=resource_group.name, + logical_network_name="str", + logical_networks={ + "location": "str", + "dhcpOptions": {"dnsServers": ["str"]}, + "extendedLocation": {"name": "str", "type": "str"}, + "id": "str", + "name": "str", + "provisioningState": "str", + "status": { + "errorCode": "str", + "errorMessage": "str", + "provisioningStatus": {"operationId": "str", "status": "str"}, + }, + "subnets": [ + { + "addressPrefix": "str", + "addressPrefixes": ["str"], + "ipAllocationMethod": "str", + "ipConfigurationReferences": [{"ID": "str"}], + "ipPools": [ + { + "end": "str", + "info": {"available": "str", "used": "str"}, + "ipPoolType": "str", + "name": "str", + "start": "str", + } + ], + "name": "str", + "routeTable": { + "etag": "str", + "name": "str", + "routes": [{"addressPrefix": "str", "name": "str", "nextHopIpAddress": "str"}], + "type": "str", + }, + "vlan": 0, + } + ], + "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", + "vmSwitchName": "str", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = await ( + await self.client.logical_networks.begin_delete( + resource_group_name=resource_group.name, + logical_network_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = await ( + await self.client.logical_networks.begin_update( + resource_group_name=resource_group.name, + logical_network_name="str", + logical_networks={"tags": {"str": "str"}}, + api_version="2024-01-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.logical_networks.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.logical_networks.list_all( + api_version="2024-01-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_marketplace_gallery_images_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_marketplace_gallery_images_operations.py new file mode 100644 index 000000000000..26bd8e95ad20 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_marketplace_gallery_images_operations.py @@ -0,0 +1,119 @@ +# 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 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 TestAzureStackHCIMarketplaceGalleryImagesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.marketplace_gallery_images.get( + resource_group_name=resource_group.name, + marketplace_gallery_image_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create_or_update(self, resource_group): + response = self.client.marketplace_gallery_images.begin_create_or_update( + resource_group_name=resource_group.name, + marketplace_gallery_image_name="str", + marketplace_gallery_images={ + "location": "str", + "cloudInitDataSource": "str", + "containerId": "str", + "extendedLocation": {"name": "str", "type": "str"}, + "hyperVGeneration": "str", + "id": "str", + "identifier": {"offer": "str", "publisher": "str", "sku": "str"}, + "name": "str", + "osType": "str", + "provisioningState": "str", + "status": { + "downloadStatus": {"downloadSizeInMB": 0}, + "errorCode": "str", + "errorMessage": "str", + "progressPercentage": 0, + "provisioningStatus": {"operationId": "str", "status": "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", + "version": {"name": "str", "storageProfile": {"osDiskImage": {"sizeInMB": 0}}}, + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = self.client.marketplace_gallery_images.begin_delete( + resource_group_name=resource_group.name, + marketplace_gallery_image_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = self.client.marketplace_gallery_images.begin_update( + resource_group_name=resource_group.name, + marketplace_gallery_image_name="str", + marketplace_gallery_images={"tags": {"str": "str"}}, + api_version="2024-01-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.marketplace_gallery_images.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.marketplace_gallery_images.list_all( + api_version="2024-01-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_marketplace_gallery_images_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_marketplace_gallery_images_operations_async.py new file mode 100644 index 000000000000..bde589c394a7 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_marketplace_gallery_images_operations_async.py @@ -0,0 +1,126 @@ +# 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 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 TestAzureStackHCIMarketplaceGalleryImagesOperationsAsync(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_get(self, resource_group): + response = await self.client.marketplace_gallery_images.get( + resource_group_name=resource_group.name, + marketplace_gallery_image_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create_or_update(self, resource_group): + response = await ( + await self.client.marketplace_gallery_images.begin_create_or_update( + resource_group_name=resource_group.name, + marketplace_gallery_image_name="str", + marketplace_gallery_images={ + "location": "str", + "cloudInitDataSource": "str", + "containerId": "str", + "extendedLocation": {"name": "str", "type": "str"}, + "hyperVGeneration": "str", + "id": "str", + "identifier": {"offer": "str", "publisher": "str", "sku": "str"}, + "name": "str", + "osType": "str", + "provisioningState": "str", + "status": { + "downloadStatus": {"downloadSizeInMB": 0}, + "errorCode": "str", + "errorMessage": "str", + "progressPercentage": 0, + "provisioningStatus": {"operationId": "str", "status": "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", + "version": {"name": "str", "storageProfile": {"osDiskImage": {"sizeInMB": 0}}}, + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = await ( + await self.client.marketplace_gallery_images.begin_delete( + resource_group_name=resource_group.name, + marketplace_gallery_image_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = await ( + await self.client.marketplace_gallery_images.begin_update( + resource_group_name=resource_group.name, + marketplace_gallery_image_name="str", + marketplace_gallery_images={"tags": {"str": "str"}}, + api_version="2024-01-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.marketplace_gallery_images.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.marketplace_gallery_images.list_all( + api_version="2024-01-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_network_interfaces_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_network_interfaces_operations.py new file mode 100644 index 000000000000..bb2217074820 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_network_interfaces_operations.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest 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 TestAzureStackHCINetworkInterfacesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.network_interfaces.get( + resource_group_name=resource_group.name, + network_interface_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create_or_update(self, resource_group): + response = self.client.network_interfaces.begin_create_or_update( + resource_group_name=resource_group.name, + network_interface_name="str", + network_interfaces={ + "location": "str", + "dnsSettings": {"dnsServers": ["str"]}, + "extendedLocation": {"name": "str", "type": "str"}, + "id": "str", + "ipConfigurations": [ + { + "name": "str", + "properties": { + "gateway": "str", + "prefixLength": "str", + "privateIPAddress": "str", + "subnet": {"id": "str"}, + }, + } + ], + "macAddress": "str", + "name": "str", + "provisioningState": "str", + "status": { + "errorCode": "str", + "errorMessage": "str", + "provisioningStatus": {"operationId": "str", "status": "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", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = self.client.network_interfaces.begin_delete( + resource_group_name=resource_group.name, + network_interface_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = self.client.network_interfaces.begin_update( + resource_group_name=resource_group.name, + network_interface_name="str", + network_interfaces={"tags": {"str": "str"}}, + api_version="2024-01-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.network_interfaces.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.network_interfaces.list_all( + api_version="2024-01-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_network_interfaces_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_network_interfaces_operations_async.py new file mode 100644 index 000000000000..9214d180b730 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_network_interfaces_operations_async.py @@ -0,0 +1,131 @@ +# 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 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 TestAzureStackHCINetworkInterfacesOperationsAsync(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_get(self, resource_group): + response = await self.client.network_interfaces.get( + resource_group_name=resource_group.name, + network_interface_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create_or_update(self, resource_group): + response = await ( + await self.client.network_interfaces.begin_create_or_update( + resource_group_name=resource_group.name, + network_interface_name="str", + network_interfaces={ + "location": "str", + "dnsSettings": {"dnsServers": ["str"]}, + "extendedLocation": {"name": "str", "type": "str"}, + "id": "str", + "ipConfigurations": [ + { + "name": "str", + "properties": { + "gateway": "str", + "prefixLength": "str", + "privateIPAddress": "str", + "subnet": {"id": "str"}, + }, + } + ], + "macAddress": "str", + "name": "str", + "provisioningState": "str", + "status": { + "errorCode": "str", + "errorMessage": "str", + "provisioningStatus": {"operationId": "str", "status": "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", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = await ( + await self.client.network_interfaces.begin_delete( + resource_group_name=resource_group.name, + network_interface_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = await ( + await self.client.network_interfaces.begin_update( + resource_group_name=resource_group.name, + network_interface_name="str", + network_interfaces={"tags": {"str": "str"}}, + api_version="2024-01-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.network_interfaces.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.network_interfaces.list_all( + api_version="2024-01-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_offers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_offers_operations.py index 57d9691a2b84..7a62e37bae9d 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 @@ -25,7 +25,7 @@ def test_list_by_publisher(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_list_by_cluster(self, resource_group): response = self.client.offers.list_by_cluster( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -51,7 +51,7 @@ def test_get(self, resource_group): cluster_name="str", publisher_name="str", offer_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..3c55f4ec6ba8 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 @@ -26,7 +26,7 @@ async def test_list_by_publisher(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_list_by_cluster(self, resource_group): response = self.client.offers.list_by_cluster( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -52,7 +52,7 @@ async def test_get(self, resource_group): cluster_name="str", publisher_name="str", offer_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..492a07d0012d 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 @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_list(self, resource_group): response = self.client.operations.list( - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..f2804ea38b43 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 @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_list(self, resource_group): response = await self.client.operations.list( - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..408151d8be8b 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 @@ -24,7 +24,7 @@ def test_list_by_cluster(self, resource_group): response = self.client.publishers.list_by_cluster( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..803ebbd3aded 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 @@ -25,7 +25,7 @@ async def test_list_by_cluster(self, resource_group): response = self.client.publishers.list_by_cluster( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", publisher_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..1385900f0103 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 @@ -24,7 +24,7 @@ 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", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", security_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -61,7 +61,6 @@ def test_begin_create_or_update(self, resource_group): "securedCoreCompliance": "str", "wdacCompliance": "str", }, - "smbEncryptionForIntraClusterTrafficComplianceAssignment": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -71,10 +70,9 @@ def test_begin_create_or_update(self, resource_group): "lastModifiedByType": "str", }, "type": "str", - "wdacComplianceAssignment": "str", }, security_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -87,7 +85,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", security_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-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_security_settings_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_security_settings_operations_async.py index 4b56e479fec4..0915cc0501fe 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 @@ -25,7 +25,7 @@ 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", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", security_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -63,7 +63,6 @@ async def test_begin_create_or_update(self, resource_group): "securedCoreCompliance": "str", "wdacCompliance": "str", }, - "smbEncryptionForIntraClusterTrafficComplianceAssignment": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -73,10 +72,9 @@ 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", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -91,7 +89,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", security_settings_name="default", - api_version="2024-04-01", + api_version="2024-01-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_skus_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_skus_operations.py index 96716711a736..f0686b065585 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 @@ -26,7 +26,7 @@ def test_list_by_offer(self, resource_group): cluster_name="str", publisher_name="str", offer_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_get(self, resource_group): publisher_name="str", offer_name="str", sku_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..4ef83dba7b12 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 @@ -27,7 +27,7 @@ async def test_list_by_offer(self, resource_group): cluster_name="str", publisher_name="str", offer_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_get(self, resource_group): publisher_name="str", offer_name="str", sku_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_storage_containers_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_storage_containers_operations.py new file mode 100644 index 000000000000..1abf2ae96ea1 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_storage_containers_operations.py @@ -0,0 +1,114 @@ +# 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 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 TestAzureStackHCIStorageContainersOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.storage_containers.get( + resource_group_name=resource_group.name, + storage_container_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create_or_update(self, resource_group): + response = self.client.storage_containers.begin_create_or_update( + resource_group_name=resource_group.name, + storage_container_name="str", + storage_containers={ + "location": "str", + "extendedLocation": {"name": "str", "type": "str"}, + "id": "str", + "name": "str", + "path": "str", + "provisioningState": "str", + "status": { + "availableSizeMB": 0, + "containerSizeMB": 0, + "errorCode": "str", + "errorMessage": "str", + "provisioningStatus": {"operationId": "str", "status": "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", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = self.client.storage_containers.begin_delete( + resource_group_name=resource_group.name, + storage_container_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = self.client.storage_containers.begin_update( + resource_group_name=resource_group.name, + storage_container_name="str", + storage_containers={"tags": {"str": "str"}}, + api_version="2024-01-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.storage_containers.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.storage_containers.list_all( + api_version="2024-01-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_storage_containers_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_storage_containers_operations_async.py new file mode 100644 index 000000000000..c76300758ad6 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_storage_containers_operations_async.py @@ -0,0 +1,121 @@ +# 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 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 TestAzureStackHCIStorageContainersOperationsAsync(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_get(self, resource_group): + response = await self.client.storage_containers.get( + resource_group_name=resource_group.name, + storage_container_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create_or_update(self, resource_group): + response = await ( + await self.client.storage_containers.begin_create_or_update( + resource_group_name=resource_group.name, + storage_container_name="str", + storage_containers={ + "location": "str", + "extendedLocation": {"name": "str", "type": "str"}, + "id": "str", + "name": "str", + "path": "str", + "provisioningState": "str", + "status": { + "availableSizeMB": 0, + "containerSizeMB": 0, + "errorCode": "str", + "errorMessage": "str", + "provisioningStatus": {"operationId": "str", "status": "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", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = await ( + await self.client.storage_containers.begin_delete( + resource_group_name=resource_group.name, + storage_container_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = await ( + await self.client.storage_containers.begin_update( + resource_group_name=resource_group.name, + storage_container_name="str", + storage_containers={"tags": {"str": "str"}}, + api_version="2024-01-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.storage_containers.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.storage_containers.list_all( + api_version="2024-01-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_runs_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_update_runs_operations.py index 795a1dbe1b26..54eb978dbdd6 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 @@ -25,7 +25,7 @@ def test_list(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_begin_delete(self, resource_group): cluster_name="str", update_name="str", update_run_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -58,7 +58,6 @@ def test_put(self, resource_group): "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", @@ -73,7 +72,6 @@ def test_put(self, resource_group): "description": "str", "endTimeUtc": "2020-02-20 00:00:00", "errorMessage": "str", - "expectedExecutionTime": "str", "lastUpdatedTimeUtc": "2020-02-20 00:00:00", "name": "str", "startTimeUtc": "2020-02-20 00:00:00", @@ -92,7 +90,7 @@ def test_put(self, resource_group): "timeStarted": "2020-02-20 00:00:00", "type": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -106,7 +104,7 @@ def test_get(self, resource_group): cluster_name="str", update_name="str", update_run_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..0ac4e86df93a 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 @@ -26,7 +26,7 @@ async def test_list(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ async def test_begin_delete(self, resource_group): cluster_name="str", update_name="str", update_run_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -61,7 +61,6 @@ async def test_put(self, resource_group): "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", @@ -76,7 +75,6 @@ async def test_put(self, resource_group): "description": "str", "endTimeUtc": "2020-02-20 00:00:00", "errorMessage": "str", - "expectedExecutionTime": "str", "lastUpdatedTimeUtc": "2020-02-20 00:00:00", "name": "str", "startTimeUtc": "2020-02-20 00:00:00", @@ -95,7 +93,7 @@ async def test_put(self, resource_group): "timeStarted": "2020-02-20 00:00:00", "type": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -109,7 +107,7 @@ async def test_get(self, resource_group): cluster_name="str", update_name="str", update_run_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..721507d70d5d 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 @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.update_summaries.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -36,7 +36,7 @@ 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", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -49,8 +49,6 @@ def test_put(self, resource_group): 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", @@ -60,7 +58,6 @@ def test_put(self, resource_group): "description": "str", "displayName": "str", "healthCheckSource": "str", - "healthCheckTags": {}, "name": "str", "remediation": "str", "severity": "str", @@ -68,7 +65,6 @@ def test_put(self, resource_group): "tags": {"key": "str", "value": "str"}, "targetResourceID": "str", "targetResourceName": "str", - "targetResourceType": "str", "timestamp": "2020-02-20 00:00:00", "title": "str", } @@ -93,7 +89,7 @@ def test_put(self, resource_group): }, "type": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -105,7 +101,7 @@ def test_get(self, resource_group): response = self.client.update_summaries.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..88aecba37093 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 @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.update_summaries.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_begin_delete(self, resource_group): await self.client.update_summaries.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -52,8 +52,6 @@ async def test_put(self, resource_group): 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", @@ -63,7 +61,6 @@ async def test_put(self, resource_group): "description": "str", "displayName": "str", "healthCheckSource": "str", - "healthCheckTags": {}, "name": "str", "remediation": "str", "severity": "str", @@ -71,7 +68,6 @@ async def test_put(self, resource_group): "tags": {"key": "str", "value": "str"}, "targetResourceID": "str", "targetResourceName": "str", - "targetResourceType": "str", "timestamp": "2020-02-20 00:00:00", "title": "str", } @@ -96,7 +92,7 @@ async def test_put(self, resource_group): }, "type": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -108,7 +104,7 @@ async def test_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", + api_version="2024-01-01", ) # 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..9de345b9d957 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 @@ -25,7 +25,7 @@ def test_begin_post(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -37,7 +37,7 @@ 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", + api_version="2024-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -50,7 +50,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -75,7 +75,6 @@ def test_put(self, resource_group): "description": "str", "displayName": "str", "healthCheckSource": "str", - "healthCheckTags": {}, "name": "str", "remediation": "str", "severity": "str", @@ -83,7 +82,6 @@ def test_put(self, resource_group): "tags": {"key": "str", "value": "str"}, "targetResourceID": "str", "targetResourceName": "str", - "targetResourceType": "str", "timestamp": "2020-02-20 00:00:00", "title": "str", } @@ -92,7 +90,6 @@ def test_put(self, resource_group): "id": "str", "installedDate": "2020-02-20 00:00:00", "location": "str", - "minSbeVersionRequired": "str", "name": "str", "notifyMessage": "str", "packagePath": "str", @@ -116,7 +113,7 @@ def test_put(self, resource_group): "type": "str", "version": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -129,7 +126,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # 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..8594b3875736 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 @@ -27,7 +27,7 @@ async def test_begin_post(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -40,7 +40,7 @@ async 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", + api_version="2024-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -54,7 +54,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -80,7 +80,6 @@ async def test_put(self, resource_group): "description": "str", "displayName": "str", "healthCheckSource": "str", - "healthCheckTags": {}, "name": "str", "remediation": "str", "severity": "str", @@ -88,7 +87,6 @@ async def test_put(self, resource_group): "tags": {"key": "str", "value": "str"}, "targetResourceID": "str", "targetResourceName": "str", - "targetResourceType": "str", "timestamp": "2020-02-20 00:00:00", "title": "str", } @@ -97,7 +95,6 @@ async def test_put(self, resource_group): "id": "str", "installedDate": "2020-02-20 00:00:00", "location": "str", - "minSbeVersionRequired": "str", "name": "str", "notifyMessage": "str", "packagePath": "str", @@ -121,7 +118,7 @@ async def test_put(self, resource_group): "type": "str", "version": "str", }, - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself @@ -134,7 +131,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", update_name="str", - api_version="2024-04-01", + api_version="2024-01-01", ) # please add some check logic here by yourself diff --git a/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_hard_disks_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_hard_disks_operations.py new file mode 100644 index 000000000000..499d309ed7ba --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_hard_disks_operations.py @@ -0,0 +1,119 @@ +# 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 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 TestAzureStackHCIVirtualHardDisksOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.virtual_hard_disks.get( + resource_group_name=resource_group.name, + virtual_hard_disk_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create_or_update(self, resource_group): + response = self.client.virtual_hard_disks.begin_create_or_update( + resource_group_name=resource_group.name, + virtual_hard_disk_name="str", + virtual_hard_disks={ + "location": "str", + "blockSizeBytes": 0, + "containerId": "str", + "diskFileFormat": "str", + "diskSizeGB": 0, + "dynamic": bool, + "extendedLocation": {"name": "str", "type": "str"}, + "hyperVGeneration": "str", + "id": "str", + "logicalSectorBytes": 0, + "name": "str", + "physicalSectorBytes": 0, + "provisioningState": "str", + "status": { + "errorCode": "str", + "errorMessage": "str", + "provisioningStatus": {"operationId": "str", "status": "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", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = self.client.virtual_hard_disks.begin_delete( + resource_group_name=resource_group.name, + virtual_hard_disk_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = self.client.virtual_hard_disks.begin_update( + resource_group_name=resource_group.name, + virtual_hard_disk_name="str", + virtual_hard_disks={"tags": {"str": "str"}}, + api_version="2024-01-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.virtual_hard_disks.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.virtual_hard_disks.list_all( + api_version="2024-01-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_virtual_hard_disks_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_hard_disks_operations_async.py new file mode 100644 index 000000000000..043ce061e2b3 --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_hard_disks_operations_async.py @@ -0,0 +1,126 @@ +# 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 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 TestAzureStackHCIVirtualHardDisksOperationsAsync(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_get(self, resource_group): + response = await self.client.virtual_hard_disks.get( + resource_group_name=resource_group.name, + virtual_hard_disk_name="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create_or_update(self, resource_group): + response = await ( + await self.client.virtual_hard_disks.begin_create_or_update( + resource_group_name=resource_group.name, + virtual_hard_disk_name="str", + virtual_hard_disks={ + "location": "str", + "blockSizeBytes": 0, + "containerId": "str", + "diskFileFormat": "str", + "diskSizeGB": 0, + "dynamic": bool, + "extendedLocation": {"name": "str", "type": "str"}, + "hyperVGeneration": "str", + "id": "str", + "logicalSectorBytes": 0, + "name": "str", + "physicalSectorBytes": 0, + "provisioningState": "str", + "status": { + "errorCode": "str", + "errorMessage": "str", + "provisioningStatus": {"operationId": "str", "status": "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", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = await ( + await self.client.virtual_hard_disks.begin_delete( + resource_group_name=resource_group.name, + virtual_hard_disk_name="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = await ( + await self.client.virtual_hard_disks.begin_update( + resource_group_name=resource_group.name, + virtual_hard_disk_name="str", + virtual_hard_disks={"tags": {"str": "str"}}, + api_version="2024-01-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.virtual_hard_disks.list( + resource_group_name=resource_group.name, + api_version="2024-01-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_all(self, resource_group): + response = self.client.virtual_hard_disks.list_all( + api_version="2024-01-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_virtual_machine_instances_operations.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_machine_instances_operations.py new file mode 100644 index 000000000000..09cdfe3b96aa --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_machine_instances_operations.py @@ -0,0 +1,210 @@ +# 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 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 TestAzureStackHCIVirtualMachineInstancesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(AzureStackHCIClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_get(self, resource_group): + response = self.client.virtual_machine_instances.get( + resource_uri="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_begin_create_or_update(self, resource_group): + response = self.client.virtual_machine_instances.begin_create_or_update( + resource_uri="str", + virtual_machine_instance={ + "extendedLocation": {"name": "str", "type": "str"}, + "guestAgentInstallStatus": { + "agentVersion": "str", + "errorDetails": [ + { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + } + ], + "lastStatusChange": "2020-02-20 00:00:00", + "status": "str", + "vmUuid": "str", + }, + "hardwareProfile": { + "dynamicMemoryConfig": {"maximumMemoryMB": 0, "minimumMemoryMB": 0, "targetMemoryBuffer": 0}, + "memoryMB": 0, + "processors": 0, + "vmSize": "str", + }, + "httpProxyConfig": {"httpProxy": "str", "httpsProxy": "str", "noProxy": ["str"], "trustedCa": "str"}, + "id": "str", + "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"}, + "instanceView": { + "vmAgent": { + "statuses": [ + { + "code": "str", + "displayStatus": "str", + "level": "str", + "message": "str", + "time": "2020-02-20 00:00:00", + } + ], + "vmConfigAgentVersion": "str", + } + }, + "name": "str", + "networkProfile": {"networkInterfaces": [{"id": "str"}]}, + "osProfile": { + "adminPassword": "str", + "adminUsername": "str", + "computerName": "str", + "linuxConfiguration": { + "disablePasswordAuthentication": bool, + "provisionVMAgent": True, + "provisionVMConfigAgent": True, + "ssh": {"publicKeys": [{"keyData": "str", "path": "str"}]}, + }, + "windowsConfiguration": { + "enableAutomaticUpdates": bool, + "provisionVMAgent": True, + "provisionVMConfigAgent": True, + "ssh": {"publicKeys": [{"keyData": "str", "path": "str"}]}, + "timeZone": "str", + }, + }, + "provisioningState": "str", + "resourceUid": "str", + "securityProfile": { + "enableTPM": False, + "securityType": "str", + "uefiSettings": {"secureBootEnabled": False}, + }, + "status": { + "errorCode": "str", + "errorMessage": "str", + "powerState": "str", + "provisioningStatus": {"operationId": "str", "status": "str"}, + }, + "storageProfile": { + "dataDisks": [{"id": "str"}], + "imageReference": {"id": "str"}, + "osDisk": {"id": "str", "osType": "str"}, + "vmConfigStoragePathId": "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", + "vmId": "str", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = self.client.virtual_machine_instances.begin_delete( + resource_uri="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = self.client.virtual_machine_instances.begin_update( + resource_uri="str", + virtual_machine_instance={ + "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"}, + "properties": { + "hardwareProfile": {"memoryMB": 0, "processors": 0, "vmSize": "str"}, + "networkProfile": {"networkInterfaces": [{"id": "str"}]}, + "osProfile": { + "computerName": "str", + "linuxConfiguration": {"provisionVMAgent": bool, "provisionVMConfigAgent": bool}, + "windowsConfiguration": {"provisionVMAgent": bool, "provisionVMConfigAgent": bool}, + }, + "storageProfile": {"dataDisks": [{"id": "str"}]}, + }, + }, + api_version="2024-01-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_begin_start(self, resource_group): + response = self.client.virtual_machine_instances.begin_start( + resource_uri="str", + api_version="2024-01-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_begin_stop(self, resource_group): + response = self.client.virtual_machine_instances.begin_stop( + resource_uri="str", + api_version="2024-01-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_begin_restart(self, resource_group): + response = self.client.virtual_machine_instances.begin_restart( + resource_uri="str", + api_version="2024-01-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.virtual_machine_instances.list( + resource_uri="str", + api_version="2024-01-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_virtual_machine_instances_operations_async.py b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_machine_instances_operations_async.py new file mode 100644 index 000000000000..190116c5e9ae --- /dev/null +++ b/sdk/azurestackhci/azure-mgmt-azurestackhci/generated_tests/test_azure_stack_hci_virtual_machine_instances_operations_async.py @@ -0,0 +1,228 @@ +# 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 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 TestAzureStackHCIVirtualMachineInstancesOperationsAsync(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_get(self, resource_group): + response = await self.client.virtual_machine_instances.get( + resource_uri="str", + api_version="2024-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_begin_create_or_update(self, resource_group): + response = await ( + await self.client.virtual_machine_instances.begin_create_or_update( + resource_uri="str", + virtual_machine_instance={ + "extendedLocation": {"name": "str", "type": "str"}, + "guestAgentInstallStatus": { + "agentVersion": "str", + "errorDetails": [ + { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + } + ], + "lastStatusChange": "2020-02-20 00:00:00", + "status": "str", + "vmUuid": "str", + }, + "hardwareProfile": { + "dynamicMemoryConfig": {"maximumMemoryMB": 0, "minimumMemoryMB": 0, "targetMemoryBuffer": 0}, + "memoryMB": 0, + "processors": 0, + "vmSize": "str", + }, + "httpProxyConfig": { + "httpProxy": "str", + "httpsProxy": "str", + "noProxy": ["str"], + "trustedCa": "str", + }, + "id": "str", + "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"}, + "instanceView": { + "vmAgent": { + "statuses": [ + { + "code": "str", + "displayStatus": "str", + "level": "str", + "message": "str", + "time": "2020-02-20 00:00:00", + } + ], + "vmConfigAgentVersion": "str", + } + }, + "name": "str", + "networkProfile": {"networkInterfaces": [{"id": "str"}]}, + "osProfile": { + "adminPassword": "str", + "adminUsername": "str", + "computerName": "str", + "linuxConfiguration": { + "disablePasswordAuthentication": bool, + "provisionVMAgent": True, + "provisionVMConfigAgent": True, + "ssh": {"publicKeys": [{"keyData": "str", "path": "str"}]}, + }, + "windowsConfiguration": { + "enableAutomaticUpdates": bool, + "provisionVMAgent": True, + "provisionVMConfigAgent": True, + "ssh": {"publicKeys": [{"keyData": "str", "path": "str"}]}, + "timeZone": "str", + }, + }, + "provisioningState": "str", + "resourceUid": "str", + "securityProfile": { + "enableTPM": False, + "securityType": "str", + "uefiSettings": {"secureBootEnabled": False}, + }, + "status": { + "errorCode": "str", + "errorMessage": "str", + "powerState": "str", + "provisioningStatus": {"operationId": "str", "status": "str"}, + }, + "storageProfile": { + "dataDisks": [{"id": "str"}], + "imageReference": {"id": "str"}, + "osDisk": {"id": "str", "osType": "str"}, + "vmConfigStoragePathId": "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", + "vmId": "str", + }, + api_version="2024-01-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_begin_delete(self, resource_group): + response = await ( + await self.client.virtual_machine_instances.begin_delete( + resource_uri="str", + api_version="2024-01-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_begin_update(self, resource_group): + response = await ( + await self.client.virtual_machine_instances.begin_update( + resource_uri="str", + virtual_machine_instance={ + "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"}, + "properties": { + "hardwareProfile": {"memoryMB": 0, "processors": 0, "vmSize": "str"}, + "networkProfile": {"networkInterfaces": [{"id": "str"}]}, + "osProfile": { + "computerName": "str", + "linuxConfiguration": {"provisionVMAgent": bool, "provisionVMConfigAgent": bool}, + "windowsConfiguration": {"provisionVMAgent": bool, "provisionVMConfigAgent": bool}, + }, + "storageProfile": {"dataDisks": [{"id": "str"}]}, + }, + }, + api_version="2024-01-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_begin_start(self, resource_group): + response = await ( + await self.client.virtual_machine_instances.begin_start( + resource_uri="str", + api_version="2024-01-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_begin_stop(self, resource_group): + response = await ( + await self.client.virtual_machine_instances.begin_stop( + resource_uri="str", + api_version="2024-01-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_begin_restart(self, resource_group): + response = await ( + await self.client.virtual_machine_instances.begin_restart( + resource_uri="str", + api_version="2024-01-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.virtual_machine_instances.list( + resource_uri="str", + api_version="2024-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ...