From 06b49dd6d6e21a7de281dba693582b9659f30aa9 Mon Sep 17 00:00:00 2001 From: "Kaihui (Kerwin) Sun" Date: Thu, 17 Sep 2020 15:32:34 +0800 Subject: [PATCH] generate monitor track2 ga version (#13804) --- sdk/monitor/azure-mgmt-monitor/CHANGELOG.md | 12 + .../azure/mgmt/monitor/__init__.py | 2 +- .../azure/mgmt/monitor/_configuration.py | 5 +- .../azure/mgmt/monitor/_monitor_client.py | 95 ++- .../azure/mgmt/monitor/_version.py | 2 +- .../azure/mgmt/monitor/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 6 +- ...tor_client_async.py => _monitor_client.py} | 261 +++---- .../mgmt/monitor/v2015_04_01/__init__.py | 2 +- .../monitor/v2015_04_01/_configuration.py | 5 +- .../mgmt/monitor/v2015_04_01/_metadata.json | 11 +- .../monitor/v2015_04_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2015_04_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 24 +- .../__init__.py | 10 +- .../_activity_logs_operations.py} | 57 +- .../_autoscale_settings_operations.py} | 70 +- .../_event_categories_operations.py} | 23 +- .../_operations.py} | 10 +- .../_tenant_activity_logs_operations.py} | 65 +- .../monitor/v2015_04_01/models/__init__.py | 5 + .../monitor/v2015_04_01/models/_models.py | 47 ++ .../monitor/v2015_04_01/models/_models_py3.py | 53 ++ .../models/_monitor_client_enums.py | 112 +-- .../operations/_activity_logs_operations.py | 57 +- .../_autoscale_settings_operations.py | 70 +- .../_event_categories_operations.py | 23 +- .../v2015_04_01/operations/_operations.py | 10 +- .../_tenant_activity_logs_operations.py | 65 +- .../mgmt/monitor/v2015_07_01/__init__.py | 2 +- .../monitor/v2015_07_01/_configuration.py | 5 +- .../mgmt/monitor/v2015_07_01/_metadata.json | 11 +- .../monitor/v2015_07_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2015_07_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 8 +- .../__init__.py | 2 +- ...service_diagnostic_settings_operations.py} | 19 +- ..._service_diagnostic_settings_operations.py | 19 +- .../mgmt/monitor/v2016_03_01/__init__.py | 2 +- .../monitor/v2016_03_01/_configuration.py | 5 +- .../mgmt/monitor/v2016_03_01/_metadata.json | 11 +- .../monitor/v2016_03_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2016_03_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 20 +- .../__init__.py | 8 +- .../_alert_rule_incidents_operations.py} | 27 +- .../_alert_rules_operations.py} | 69 +- .../_log_profiles_operations.py} | 50 +- .../_metric_definitions_operations.py} | 29 +- .../monitor/v2016_03_01/models/_models.py | 20 +- .../monitor/v2016_03_01/models/_models_py3.py | 20 +- .../models/_monitor_client_enums.py | 72 +- .../_alert_rule_incidents_operations.py | 27 +- .../operations/_alert_rules_operations.py | 69 +- .../operations/_log_profiles_operations.py | 50 +- .../_metric_definitions_operations.py | 29 +- .../mgmt/monitor/v2016_09_01/__init__.py | 2 +- .../monitor/v2016_09_01/_configuration.py | 5 +- .../mgmt/monitor/v2016_09_01/_metadata.json | 11 +- .../monitor/v2016_09_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2016_09_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 12 +- .../__init__.py | 4 +- .../_metrics_operations.py} | 53 +- ...service_diagnostic_settings_operations.py} | 28 +- .../models/_monitor_client_enums.py | 36 +- .../operations/_metrics_operations.py | 53 +- ..._service_diagnostic_settings_operations.py | 28 +- .../monitor/v2017_03_01_preview/__init__.py | 2 +- .../v2017_03_01_preview/_configuration.py | 5 +- .../v2017_03_01_preview/_metadata.json | 11 +- .../v2017_03_01_preview/_monitor_client.py | 2 +- .../v2017_03_01_preview/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 8 +- .../__init__.py | 2 +- .../_activity_log_alerts_operations.py} | 70 +- .../_activity_log_alerts_operations.py | 70 +- .../mgmt/monitor/v2017_04_01/__init__.py | 2 +- .../monitor/v2017_04_01/_configuration.py | 5 +- .../mgmt/monitor/v2017_04_01/_metadata.json | 11 +- .../monitor/v2017_04_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2017_04_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 12 +- .../__init__.py | 4 +- .../_action_groups_operations.py} | 78 ++- .../_activity_log_alerts_operations.py} | 70 +- .../models/_monitor_client_enums.py | 28 +- .../operations/_action_groups_operations.py | 78 ++- .../_activity_log_alerts_operations.py | 70 +- .../monitor/v2017_05_01_preview/__init__.py | 2 +- .../v2017_05_01_preview/_configuration.py | 5 +- .../v2017_05_01_preview/_metadata.json | 14 +- .../v2017_05_01_preview/_monitor_client.py | 7 +- .../v2017_05_01_preview/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 25 +- .../__init__.py | 10 +- ...iagnostic_settings_category_operations.py} | 18 +- .../_diagnostic_settings_operations.py} | 34 +- .../_metric_definitions_operations.py} | 19 +- .../_metrics_operations.py} | 10 +- ...cription_diagnostic_settings_operations.py | 274 ++++++++ .../v2017_05_01_preview/models/__init__.py | 12 + .../v2017_05_01_preview/models/_models.py | 154 +++++ .../v2017_05_01_preview/models/_models_py3.py | 169 +++++ .../models/_monitor_client_enums.py | 66 +- .../operations/__init__.py | 2 + ...diagnostic_settings_category_operations.py | 18 +- .../_diagnostic_settings_operations.py | 34 +- .../_metric_definitions_operations.py | 19 +- .../operations/_metrics_operations.py | 10 +- ...cription_diagnostic_settings_operations.py | 282 ++++++++ .../monitor/v2017_11_01_preview/__init__.py | 2 +- .../v2017_11_01_preview/_configuration.py | 5 +- .../v2017_11_01_preview/_metadata.json | 11 +- .../v2017_11_01_preview/_monitor_client.py | 2 +- .../v2017_11_01_preview/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 8 +- .../__init__.py | 2 +- .../_metric_baseline_operations.py} | 19 +- .../models/_monitor_client_enums.py | 34 +- .../operations/_metric_baseline_operations.py | 19 +- .../monitor/v2017_12_01_preview/__init__.py | 2 +- .../v2017_12_01_preview/_configuration.py | 5 +- .../v2017_12_01_preview/_metadata.json | 11 +- .../v2017_12_01_preview/_monitor_client.py | 2 +- .../v2017_12_01_preview/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 8 +- .../__init__.py | 2 +- .../_metric_namespaces_operations.py} | 21 +- .../_metric_namespaces_operations.py | 21 +- .../mgmt/monitor/v2018_01_01/__init__.py | 2 +- .../monitor/v2018_01_01/_configuration.py | 5 +- .../mgmt/monitor/v2018_01_01/_metadata.json | 11 +- .../monitor/v2018_01_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2018_01_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 12 +- .../__init__.py | 4 +- .../_metric_definitions_operations.py} | 19 +- .../_metrics_operations.py} | 10 +- .../models/_monitor_client_enums.py | 68 +- .../_metric_definitions_operations.py | 19 +- .../operations/_metrics_operations.py | 10 +- .../mgmt/monitor/v2018_03_01/__init__.py | 2 +- .../monitor/v2018_03_01/_configuration.py | 5 +- .../mgmt/monitor/v2018_03_01/_metadata.json | 11 +- .../monitor/v2018_03_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2018_03_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 16 +- .../__init__.py | 6 +- .../_action_groups_operations.py} | 78 ++- .../_metric_alerts_operations.py} | 67 +- .../_metric_alerts_status_operations.py} | 18 +- .../monitor/v2018_03_01/models/_models.py | 27 +- .../monitor/v2018_03_01/models/_models_py3.py | 34 +- .../models/_monitor_client_enums.py | 84 ++- .../operations/_action_groups_operations.py | 78 ++- .../operations/_metric_alerts_operations.py | 67 +- .../_metric_alerts_status_operations.py | 18 +- .../mgmt/monitor/v2018_04_16/__init__.py | 2 +- .../monitor/v2018_04_16/_configuration.py | 5 +- .../mgmt/monitor/v2018_04_16/_metadata.json | 11 +- .../monitor/v2018_04_16/_monitor_client.py | 2 +- .../mgmt/monitor/v2018_04_16/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 8 +- .../__init__.py | 2 +- .../_scheduled_query_rules_operations.py} | 74 +- .../monitor/v2018_04_16/models/__init__.py | 4 + .../monitor/v2018_04_16/models/_models.py | 27 +- .../monitor/v2018_04_16/models/_models_py3.py | 29 +- .../models/_monitor_client_enums.py | 74 +- .../_scheduled_query_rules_operations.py | 74 +- .../monitor/v2018_06_01_preview/__init__.py | 2 +- .../v2018_06_01_preview/_configuration.py | 5 +- .../v2018_06_01_preview/_metadata.json | 11 +- .../v2018_06_01_preview/_monitor_client.py | 2 +- .../v2018_06_01_preview/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 12 +- .../__init__.py | 4 +- ...ostics_settings_association_operations.py} | 70 +- ..._guest_diagnostics_settings_operations.py} | 71 +- .../models/_monitor_client_enums.py | 42 +- ...nostics_settings_association_operations.py | 70 +- .../_guest_diagnostics_settings_operations.py | 71 +- .../mgmt/monitor/v2018_09_01/__init__.py | 2 +- .../monitor/v2018_09_01/_configuration.py | 5 +- .../mgmt/monitor/v2018_09_01/_metadata.json | 11 +- .../monitor/v2018_09_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2018_09_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 16 +- .../__init__.py | 6 +- .../_action_groups_operations.py} | 78 ++- .../_baseline_operations.py} | 10 +- .../_metric_baseline_operations.py} | 19 +- .../models/_monitor_client_enums.py | 42 +- .../operations/_action_groups_operations.py | 78 ++- .../operations/_baseline_operations.py | 10 +- .../operations/_metric_baseline_operations.py | 19 +- .../monitor/v2018_11_27_preview/__init__.py | 2 +- .../v2018_11_27_preview/_configuration.py | 5 +- .../v2018_11_27_preview/_metadata.json | 11 +- .../v2018_11_27_preview/_monitor_client.py | 2 +- .../v2018_11_27_preview/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 8 +- .../__init__.py | 2 +- .../_vm_insights_operations.py} | 10 +- .../models/_monitor_client_enums.py | 34 +- .../operations/_vm_insights_operations.py | 10 +- .../mgmt/monitor/v2019_03_01/__init__.py | 2 +- .../monitor/v2019_03_01/_configuration.py | 5 +- .../mgmt/monitor/v2019_03_01/_metadata.json | 11 +- .../monitor/v2019_03_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2019_03_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 12 +- .../__init__.py | 4 +- .../_action_groups_operations.py} | 78 ++- .../_baselines_operations.py} | 39 +- .../models/_monitor_client_enums.py | 42 +- .../operations/_action_groups_operations.py | 78 ++- .../operations/_baselines_operations.py | 39 +- .../mgmt/monitor/v2019_06_01/__init__.py | 2 +- .../monitor/v2019_06_01/_configuration.py | 5 +- .../mgmt/monitor/v2019_06_01/_metadata.json | 11 +- .../monitor/v2019_06_01/_monitor_client.py | 2 +- .../mgmt/monitor/v2019_06_01/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 8 +- .../__init__.py | 2 +- .../_action_groups_operations.py} | 78 ++- .../models/_monitor_client_enums.py | 28 +- .../operations/_action_groups_operations.py | 78 ++- .../mgmt/monitor/v2019_10_17/__init__.py | 2 +- .../monitor/v2019_10_17/_configuration.py | 5 +- .../mgmt/monitor/v2019_10_17/_metadata.json | 11 +- .../monitor/v2019_10_17/_monitor_client.py | 1 + .../mgmt/monitor/v2019_10_17/aio/__init__.py | 2 +- ...nfiguration_async.py => _configuration.py} | 5 +- ...tor_client_async.py => _monitor_client.py} | 23 +- .../__init__.py | 10 +- ...rivate_endpoint_connections_operations.py} | 57 +- .../_private_link_resources_operations.py} | 27 +- ...link_scope_operation_status_operations.py} | 10 +- ...ivate_link_scoped_resources_operations.py} | 57 +- .../_private_link_scopes_operations.py} | 74 +- ...private_endpoint_connections_operations.py | 49 +- .../_private_link_resources_operations.py | 27 +- ..._link_scope_operation_status_operations.py | 10 +- ...rivate_link_scoped_resources_operations.py | 49 +- .../_private_link_scopes_operations.py | 70 +- .../monitor/v2020_01_01_preview/__init__.py | 16 + .../v2020_01_01_preview/_configuration.py | 64 ++ .../v2020_01_01_preview/_metadata.json | 48 ++ .../v2020_01_01_preview/_monitor_client.py | 66 ++ .../v2020_01_01_preview/aio/__init__.py | 10 + .../v2020_01_01_preview/aio/_configuration.py | 60 ++ .../aio/_monitor_client.py | 60 ++ .../aio/operations/__init__.py | 13 + ...nt_group_diagnostic_settings_operations.py | 291 ++++++++ .../v2020_01_01_preview/models/__init__.py | 28 + .../v2020_01_01_preview/models/_models.py | 189 +++++ .../v2020_01_01_preview/models/_models_py3.py | 209 ++++++ .../operations/__init__.py | 13 + ...nt_group_diagnostic_settings_operations.py | 299 ++++++++ .../mgmt/monitor/v2020_01_01_preview/py.typed | 1 + ...t_cli_mgmt_monitor.test_action_groups.yaml | 30 +- ...mgmt_monitor.test_activity_log_alerts.yaml | 28 +- ..._mgmt_monitor.test_autoscale_settings.yaml | 302 ++++---- ...st_cli_mgmt_monitor.test_log_profiles.yaml | 122 +--- ...t_cli_mgmt_monitor.test_metric_alerts.yaml | 645 +++++++++++++----- ...itor.test_monitor_diagnostic_settings.yaml | 195 +++--- ...mt_monitor.test_scheduled_query_rules.yaml | 127 +++- ...sync.test_monitor_diagnostic_settings.yaml | 244 ++++--- 287 files changed, 6745 insertions(+), 2984 deletions(-) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/{_monitor_client_async.py => _monitor_client.py} (65%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/{_monitor_client_async.py => _monitor_client.py} (82%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/{operations_async => operations}/__init__.py (65%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/{operations_async/_activity_logs_operations_async.py => operations/_activity_logs_operations.py} (68%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/{operations_async/_autoscale_settings_operations_async.py => operations/_autoscale_settings_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/{operations_async/_event_categories_operations_async.py => operations/_event_categories_operations.py} (85%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/{operations_async/_operations_async.py => operations/_operations.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/{operations_async/_tenant_activity_logs_operations_async.py => operations/_tenant_activity_logs_operations.py} (64%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/{_configuration_async.py => _configuration.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/{_monitor_client_async.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/{operations_async => operations}/__init__.py (84%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/{operations_async/_service_diagnostic_settings_operations_async.py => operations/_service_diagnostic_settings_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/{_monitor_client_async.py => _monitor_client.py} (83%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/{operations_async => operations}/__init__.py (67%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/{operations_async/_alert_rule_incidents_operations_async.py => operations/_alert_rule_incidents_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/{operations_async/_alert_rules_operations_async.py => operations/_alert_rules_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/{operations_async/_log_profiles_operations_async.py => operations/_log_profiles_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/{operations_async/_metric_definitions_operations_async.py => operations/_metric_definitions_operations.py} (83%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/{_configuration_async.py => _configuration.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/{_monitor_client_async.py => _monitor_client.py} (85%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/{operations_async => operations}/__init__.py (78%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/{operations_async/_metrics_operations_async.py => operations/_metrics_operations.py} (69%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/{operations_async/_service_diagnostic_settings_operations_async.py => operations/_service_diagnostic_settings_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/{_monitor_client_async.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/{operations_async => operations}/__init__.py (86%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/{operations_async/_activity_log_alerts_operations_async.py => operations/_activity_log_alerts_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/{_monitor_client_async.py => _monitor_client.py} (86%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/{operations_async => operations}/__init__.py (78%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/{operations_async/_action_groups_operations_async.py => operations/_action_groups_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/{operations_async/_activity_log_alerts_operations_async.py => operations/_activity_log_alerts_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/{_configuration_async.py => _configuration.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/{_monitor_client_async.py => _monitor_client.py} (74%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/{operations_async => operations}/__init__.py (58%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/{operations_async/_diagnostic_settings_category_operations_async.py => operations/_diagnostic_settings_category_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/{operations_async/_diagnostic_settings_operations_async.py => operations/_diagnostic_settings_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/{operations_async/_metric_definitions_operations_async.py => operations/_metric_definitions_operations.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/{operations_async/_metrics_operations_async.py => operations/_metrics_operations.py} (94%) create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_subscription_diagnostic_settings_operations.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_subscription_diagnostic_settings_operations.py rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/{_configuration_async.py => _configuration.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/{_monitor_client_async.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/{operations_async => operations}/__init__.py (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/{operations_async/_metric_baseline_operations_async.py => operations/_metric_baseline_operations.py} (93%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/{_configuration_async.py => _configuration.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/{_monitor_client_async.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/{operations_async => operations}/__init__.py (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/{operations_async/_metric_namespaces_operations_async.py => operations/_metric_namespaces_operations.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/{_configuration_async.py => _configuration.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/{_monitor_client_async.py => _monitor_client.py} (86%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/{operations_async => operations}/__init__.py (80%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/{operations_async/_metric_definitions_operations_async.py => operations/_metric_definitions_operations.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/{operations_async/_metrics_operations_async.py => operations/_metrics_operations.py} (95%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/{_monitor_client_async.py => _monitor_client.py} (84%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/{operations_async => operations}/__init__.py (72%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/{operations_async/_action_groups_operations_async.py => operations/_action_groups_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/{operations_async/_metric_alerts_operations_async.py => operations/_metric_alerts_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/{operations_async/_metric_alerts_status_operations_async.py => operations/_metric_alerts_status_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/{_monitor_client_async.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/{operations_async => operations}/__init__.py (86%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/{operations_async/_scheduled_query_rules_operations_async.py => operations/_scheduled_query_rules_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/{_monitor_client_async.py => _monitor_client.py} (84%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/{operations_async => operations}/__init__.py (73%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/{operations_async/_guest_diagnostics_settings_association_operations_async.py => operations/_guest_diagnostics_settings_association_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/{operations_async/_guest_diagnostics_settings_operations_async.py => operations/_guest_diagnostics_settings_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/{_monitor_client_async.py => _monitor_client.py} (85%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/{operations_async => operations}/__init__.py (74%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/{operations_async/_action_groups_operations_async.py => operations/_action_groups_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/{operations_async/_baseline_operations_async.py => operations/_baseline_operations.py} (94%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/{operations_async/_metric_baseline_operations_async.py => operations/_metric_baseline_operations.py} (94%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/{_configuration_async.py => _configuration.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/{_monitor_client_async.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/{operations_async => operations}/__init__.py (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/{operations_async/_vm_insights_operations_async.py => operations/_vm_insights_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/{_monitor_client_async.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/{operations_async => operations}/__init__.py (80%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/{operations_async/_action_groups_operations_async.py => operations/_action_groups_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/{operations_async/_baselines_operations_async.py => operations/_baselines_operations.py} (83%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/{_monitor_client_async.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/{operations_async => operations}/__init__.py (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/{operations_async/_action_groups_operations_async.py => operations/_action_groups_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/{_configuration_async.py => _configuration.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/{_monitor_client_async.py => _monitor_client.py} (83%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/{operations_async => operations}/__init__.py (59%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/{operations_async/_private_endpoint_connections_operations_async.py => operations/_private_endpoint_connections_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/{operations_async/_private_link_resources_operations_async.py => operations/_private_link_resources_operations.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/{operations_async/_private_link_scope_operation_status_operations_async.py => operations/_private_link_scope_operation_status_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/{operations_async/_private_link_scoped_resources_operations_async.py => operations/_private_link_scoped_resources_operations.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/{operations_async/_private_link_scopes_operations_async.py => operations/_private_link_scopes_operations.py} (91%) create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/__init__.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_configuration.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_metadata.json create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/__init__.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_configuration.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/__init__.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/_management_group_diagnostic_settings_operations.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/__init__.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models_py3.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/__init__.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/_management_group_diagnostic_settings_operations.py create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/py.typed diff --git a/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md b/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md index 8390be1cba7e0..e0b8a0779c574 100644 --- a/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md +++ b/sdk/monitor/azure-mgmt-monitor/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 1.0.0 (2020-09-16) + +**Features** + + - Model MultiMetricCriteria has a new parameter skip_metric_validation + - Model DynamicMetricCriteria has a new parameter skip_metric_validation + - Model MetricTrigger has a new parameter dimensions + - Model MetricTrigger has a new parameter metric_namespace + - Model MetricCriteria has a new parameter skip_metric_validation + - Added operation group SubscriptionDiagnosticSettingsOperations + - Added operation group ManagementGroupDiagnosticSettingsOperations + ## 1.0.0b1 (2020-06-17) This is beta preview version. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py index aa98b4dc123b9..210f8cfcbcc6c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py @@ -12,6 +12,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy from ._version import VERSION @@ -43,8 +44,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py index 10f7fb847c536..4514d1bbbc92e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py @@ -74,6 +74,7 @@ class MonitorClient(MultiApiClientMixin, _SDKClient): 'operations': '2015-04-01', 'scheduled_query_rules': '2018-04-16', 'service_diagnostic_settings': '2016-09-01', + 'subscription_diagnostic_settings': '2017-05-01-preview', 'tenant_activity_logs': '2015-04-01', 'vm_insights': '2018-11-27-preview', }}, @@ -94,8 +95,6 @@ def __init__( self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(MonitorClient, self).__init__( - credential, - self._config, api_version=api_version, profile=profile ) @@ -126,6 +125,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-03-01: :mod:`v2019_03_01.models` * 2019-06-01: :mod:`v2019_06_01.models` * 2019-10-17-preview: :mod:`v2019_10_17.models` + * 2020-01-01-preview: :mod:`v2020_01_01_preview.models` """ if api_version == '2015-04-01': from .v2015_04_01 import models @@ -181,7 +181,10 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-10-17-preview': from .v2019_10_17 import models return models - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + elif api_version == '2020-01-01-preview': + from .v2020_01_01_preview import models + return models + raise ValueError("API version {} is not available".format(api_version)) @property def action_groups(self): @@ -205,7 +208,7 @@ def action_groups(self): elif api_version == '2019-06-01': from .v2019_06_01.operations import ActionGroupsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'action_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -221,7 +224,7 @@ def activity_log_alerts(self): elif api_version == '2017-04-01': from .v2017_04_01.operations import ActivityLogAlertsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'activity_log_alerts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -234,7 +237,7 @@ def activity_logs(self): if api_version == '2015-04-01': from .v2015_04_01.operations import ActivityLogsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'activity_logs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -247,7 +250,7 @@ def alert_rule_incidents(self): if api_version == '2016-03-01': from .v2016_03_01.operations import AlertRuleIncidentsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'alert_rule_incidents'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -260,7 +263,7 @@ def alert_rules(self): if api_version == '2016-03-01': from .v2016_03_01.operations import AlertRulesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'alert_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -273,7 +276,7 @@ def autoscale_settings(self): if api_version == '2015-04-01': from .v2015_04_01.operations import AutoscaleSettingsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'autoscale_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -286,7 +289,7 @@ def baseline(self): if api_version == '2018-09-01': from .v2018_09_01.operations import BaselineOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'baseline'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -299,7 +302,7 @@ def baselines(self): if api_version == '2019-03-01': from .v2019_03_01.operations import BaselinesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'baselines'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -312,7 +315,7 @@ def diagnostic_settings(self): if api_version == '2017-05-01-preview': from .v2017_05_01_preview.operations import DiagnosticSettingsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'diagnostic_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -325,7 +328,7 @@ def diagnostic_settings_category(self): if api_version == '2017-05-01-preview': from .v2017_05_01_preview.operations import DiagnosticSettingsCategoryOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'diagnostic_settings_category'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -338,7 +341,7 @@ def event_categories(self): if api_version == '2015-04-01': from .v2015_04_01.operations import EventCategoriesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'event_categories'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -351,7 +354,7 @@ def guest_diagnostics_settings(self): if api_version == '2018-06-01-preview': from .v2018_06_01_preview.operations import GuestDiagnosticsSettingsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'guest_diagnostics_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -364,7 +367,7 @@ def guest_diagnostics_settings_association(self): if api_version == '2018-06-01-preview': from .v2018_06_01_preview.operations import GuestDiagnosticsSettingsAssociationOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'guest_diagnostics_settings_association'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -377,7 +380,20 @@ def log_profiles(self): if api_version == '2016-03-01': from .v2016_03_01.operations import LogProfilesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'log_profiles'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def management_group_diagnostic_settings(self): + """Instance depends on the API version: + + * 2020-01-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations` + """ + api_version = self._get_api_version('management_group_diagnostic_settings') + if api_version == '2020-01-01-preview': + from .v2020_01_01_preview.operations import ManagementGroupDiagnosticSettingsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'management_group_diagnostic_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -390,7 +406,7 @@ def metric_alerts(self): if api_version == '2018-03-01': from .v2018_03_01.operations import MetricAlertsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_alerts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -403,7 +419,7 @@ def metric_alerts_status(self): if api_version == '2018-03-01': from .v2018_03_01.operations import MetricAlertsStatusOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_alerts_status'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -419,7 +435,7 @@ def metric_baseline(self): elif api_version == '2018-09-01': from .v2018_09_01.operations import MetricBaselineOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_baseline'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -438,7 +454,7 @@ def metric_definitions(self): elif api_version == '2018-01-01': from .v2018_01_01.operations import MetricDefinitionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_definitions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -451,7 +467,7 @@ def metric_namespaces(self): if api_version == '2017-12-01-preview': from .v2017_12_01_preview.operations import MetricNamespacesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_namespaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -470,7 +486,7 @@ def metrics(self): elif api_version == '2018-01-01': from .v2018_01_01.operations import MetricsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metrics'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -483,7 +499,7 @@ def operations(self): if api_version == '2015-04-01': from .v2015_04_01.operations import Operations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -496,7 +512,7 @@ def private_endpoint_connections(self): if api_version == '2019-10-17-preview': from .v2019_10_17.operations import PrivateEndpointConnectionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -509,7 +525,7 @@ def private_link_resources(self): if api_version == '2019-10-17-preview': from .v2019_10_17.operations import PrivateLinkResourcesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -522,7 +538,7 @@ def private_link_scope_operation_status(self): if api_version == '2019-10-17-preview': from .v2019_10_17.operations import PrivateLinkScopeOperationStatusOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_link_scope_operation_status'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -535,7 +551,7 @@ def private_link_scoped_resources(self): if api_version == '2019-10-17-preview': from .v2019_10_17.operations import PrivateLinkScopedResourcesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_link_scoped_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -548,7 +564,7 @@ def private_link_scopes(self): if api_version == '2019-10-17-preview': from .v2019_10_17.operations import PrivateLinkScopesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_link_scopes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -561,7 +577,7 @@ def scheduled_query_rules(self): if api_version == '2018-04-16': from .v2018_04_16.operations import ScheduledQueryRulesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'scheduled_query_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -577,7 +593,20 @@ def service_diagnostic_settings(self): elif api_version == '2016-09-01': from .v2016_09_01.operations import ServiceDiagnosticSettingsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'service_diagnostic_settings'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def subscription_diagnostic_settings(self): + """Instance depends on the API version: + + * 2017-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations` + """ + api_version = self._get_api_version('subscription_diagnostic_settings') + if api_version == '2017-05-01-preview': + from .v2017_05_01_preview.operations import SubscriptionDiagnosticSettingsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'subscription_diagnostic_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -590,7 +619,7 @@ def tenant_activity_logs(self): if api_version == '2015-04-01': from .v2015_04_01.operations import TenantActivityLogsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'tenant_activity_logs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property @@ -603,7 +632,7 @@ def vm_insights(self): if api_version == '2018-11-27-preview': from .v2018_11_27_preview.operations import VMInsightsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'vm_insights'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) def close(self): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_version.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_version.py index ebf1f4359fb11..7e05f29c98ec3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_version.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" \ No newline at end of file +VERSION = "1.0.0" \ No newline at end of file diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py index 99cec22685358..fe15f823d1a5a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py @@ -12,6 +12,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy from .._version import VERSION @@ -34,7 +35,6 @@ def __init__( subscription_id, # type: str **kwargs # type: Any ) -> None: - # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -43,8 +43,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'azure-mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -56,6 +55,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py similarity index 65% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py index ba3066bf38de6..0eee1823d96ec 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py @@ -14,7 +14,7 @@ from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin -from ._configuration_async import MonitorClientConfiguration +from ._configuration import MonitorClientConfiguration class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -74,6 +74,7 @@ class MonitorClient(MultiApiClientMixin, _SDKClient): 'operations': '2015-04-01', 'scheduled_query_rules': '2018-04-16', 'service_diagnostic_settings': '2016-09-01', + 'subscription_diagnostic_settings': '2017-05-01-preview', 'tenant_activity_logs': '2015-04-01', 'vm_insights': '2018-11-27-preview', }}, @@ -94,8 +95,6 @@ def __init__( self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) super(MonitorClient, self).__init__( - credential, - self._config, api_version=api_version, profile=profile ) @@ -126,6 +125,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2019-03-01: :mod:`v2019_03_01.models` * 2019-06-01: :mod:`v2019_06_01.models` * 2019-10-17-preview: :mod:`v2019_10_17.models` + * 2020-01-01-preview: :mod:`v2020_01_01_preview.models` """ if api_version == '2015-04-01': from ..v2015_04_01 import models @@ -181,429 +181,458 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2019-10-17-preview': from ..v2019_10_17 import models return models - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + elif api_version == '2020-01-01-preview': + from ..v2020_01_01_preview import models + return models + raise ValueError("API version {} is not available".format(api_version)) @property def action_groups(self): """Instance depends on the API version: - * 2017-04-01: :class:`ActionGroupsOperations` - * 2018-03-01: :class:`ActionGroupsOperations` - * 2018-09-01: :class:`ActionGroupsOperations` - * 2019-03-01: :class:`ActionGroupsOperations` - * 2019-06-01: :class:`ActionGroupsOperations` + * 2017-04-01: :class:`ActionGroupsOperations` + * 2018-03-01: :class:`ActionGroupsOperations` + * 2018-09-01: :class:`ActionGroupsOperations` + * 2019-03-01: :class:`ActionGroupsOperations` + * 2019-06-01: :class:`ActionGroupsOperations` """ api_version = self._get_api_version('action_groups') if api_version == '2017-04-01': - from ..v2017_04_01.aio.operations_async import ActionGroupsOperations as OperationClass + from ..v2017_04_01.aio.operations import ActionGroupsOperations as OperationClass elif api_version == '2018-03-01': - from ..v2018_03_01.aio.operations_async import ActionGroupsOperations as OperationClass + from ..v2018_03_01.aio.operations import ActionGroupsOperations as OperationClass elif api_version == '2018-09-01': - from ..v2018_09_01.aio.operations_async import ActionGroupsOperations as OperationClass + from ..v2018_09_01.aio.operations import ActionGroupsOperations as OperationClass elif api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import ActionGroupsOperations as OperationClass + from ..v2019_03_01.aio.operations import ActionGroupsOperations as OperationClass elif api_version == '2019-06-01': - from ..v2019_06_01.aio.operations_async import ActionGroupsOperations as OperationClass + from ..v2019_06_01.aio.operations import ActionGroupsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'action_groups'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def activity_log_alerts(self): """Instance depends on the API version: - * 2017-03-01-preview: :class:`ActivityLogAlertsOperations` - * 2017-04-01: :class:`ActivityLogAlertsOperations` + * 2017-03-01-preview: :class:`ActivityLogAlertsOperations` + * 2017-04-01: :class:`ActivityLogAlertsOperations` """ api_version = self._get_api_version('activity_log_alerts') if api_version == '2017-03-01-preview': - from ..v2017_03_01_preview.aio.operations_async import ActivityLogAlertsOperations as OperationClass + from ..v2017_03_01_preview.aio.operations import ActivityLogAlertsOperations as OperationClass elif api_version == '2017-04-01': - from ..v2017_04_01.aio.operations_async import ActivityLogAlertsOperations as OperationClass + from ..v2017_04_01.aio.operations import ActivityLogAlertsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'activity_log_alerts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def activity_logs(self): """Instance depends on the API version: - * 2015-04-01: :class:`ActivityLogsOperations` + * 2015-04-01: :class:`ActivityLogsOperations` """ api_version = self._get_api_version('activity_logs') if api_version == '2015-04-01': - from ..v2015_04_01.aio.operations_async import ActivityLogsOperations as OperationClass + from ..v2015_04_01.aio.operations import ActivityLogsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'activity_logs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def alert_rule_incidents(self): """Instance depends on the API version: - * 2016-03-01: :class:`AlertRuleIncidentsOperations` + * 2016-03-01: :class:`AlertRuleIncidentsOperations` """ api_version = self._get_api_version('alert_rule_incidents') if api_version == '2016-03-01': - from ..v2016_03_01.aio.operations_async import AlertRuleIncidentsOperations as OperationClass + from ..v2016_03_01.aio.operations import AlertRuleIncidentsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'alert_rule_incidents'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def alert_rules(self): """Instance depends on the API version: - * 2016-03-01: :class:`AlertRulesOperations` + * 2016-03-01: :class:`AlertRulesOperations` """ api_version = self._get_api_version('alert_rules') if api_version == '2016-03-01': - from ..v2016_03_01.aio.operations_async import AlertRulesOperations as OperationClass + from ..v2016_03_01.aio.operations import AlertRulesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'alert_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def autoscale_settings(self): """Instance depends on the API version: - * 2015-04-01: :class:`AutoscaleSettingsOperations` + * 2015-04-01: :class:`AutoscaleSettingsOperations` """ api_version = self._get_api_version('autoscale_settings') if api_version == '2015-04-01': - from ..v2015_04_01.aio.operations_async import AutoscaleSettingsOperations as OperationClass + from ..v2015_04_01.aio.operations import AutoscaleSettingsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'autoscale_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def baseline(self): """Instance depends on the API version: - * 2018-09-01: :class:`BaselineOperations` + * 2018-09-01: :class:`BaselineOperations` """ api_version = self._get_api_version('baseline') if api_version == '2018-09-01': - from ..v2018_09_01.aio.operations_async import BaselineOperations as OperationClass + from ..v2018_09_01.aio.operations import BaselineOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'baseline'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def baselines(self): """Instance depends on the API version: - * 2019-03-01: :class:`BaselinesOperations` + * 2019-03-01: :class:`BaselinesOperations` """ api_version = self._get_api_version('baselines') if api_version == '2019-03-01': - from ..v2019_03_01.aio.operations_async import BaselinesOperations as OperationClass + from ..v2019_03_01.aio.operations import BaselinesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'baselines'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def diagnostic_settings(self): """Instance depends on the API version: - * 2017-05-01-preview: :class:`DiagnosticSettingsOperations` + * 2017-05-01-preview: :class:`DiagnosticSettingsOperations` """ api_version = self._get_api_version('diagnostic_settings') if api_version == '2017-05-01-preview': - from ..v2017_05_01_preview.aio.operations_async import DiagnosticSettingsOperations as OperationClass + from ..v2017_05_01_preview.aio.operations import DiagnosticSettingsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'diagnostic_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def diagnostic_settings_category(self): """Instance depends on the API version: - * 2017-05-01-preview: :class:`DiagnosticSettingsCategoryOperations` + * 2017-05-01-preview: :class:`DiagnosticSettingsCategoryOperations` """ api_version = self._get_api_version('diagnostic_settings_category') if api_version == '2017-05-01-preview': - from ..v2017_05_01_preview.aio.operations_async import DiagnosticSettingsCategoryOperations as OperationClass + from ..v2017_05_01_preview.aio.operations import DiagnosticSettingsCategoryOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'diagnostic_settings_category'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def event_categories(self): """Instance depends on the API version: - * 2015-04-01: :class:`EventCategoriesOperations` + * 2015-04-01: :class:`EventCategoriesOperations` """ api_version = self._get_api_version('event_categories') if api_version == '2015-04-01': - from ..v2015_04_01.aio.operations_async import EventCategoriesOperations as OperationClass + from ..v2015_04_01.aio.operations import EventCategoriesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'event_categories'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def guest_diagnostics_settings(self): """Instance depends on the API version: - * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsOperations` + * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsOperations` """ api_version = self._get_api_version('guest_diagnostics_settings') if api_version == '2018-06-01-preview': - from ..v2018_06_01_preview.aio.operations_async import GuestDiagnosticsSettingsOperations as OperationClass + from ..v2018_06_01_preview.aio.operations import GuestDiagnosticsSettingsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'guest_diagnostics_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def guest_diagnostics_settings_association(self): """Instance depends on the API version: - * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsAssociationOperations` + * 2018-06-01-preview: :class:`GuestDiagnosticsSettingsAssociationOperations` """ api_version = self._get_api_version('guest_diagnostics_settings_association') if api_version == '2018-06-01-preview': - from ..v2018_06_01_preview.aio.operations_async import GuestDiagnosticsSettingsAssociationOperations as OperationClass + from ..v2018_06_01_preview.aio.operations import GuestDiagnosticsSettingsAssociationOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'guest_diagnostics_settings_association'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def log_profiles(self): """Instance depends on the API version: - * 2016-03-01: :class:`LogProfilesOperations` + * 2016-03-01: :class:`LogProfilesOperations` """ api_version = self._get_api_version('log_profiles') if api_version == '2016-03-01': - from ..v2016_03_01.aio.operations_async import LogProfilesOperations as OperationClass + from ..v2016_03_01.aio.operations import LogProfilesOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'log_profiles'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def management_group_diagnostic_settings(self): + """Instance depends on the API version: + + * 2020-01-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations` + """ + api_version = self._get_api_version('management_group_diagnostic_settings') + if api_version == '2020-01-01-preview': + from ..v2020_01_01_preview.aio.operations import ManagementGroupDiagnosticSettingsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'management_group_diagnostic_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def metric_alerts(self): """Instance depends on the API version: - * 2018-03-01: :class:`MetricAlertsOperations` + * 2018-03-01: :class:`MetricAlertsOperations` """ api_version = self._get_api_version('metric_alerts') if api_version == '2018-03-01': - from ..v2018_03_01.aio.operations_async import MetricAlertsOperations as OperationClass + from ..v2018_03_01.aio.operations import MetricAlertsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_alerts'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def metric_alerts_status(self): """Instance depends on the API version: - * 2018-03-01: :class:`MetricAlertsStatusOperations` + * 2018-03-01: :class:`MetricAlertsStatusOperations` """ api_version = self._get_api_version('metric_alerts_status') if api_version == '2018-03-01': - from ..v2018_03_01.aio.operations_async import MetricAlertsStatusOperations as OperationClass + from ..v2018_03_01.aio.operations import MetricAlertsStatusOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_alerts_status'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def metric_baseline(self): """Instance depends on the API version: - * 2017-11-01-preview: :class:`MetricBaselineOperations` - * 2018-09-01: :class:`MetricBaselineOperations` + * 2017-11-01-preview: :class:`MetricBaselineOperations` + * 2018-09-01: :class:`MetricBaselineOperations` """ api_version = self._get_api_version('metric_baseline') if api_version == '2017-11-01-preview': - from ..v2017_11_01_preview.aio.operations_async import MetricBaselineOperations as OperationClass + from ..v2017_11_01_preview.aio.operations import MetricBaselineOperations as OperationClass elif api_version == '2018-09-01': - from ..v2018_09_01.aio.operations_async import MetricBaselineOperations as OperationClass + from ..v2018_09_01.aio.operations import MetricBaselineOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_baseline'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def metric_definitions(self): """Instance depends on the API version: - * 2016-03-01: :class:`MetricDefinitionsOperations` - * 2017-05-01-preview: :class:`MetricDefinitionsOperations` - * 2018-01-01: :class:`MetricDefinitionsOperations` + * 2016-03-01: :class:`MetricDefinitionsOperations` + * 2017-05-01-preview: :class:`MetricDefinitionsOperations` + * 2018-01-01: :class:`MetricDefinitionsOperations` """ api_version = self._get_api_version('metric_definitions') if api_version == '2016-03-01': - from ..v2016_03_01.aio.operations_async import MetricDefinitionsOperations as OperationClass + from ..v2016_03_01.aio.operations import MetricDefinitionsOperations as OperationClass elif api_version == '2017-05-01-preview': - from ..v2017_05_01_preview.aio.operations_async import MetricDefinitionsOperations as OperationClass + from ..v2017_05_01_preview.aio.operations import MetricDefinitionsOperations as OperationClass elif api_version == '2018-01-01': - from ..v2018_01_01.aio.operations_async import MetricDefinitionsOperations as OperationClass + from ..v2018_01_01.aio.operations import MetricDefinitionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_definitions'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def metric_namespaces(self): """Instance depends on the API version: - * 2017-12-01-preview: :class:`MetricNamespacesOperations` + * 2017-12-01-preview: :class:`MetricNamespacesOperations` """ api_version = self._get_api_version('metric_namespaces') if api_version == '2017-12-01-preview': - from ..v2017_12_01_preview.aio.operations_async import MetricNamespacesOperations as OperationClass + from ..v2017_12_01_preview.aio.operations import MetricNamespacesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metric_namespaces'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def metrics(self): """Instance depends on the API version: - * 2016-09-01: :class:`MetricsOperations` - * 2017-05-01-preview: :class:`MetricsOperations` - * 2018-01-01: :class:`MetricsOperations` + * 2016-09-01: :class:`MetricsOperations` + * 2017-05-01-preview: :class:`MetricsOperations` + * 2018-01-01: :class:`MetricsOperations` """ api_version = self._get_api_version('metrics') if api_version == '2016-09-01': - from ..v2016_09_01.aio.operations_async import MetricsOperations as OperationClass + from ..v2016_09_01.aio.operations import MetricsOperations as OperationClass elif api_version == '2017-05-01-preview': - from ..v2017_05_01_preview.aio.operations_async import MetricsOperations as OperationClass + from ..v2017_05_01_preview.aio.operations import MetricsOperations as OperationClass elif api_version == '2018-01-01': - from ..v2018_01_01.aio.operations_async import MetricsOperations as OperationClass + from ..v2018_01_01.aio.operations import MetricsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'metrics'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def operations(self): """Instance depends on the API version: - * 2015-04-01: :class:`Operations` + * 2015-04-01: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2015-04-01': - from ..v2015_04_01.aio.operations_async import Operations as OperationClass + from ..v2015_04_01.aio.operations import Operations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def private_endpoint_connections(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateEndpointConnectionsOperations` + * 2019-10-17-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2019-10-17-preview': - from ..v2019_10_17.aio.operations_async import PrivateEndpointConnectionsOperations as OperationClass + from ..v2019_10_17.aio.operations import PrivateEndpointConnectionsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def private_link_resources(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkResourcesOperations` + * 2019-10-17-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2019-10-17-preview': - from ..v2019_10_17.aio.operations_async import PrivateLinkResourcesOperations as OperationClass + from ..v2019_10_17.aio.operations import PrivateLinkResourcesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def private_link_scope_operation_status(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkScopeOperationStatusOperations` + * 2019-10-17-preview: :class:`PrivateLinkScopeOperationStatusOperations` """ api_version = self._get_api_version('private_link_scope_operation_status') if api_version == '2019-10-17-preview': - from ..v2019_10_17.aio.operations_async import PrivateLinkScopeOperationStatusOperations as OperationClass + from ..v2019_10_17.aio.operations import PrivateLinkScopeOperationStatusOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_link_scope_operation_status'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def private_link_scoped_resources(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkScopedResourcesOperations` + * 2019-10-17-preview: :class:`PrivateLinkScopedResourcesOperations` """ api_version = self._get_api_version('private_link_scoped_resources') if api_version == '2019-10-17-preview': - from ..v2019_10_17.aio.operations_async import PrivateLinkScopedResourcesOperations as OperationClass + from ..v2019_10_17.aio.operations import PrivateLinkScopedResourcesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_link_scoped_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def private_link_scopes(self): """Instance depends on the API version: - * 2019-10-17-preview: :class:`PrivateLinkScopesOperations` + * 2019-10-17-preview: :class:`PrivateLinkScopesOperations` """ api_version = self._get_api_version('private_link_scopes') if api_version == '2019-10-17-preview': - from ..v2019_10_17.aio.operations_async import PrivateLinkScopesOperations as OperationClass + from ..v2019_10_17.aio.operations import PrivateLinkScopesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'private_link_scopes'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def scheduled_query_rules(self): """Instance depends on the API version: - * 2018-04-16: :class:`ScheduledQueryRulesOperations` + * 2018-04-16: :class:`ScheduledQueryRulesOperations` """ api_version = self._get_api_version('scheduled_query_rules') if api_version == '2018-04-16': - from ..v2018_04_16.aio.operations_async import ScheduledQueryRulesOperations as OperationClass + from ..v2018_04_16.aio.operations import ScheduledQueryRulesOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'scheduled_query_rules'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def service_diagnostic_settings(self): """Instance depends on the API version: - * 2015-07-01: :class:`ServiceDiagnosticSettingsOperations` - * 2016-09-01: :class:`ServiceDiagnosticSettingsOperations` + * 2015-07-01: :class:`ServiceDiagnosticSettingsOperations` + * 2016-09-01: :class:`ServiceDiagnosticSettingsOperations` """ api_version = self._get_api_version('service_diagnostic_settings') if api_version == '2015-07-01': - from ..v2015_07_01.aio.operations_async import ServiceDiagnosticSettingsOperations as OperationClass + from ..v2015_07_01.aio.operations import ServiceDiagnosticSettingsOperations as OperationClass elif api_version == '2016-09-01': - from ..v2016_09_01.aio.operations_async import ServiceDiagnosticSettingsOperations as OperationClass + from ..v2016_09_01.aio.operations import ServiceDiagnosticSettingsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'service_diagnostic_settings'".format(api_version)) + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + + @property + def subscription_diagnostic_settings(self): + """Instance depends on the API version: + + * 2017-05-01-preview: :class:`SubscriptionDiagnosticSettingsOperations` + """ + api_version = self._get_api_version('subscription_diagnostic_settings') + if api_version == '2017-05-01-preview': + from ..v2017_05_01_preview.aio.operations import SubscriptionDiagnosticSettingsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'subscription_diagnostic_settings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def tenant_activity_logs(self): """Instance depends on the API version: - * 2015-04-01: :class:`TenantActivityLogsOperations` + * 2015-04-01: :class:`TenantActivityLogsOperations` """ api_version = self._get_api_version('tenant_activity_logs') if api_version == '2015-04-01': - from ..v2015_04_01.aio.operations_async import TenantActivityLogsOperations as OperationClass + from ..v2015_04_01.aio.operations import TenantActivityLogsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'tenant_activity_logs'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @property def vm_insights(self): """Instance depends on the API version: - * 2018-11-27-preview: :class:`VMInsightsOperations` + * 2018-11-27-preview: :class:`VMInsightsOperations` """ api_version = self._get_api_version('vm_insights') if api_version == '2018-11-27-preview': - from ..v2018_11_27_preview.aio.operations_async import VMInsightsOperations as OperationClass + from ..v2018_11_27_preview.aio.operations import VMInsightsOperations as OperationClass else: - raise NotImplementedError("APIVersion {} is not available".format(api_version)) + raise ValueError("API version {} does not have operation group 'vm_insights'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) async def close(self): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_configuration.py index 2957dc82534c4..bf2db0f8d6c66 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2015-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_metadata.json index 04aab43d75c43..ac34301c5de6f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "activity_logs": "ActivityLogsOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py index 5867d4a728ab0..ad2470ff3b5c8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py @@ -44,7 +44,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -62,6 +61,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.activity_logs = ActivityLogsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py index 07597892723db..4ea79ca49ff1e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2015-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py similarity index 82% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py index 86a3d417a8baf..aa50723752636 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py @@ -15,12 +15,12 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import ActivityLogsOperations -from .operations_async import AutoscaleSettingsOperations -from .operations_async import EventCategoriesOperations -from .operations_async import Operations -from .operations_async import TenantActivityLogsOperations +from ._configuration import MonitorClientConfiguration +from .operations import ActivityLogsOperations +from .operations import AutoscaleSettingsOperations +from .operations import EventCategoriesOperations +from .operations import Operations +from .operations import TenantActivityLogsOperations from .. import models @@ -28,21 +28,20 @@ class MonitorClient(object): """Monitor Management Client. :ivar activity_logs: ActivityLogsOperations operations - :vartype activity_logs: $(python-base-namespace).v2015_04_01.aio.operations_async.ActivityLogsOperations + :vartype activity_logs: $(python-base-namespace).v2015_04_01.aio.operations.ActivityLogsOperations :ivar autoscale_settings: AutoscaleSettingsOperations operations - :vartype autoscale_settings: $(python-base-namespace).v2015_04_01.aio.operations_async.AutoscaleSettingsOperations + :vartype autoscale_settings: $(python-base-namespace).v2015_04_01.aio.operations.AutoscaleSettingsOperations :ivar event_categories: EventCategoriesOperations operations - :vartype event_categories: $(python-base-namespace).v2015_04_01.aio.operations_async.EventCategoriesOperations + :vartype event_categories: $(python-base-namespace).v2015_04_01.aio.operations.EventCategoriesOperations :ivar operations: Operations operations - :vartype operations: $(python-base-namespace).v2015_04_01.aio.operations_async.Operations + :vartype operations: $(python-base-namespace).v2015_04_01.aio.operations.Operations :ivar tenant_activity_logs: TenantActivityLogsOperations operations - :vartype tenant_activity_logs: $(python-base-namespace).v2015_04_01.aio.operations_async.TenantActivityLogsOperations + :vartype tenant_activity_logs: $(python-base-namespace).v2015_04_01.aio.operations.TenantActivityLogsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -59,6 +58,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.activity_logs = ActivityLogsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/__init__.py similarity index 65% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/__init__.py index d81eb086ffa24..0246aac3c8aee 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/__init__.py @@ -6,11 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._activity_logs_operations_async import ActivityLogsOperations -from ._autoscale_settings_operations_async import AutoscaleSettingsOperations -from ._event_categories_operations_async import EventCategoriesOperations -from ._operations_async import Operations -from ._tenant_activity_logs_operations_async import TenantActivityLogsOperations +from ._activity_logs_operations import ActivityLogsOperations +from ._autoscale_settings_operations import AutoscaleSettingsOperations +from ._event_categories_operations import EventCategoriesOperations +from ._operations import Operations +from ._tenant_activity_logs_operations import TenantActivityLogsOperations __all__ = [ 'ActivityLogsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_activity_logs_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py similarity index 68% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_activity_logs_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py index 546845b0715db..23732a644d20f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_activity_logs_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -50,27 +50,27 @@ def list( """Provides the list of records from the activity logs. :param filter: Reduces the set of data collected.:code:`
`This argument is required and it - also requires at least the start date/time.:code:`
`The **$filter** argument is very - restricted and allows only the following patterns.:code:`
`- *List events for a resource - group*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.:code:`
`- *List - events for resource*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.:code:`
`- - *List events for a subscription in a time range*\ : $filter=eventTimestamp ge - '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - '2014-07-20T04:36:37.6407898Z'.:code:`
`- *List events for a resource provider*\ : - $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.:code:`
`- - *List events for a correlation Id*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' - and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq - 'correlationID'.:code:`
`:code:`
`\ **NOTE**\ : No other syntax is allowed. + also requires at least the start date/time.:code:`
`The **$filter** argument is very + restricted and allows only the following patterns.:code:`
`- *List events for a resource + group*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.:code:`
`- *List + events for resource*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.:code:`
`- + *List events for a subscription in a time range*\ : $filter=eventTimestamp ge + '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + '2014-07-20T04:36:37.6407898Z'.:code:`
`- *List events for a resource provider*\ : + $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.:code:`
`- + *List events for a correlation Id*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' + and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq + 'correlationID'.:code:`
`:code:`
`\ **NOTE**\ : No other syntax is allowed. :type filter: str :param select: Used to fetch events with only the given properties.:code:`
`The **$select** - argument is a comma separated list of property names to be returned. Possible values are: - *authorization*\ , *claims*\ , *correlationId*\ , *description*\ , *eventDataId*\ , - *eventName*\ , *eventTimestamp*\ , *httpRequest*\ , *level*\ , *operationId*\ , - *operationName*\ , *properties*\ , *resourceGroupName*\ , *resourceProviderName*\ , - *resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*. + argument is a comma separated list of property names to be returned. Possible values are: + *authorization*\ , *claims*\ , *correlationId*\ , *description*\ , *eventDataId*\ , + *eventName*\ , *eventTimestamp*\ , *httpRequest*\ , *level*\ , *operationId*\ , + *operationName*\ , *properties*\ , *resourceGroupName*\ , *resourceProviderName*\ , + *resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*. :type select: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EventDataCollection or the result of cls(response) @@ -78,11 +78,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -97,15 +104,11 @@ def prepare_request(next_link=None): if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_autoscale_settings_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_autoscale_settings_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py index d0c3611a6c78e..6f9308cb76168 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_autoscale_settings_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -56,11 +56,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -73,15 +80,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -130,10 +133,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -151,14 +157,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AutoscaleSettingResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -167,7 +171,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AutoscaleSettingResource', pipeline_response) @@ -198,9 +201,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -217,8 +223,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,9 +257,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -270,9 +279,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -312,10 +320,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -333,14 +344,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(autoscale_setting_resource, 'AutoscaleSettingResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -369,11 +378,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -385,15 +401,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_event_categories_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_event_categories_operations.py similarity index 85% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_event_categories_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_event_categories_operations.py index 4b305b9f18752..2d89bb1788a95 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_event_categories_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_event_categories_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -46,8 +46,8 @@ def list( **kwargs ) -> AsyncIterable["models.EventCategoryCollection"]: """Get the list of available event categories supported in the Activity Logs - Service.:code:`
`The current list includes the following: Administrative, Security, - ServiceHealth, Alert, Recommendation, Policy. + Service.:code:`
`The current list includes the following: Administrative, Security, + ServiceHealth, Alert, Recommendation, Policy. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EventCategoryCollection or the result of cls(response) @@ -55,11 +55,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventCategoryCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -67,15 +74,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_operations.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_operations.py index 7ab8d4a730986..e7b2c8a4ab239 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -52,9 +52,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -65,9 +68,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_tenant_activity_logs_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_tenant_activity_logs_operations.py similarity index 64% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_tenant_activity_logs_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_tenant_activity_logs_operations.py index 78a23d4015921..ccc43fec7b3ab 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations_async/_tenant_activity_logs_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_tenant_activity_logs_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -48,33 +48,33 @@ def list( **kwargs ) -> AsyncIterable["models.EventDataCollection"]: """Gets the Activity Logs for the Tenant.:code:`
`Everything that is applicable to the API to - get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, - etc.).:code:`
`One thing to point out here is that this API does *not* retrieve the logs at - the individual subscription of the tenant but only surfaces the logs that were generated at the - tenant level. + get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, + etc.).:code:`
`One thing to point out here is that this API does *not* retrieve the logs at + the individual subscription of the tenant but only surfaces the logs that were generated at the + tenant level. :param filter: Reduces the set of data collected. :code:`
`The **$filter** is very - restricted and allows only the following patterns.:code:`
`- List events for a resource - group: $filter=eventTimestamp ge ':code:``' and eventTimestamp le ':code:``' and eventChannels eq 'Admin, Operation' and resourceGroupName eq - ':code:``'.:code:`
`- List events for resource: $filter=eventTimestamp ge - ':code:``' and eventTimestamp le ':code:``' and eventChannels eq 'Admin, - Operation' and resourceUri eq ':code:``'.:code:`
`- List events for a - subscription: $filter=eventTimestamp ge ':code:``' and eventTimestamp le - ':code:``' and eventChannels eq 'Admin, Operation'.:code:`
`- List events for a - resource provider: $filter=eventTimestamp ge ':code:``' and eventTimestamp le - ':code:``' and eventChannels eq 'Admin, Operation' and resourceProvider eq - ':code:``'.:code:`
`- List events for a correlation Id: api- - version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp - le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq - ':code:``'.:code:`
`\ **NOTE**\ : No other syntax is allowed. + restricted and allows only the following patterns.:code:`
`- List events for a resource + group: $filter=eventTimestamp ge ':code:``' and eventTimestamp le ':code:``' and eventChannels eq 'Admin, Operation' and resourceGroupName eq + ':code:``'.:code:`
`- List events for resource: $filter=eventTimestamp ge + ':code:``' and eventTimestamp le ':code:``' and eventChannels eq 'Admin, + Operation' and resourceUri eq ':code:``'.:code:`
`- List events for a + subscription: $filter=eventTimestamp ge ':code:``' and eventTimestamp le + ':code:``' and eventChannels eq 'Admin, Operation'.:code:`
`- List events for a + resource provider: $filter=eventTimestamp ge ':code:``' and eventTimestamp le + ':code:``' and eventChannels eq 'Admin, Operation' and resourceProvider eq + ':code:``'.:code:`
`- List events for a correlation Id: api- + version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp + le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq + ':code:``'.:code:`
`\ **NOTE**\ : No other syntax is allowed. :type filter: str :param select: Used to fetch events with only the given properties.:code:`
`The **$select** - argument is a comma separated list of property names to be returned. Possible values are: - *authorization*\ , *claims*\ , *correlationId*\ , *description*\ , *eventDataId*\ , - *eventName*\ , *eventTimestamp*\ , *httpRequest*\ , *level*\ , *operationId*\ , - *operationName*\ , *properties*\ , *resourceGroupName*\ , *resourceProviderName*\ , - *resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*. + argument is a comma separated list of property names to be returned. Possible values are: + *authorization*\ , *claims*\ , *correlationId*\ , *description*\ , *eventDataId*\ , + *eventName*\ , *eventTimestamp*\ , *httpRequest*\ , *level*\ , *operationId*\ , + *operationName*\ , *properties*\ , *resourceGroupName*\ , *resourceProviderName*\ , + *resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*. :type select: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EventDataCollection or the result of cls(response) @@ -82,11 +82,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -98,15 +105,11 @@ def prepare_request(next_link=None): if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/__init__.py index 08becc55bd881..0ceae3f214e9c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/__init__.py @@ -29,6 +29,7 @@ from ._models_py3 import ScaleAction from ._models_py3 import ScaleCapacity from ._models_py3 import ScaleRule + from ._models_py3 import ScaleRuleMetricDimension from ._models_py3 import SenderAuthorization from ._models_py3 import TimeWindow from ._models_py3 import WebhookNotification @@ -55,6 +56,7 @@ from ._models import ScaleAction # type: ignore from ._models import ScaleCapacity # type: ignore from ._models import ScaleRule # type: ignore + from ._models import ScaleRuleMetricDimension # type: ignore from ._models import SenderAuthorization # type: ignore from ._models import TimeWindow # type: ignore from ._models import WebhookNotification # type: ignore @@ -65,6 +67,7 @@ MetricStatisticType, RecurrenceFrequency, ScaleDirection, + ScaleRuleMetricDimensionOperationType, ScaleType, TimeAggregationType, ) @@ -92,6 +95,7 @@ 'ScaleAction', 'ScaleCapacity', 'ScaleRule', + 'ScaleRuleMetricDimension', 'SenderAuthorization', 'TimeWindow', 'WebhookNotification', @@ -100,6 +104,7 @@ 'MetricStatisticType', 'RecurrenceFrequency', 'ScaleDirection', + 'ScaleRuleMetricDimensionOperationType', 'ScaleType', 'TimeAggregationType', ] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models.py index cfd40ec568c93..76e77193fc279 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models.py @@ -613,6 +613,8 @@ class MetricTrigger(msrest.serialization.Model): :param metric_name: Required. the name of the metric that defines what the rule monitors. :type metric_name: str + :param metric_namespace: the namespace of the metric that defines what the rule monitors. + :type metric_namespace: str :param metric_resource_uri: Required. the resource identifier of the resource the rule monitors. :type metric_resource_uri: str @@ -637,6 +639,9 @@ class MetricTrigger(msrest.serialization.Model): :type operator: str or ~$(python-base-namespace).v2015_04_01.models.ComparisonOperationType :param threshold: Required. the threshold of the metric that triggers the scale action. :type threshold: float + :param dimensions: List of dimension conditions. For example: + [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + :type dimensions: list[~$(python-base-namespace).v2015_04_01.models.ScaleRuleMetricDimension] """ _validation = { @@ -652,6 +657,7 @@ class MetricTrigger(msrest.serialization.Model): _attribute_map = { 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, 'metric_resource_uri': {'key': 'metricResourceUri', 'type': 'str'}, 'time_grain': {'key': 'timeGrain', 'type': 'duration'}, 'statistic': {'key': 'statistic', 'type': 'str'}, @@ -659,6 +665,7 @@ class MetricTrigger(msrest.serialization.Model): 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, 'operator': {'key': 'operator', 'type': 'str'}, 'threshold': {'key': 'threshold', 'type': 'float'}, + 'dimensions': {'key': 'dimensions', 'type': '[ScaleRuleMetricDimension]'}, } def __init__( @@ -667,6 +674,7 @@ def __init__( ): super(MetricTrigger, self).__init__(**kwargs) self.metric_name = kwargs['metric_name'] + self.metric_namespace = kwargs.get('metric_namespace', None) self.metric_resource_uri = kwargs['metric_resource_uri'] self.time_grain = kwargs['time_grain'] self.statistic = kwargs['statistic'] @@ -674,6 +682,7 @@ def __init__( self.time_aggregation = kwargs['time_aggregation'] self.operator = kwargs['operator'] self.threshold = kwargs['threshold'] + self.dimensions = kwargs.get('dimensions', None) class Operation(msrest.serialization.Model): @@ -965,6 +974,44 @@ def __init__( self.scale_action = kwargs['scale_action'] +class ScaleRuleMetricDimension(msrest.serialization.Model): + """Specifies an auto scale rule metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param dimension_name: Required. Name of the dimension. + :type dimension_name: str + :param operator: Required. the dimension operator. Only 'Equals' and 'NotEquals' are supported. + 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values. + Possible values include: "Equals", "NotEquals". + :type operator: str or ~$(python-base- + namespace).v2015_04_01.models.ScaleRuleMetricDimensionOperationType + :param values: Required. list of dimension values. For example: ["App1","App2"]. + :type values: list[str] + """ + + _validation = { + 'dimension_name': {'required': True}, + 'operator': {'required': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'dimension_name': {'key': 'DimensionName', 'type': 'str'}, + 'operator': {'key': 'Operator', 'type': 'str'}, + 'values': {'key': 'Values', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ScaleRuleMetricDimension, self).__init__(**kwargs) + self.dimension_name = kwargs['dimension_name'] + self.operator = kwargs['operator'] + self.values = kwargs['values'] + + class SenderAuthorization(msrest.serialization.Model): """the authorization used by the user who has performed the operation that led to this event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and the 'scope'. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models_py3.py index 26e7899a99328..4132d5fe1d95b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models_py3.py @@ -668,6 +668,8 @@ class MetricTrigger(msrest.serialization.Model): :param metric_name: Required. the name of the metric that defines what the rule monitors. :type metric_name: str + :param metric_namespace: the namespace of the metric that defines what the rule monitors. + :type metric_namespace: str :param metric_resource_uri: Required. the resource identifier of the resource the rule monitors. :type metric_resource_uri: str @@ -692,6 +694,9 @@ class MetricTrigger(msrest.serialization.Model): :type operator: str or ~$(python-base-namespace).v2015_04_01.models.ComparisonOperationType :param threshold: Required. the threshold of the metric that triggers the scale action. :type threshold: float + :param dimensions: List of dimension conditions. For example: + [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + :type dimensions: list[~$(python-base-namespace).v2015_04_01.models.ScaleRuleMetricDimension] """ _validation = { @@ -707,6 +712,7 @@ class MetricTrigger(msrest.serialization.Model): _attribute_map = { 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, 'metric_resource_uri': {'key': 'metricResourceUri', 'type': 'str'}, 'time_grain': {'key': 'timeGrain', 'type': 'duration'}, 'statistic': {'key': 'statistic', 'type': 'str'}, @@ -714,6 +720,7 @@ class MetricTrigger(msrest.serialization.Model): 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, 'operator': {'key': 'operator', 'type': 'str'}, 'threshold': {'key': 'threshold', 'type': 'float'}, + 'dimensions': {'key': 'dimensions', 'type': '[ScaleRuleMetricDimension]'}, } def __init__( @@ -727,10 +734,13 @@ def __init__( time_aggregation: Union[str, "TimeAggregationType"], operator: Union[str, "ComparisonOperationType"], threshold: float, + metric_namespace: Optional[str] = None, + dimensions: Optional[List["ScaleRuleMetricDimension"]] = None, **kwargs ): super(MetricTrigger, self).__init__(**kwargs) self.metric_name = metric_name + self.metric_namespace = metric_namespace self.metric_resource_uri = metric_resource_uri self.time_grain = time_grain self.statistic = statistic @@ -738,6 +748,7 @@ def __init__( self.time_aggregation = time_aggregation self.operator = operator self.threshold = threshold + self.dimensions = dimensions class Operation(msrest.serialization.Model): @@ -1059,6 +1070,48 @@ def __init__( self.scale_action = scale_action +class ScaleRuleMetricDimension(msrest.serialization.Model): + """Specifies an auto scale rule metric dimension. + + All required parameters must be populated in order to send to Azure. + + :param dimension_name: Required. Name of the dimension. + :type dimension_name: str + :param operator: Required. the dimension operator. Only 'Equals' and 'NotEquals' are supported. + 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values. + Possible values include: "Equals", "NotEquals". + :type operator: str or ~$(python-base- + namespace).v2015_04_01.models.ScaleRuleMetricDimensionOperationType + :param values: Required. list of dimension values. For example: ["App1","App2"]. + :type values: list[str] + """ + + _validation = { + 'dimension_name': {'required': True}, + 'operator': {'required': True}, + 'values': {'required': True}, + } + + _attribute_map = { + 'dimension_name': {'key': 'DimensionName', 'type': 'str'}, + 'operator': {'key': 'Operator', 'type': 'str'}, + 'values': {'key': 'Values', 'type': '[str]'}, + } + + def __init__( + self, + *, + dimension_name: str, + operator: Union[str, "ScaleRuleMetricDimensionOperationType"], + values: List[str], + **kwargs + ): + super(ScaleRuleMetricDimension, self).__init__(**kwargs) + self.dimension_name = dimension_name + self.operator = operator + self.values = values + + class SenderAuthorization(msrest.serialization.Model): """the authorization used by the user who has performed the operation that led to this event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and the 'scope'. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_monitor_client_enums.py index 07a5cd21a9e6d..8ff9a5c89e3d8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_monitor_client_enums.py @@ -6,78 +6,104 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class ComparisonOperationType(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ComparisonOperationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the operator that is used to compare the metric data and the threshold. """ - equals = "Equals" - not_equals = "NotEquals" - greater_than = "GreaterThan" - greater_than_or_equal = "GreaterThanOrEqual" - less_than = "LessThan" - less_than_or_equal = "LessThanOrEqual" + EQUALS = "Equals" + NOT_EQUALS = "NotEquals" + GREATER_THAN = "GreaterThan" + GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + LESS_THAN = "LessThan" + LESS_THAN_OR_EQUAL = "LessThanOrEqual" -class EventLevel(str, Enum): +class EventLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the event level """ - critical = "Critical" - error = "Error" - warning = "Warning" - informational = "Informational" - verbose = "Verbose" + CRITICAL = "Critical" + ERROR = "Error" + WARNING = "Warning" + INFORMATIONAL = "Informational" + VERBOSE = "Verbose" -class MetricStatisticType(str, Enum): +class MetricStatisticType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the metric statistic type. How the metrics from multiple instances are combined. """ - average = "Average" - min = "Min" - max = "Max" - sum = "Sum" + AVERAGE = "Average" + MIN = "Min" + MAX = "Max" + SUM = "Sum" -class RecurrenceFrequency(str, Enum): +class RecurrenceFrequency(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. """ - none = "None" - second = "Second" - minute = "Minute" - hour = "Hour" - day = "Day" - week = "Week" - month = "Month" - year = "Year" + NONE = "None" + SECOND = "Second" + MINUTE = "Minute" + HOUR = "Hour" + DAY = "Day" + WEEK = "Week" + MONTH = "Month" + YEAR = "Year" -class ScaleDirection(str, Enum): +class ScaleDirection(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the scale direction. Whether the scaling action increases or decreases the number of instances. """ - none = "None" - increase = "Increase" - decrease = "Decrease" + NONE = "None" + INCREASE = "Increase" + DECREASE = "Decrease" + +class ScaleRuleMetricDimensionOperationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to + any of the values. 'NotEquals' being not equal to all of the values + """ + + EQUALS = "Equals" + NOT_EQUALS = "NotEquals" -class ScaleType(str, Enum): +class ScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the type of action that should occur when the scale rule fires. """ - change_count = "ChangeCount" - percent_change_count = "PercentChangeCount" - exact_count = "ExactCount" + CHANGE_COUNT = "ChangeCount" + PERCENT_CHANGE_COUNT = "PercentChangeCount" + EXACT_COUNT = "ExactCount" -class TimeAggregationType(str, Enum): +class TimeAggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """time aggregation type. How the data that is collected should be combined over time. The default value is Average. """ - average = "Average" - minimum = "Minimum" - maximum = "Maximum" - total = "Total" - count = "Count" - last = "Last" + AVERAGE = "Average" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" + COUNT = "Count" + LAST = "Last" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py index 2f726256ab99b..8a391fdfaba6d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_activity_logs_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -55,27 +55,27 @@ def list( """Provides the list of records from the activity logs. :param filter: Reduces the set of data collected.:code:`
`This argument is required and it - also requires at least the start date/time.:code:`
`The **$filter** argument is very - restricted and allows only the following patterns.:code:`
`- *List events for a resource - group*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.:code:`
`- *List - events for resource*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and - eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.:code:`
`- - *List events for a subscription in a time range*\ : $filter=eventTimestamp ge - '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - '2014-07-20T04:36:37.6407898Z'.:code:`
`- *List events for a resource provider*\ : - $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le - '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.:code:`
`- - *List events for a correlation Id*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' - and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq - 'correlationID'.:code:`
`:code:`
`\ **NOTE**\ : No other syntax is allowed. + also requires at least the start date/time.:code:`
`The **$filter** argument is very + restricted and allows only the following patterns.:code:`
`- *List events for a resource + group*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq 'resourceGroupName'.:code:`
`- *List + events for resource*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and + eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.:code:`
`- + *List events for a subscription in a time range*\ : $filter=eventTimestamp ge + '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + '2014-07-20T04:36:37.6407898Z'.:code:`
`- *List events for a resource provider*\ : + $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le + '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.:code:`
`- + *List events for a correlation Id*\ : $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' + and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq + 'correlationID'.:code:`
`:code:`
`\ **NOTE**\ : No other syntax is allowed. :type filter: str :param select: Used to fetch events with only the given properties.:code:`
`The **$select** - argument is a comma separated list of property names to be returned. Possible values are: - *authorization*\ , *claims*\ , *correlationId*\ , *description*\ , *eventDataId*\ , - *eventName*\ , *eventTimestamp*\ , *httpRequest*\ , *level*\ , *operationId*\ , - *operationName*\ , *properties*\ , *resourceGroupName*\ , *resourceProviderName*\ , - *resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*. + argument is a comma separated list of property names to be returned. Possible values are: + *authorization*\ , *claims*\ , *correlationId*\ , *description*\ , *eventDataId*\ , + *eventName*\ , *eventTimestamp*\ , *httpRequest*\ , *level*\ , *operationId*\ , + *operationName*\ , *properties*\ , *resourceGroupName*\ , *resourceProviderName*\ , + *resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*. :type select: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EventDataCollection or the result of cls(response) @@ -83,11 +83,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -102,15 +109,11 @@ def prepare_request(next_link=None): if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_autoscale_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_autoscale_settings_operations.py index 79d72b6266d10..3a8c481762d8a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_autoscale_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_autoscale_settings_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -61,11 +61,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -78,15 +85,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -136,10 +139,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -157,14 +163,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AutoscaleSettingResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -173,7 +177,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AutoscaleSettingResource', pipeline_response) @@ -205,9 +208,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -224,8 +230,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,9 +265,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -278,9 +287,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -321,10 +329,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -342,14 +353,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(autoscale_setting_resource, 'AutoscaleSettingResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -379,11 +388,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AutoscaleSettingResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -395,15 +411,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_event_categories_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_event_categories_operations.py index 8069db5654886..1ee3dc853cc28 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_event_categories_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_event_categories_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -51,8 +51,8 @@ def list( ): # type: (...) -> Iterable["models.EventCategoryCollection"] """Get the list of available event categories supported in the Activity Logs - Service.:code:`
`The current list includes the following: Administrative, Security, - ServiceHealth, Alert, Recommendation, Policy. + Service.:code:`
`The current list includes the following: Administrative, Security, + ServiceHealth, Alert, Recommendation, Policy. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EventCategoryCollection or the result of cls(response) @@ -60,11 +60,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventCategoryCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -72,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_operations.py index 711c35e35d898..97f40d98c276d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -57,9 +57,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -70,9 +73,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_tenant_activity_logs_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_tenant_activity_logs_operations.py index 443ecace9907a..63bddb7997c68 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_tenant_activity_logs_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/operations/_tenant_activity_logs_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -53,33 +53,33 @@ def list( ): # type: (...) -> Iterable["models.EventDataCollection"] """Gets the Activity Logs for the Tenant.:code:`
`Everything that is applicable to the API to - get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, - etc.).:code:`
`One thing to point out here is that this API does *not* retrieve the logs at - the individual subscription of the tenant but only surfaces the logs that were generated at the - tenant level. + get the Activity Logs for the subscription is applicable to this API (the parameters, $filter, + etc.).:code:`
`One thing to point out here is that this API does *not* retrieve the logs at + the individual subscription of the tenant but only surfaces the logs that were generated at the + tenant level. :param filter: Reduces the set of data collected. :code:`
`The **$filter** is very - restricted and allows only the following patterns.:code:`
`- List events for a resource - group: $filter=eventTimestamp ge ':code:``' and eventTimestamp le ':code:``' and eventChannels eq 'Admin, Operation' and resourceGroupName eq - ':code:``'.:code:`
`- List events for resource: $filter=eventTimestamp ge - ':code:``' and eventTimestamp le ':code:``' and eventChannels eq 'Admin, - Operation' and resourceUri eq ':code:``'.:code:`
`- List events for a - subscription: $filter=eventTimestamp ge ':code:``' and eventTimestamp le - ':code:``' and eventChannels eq 'Admin, Operation'.:code:`
`- List events for a - resource provider: $filter=eventTimestamp ge ':code:``' and eventTimestamp le - ':code:``' and eventChannels eq 'Admin, Operation' and resourceProvider eq - ':code:``'.:code:`
`- List events for a correlation Id: api- - version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp - le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq - ':code:``'.:code:`
`\ **NOTE**\ : No other syntax is allowed. + restricted and allows only the following patterns.:code:`
`- List events for a resource + group: $filter=eventTimestamp ge ':code:``' and eventTimestamp le ':code:``' and eventChannels eq 'Admin, Operation' and resourceGroupName eq + ':code:``'.:code:`
`- List events for resource: $filter=eventTimestamp ge + ':code:``' and eventTimestamp le ':code:``' and eventChannels eq 'Admin, + Operation' and resourceUri eq ':code:``'.:code:`
`- List events for a + subscription: $filter=eventTimestamp ge ':code:``' and eventTimestamp le + ':code:``' and eventChannels eq 'Admin, Operation'.:code:`
`- List events for a + resource provider: $filter=eventTimestamp ge ':code:``' and eventTimestamp le + ':code:``' and eventChannels eq 'Admin, Operation' and resourceProvider eq + ':code:``'.:code:`
`- List events for a correlation Id: api- + version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp + le '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq + ':code:``'.:code:`
`\ **NOTE**\ : No other syntax is allowed. :type filter: str :param select: Used to fetch events with only the given properties.:code:`
`The **$select** - argument is a comma separated list of property names to be returned. Possible values are: - *authorization*\ , *claims*\ , *correlationId*\ , *description*\ , *eventDataId*\ , - *eventName*\ , *eventTimestamp*\ , *httpRequest*\ , *level*\ , *operationId*\ , - *operationName*\ , *properties*\ , *resourceGroupName*\ , *resourceProviderName*\ , - *resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*. + argument is a comma separated list of property names to be returned. Possible values are: + *authorization*\ , *claims*\ , *correlationId*\ , *description*\ , *eventDataId*\ , + *eventName*\ , *eventTimestamp*\ , *httpRequest*\ , *level*\ , *operationId*\ , + *operationName*\ , *properties*\ , *resourceGroupName*\ , *resourceProviderName*\ , + *resourceId*\ , *status*\ , *submissionTimestamp*\ , *subStatus*\ , *subscriptionId*. :type select: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EventDataCollection or the result of cls(response) @@ -87,11 +87,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.EventDataCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -103,15 +110,11 @@ def prepare_request(next_link=None): if select is not None: query_parameters['$select'] = self._serialize.query("select", select, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_configuration.py index 2ddc3ff5b09f8..8caff7d56cc6b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -41,8 +42,7 @@ def __init__( self.credential = credential self.api_version = "2015-07-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -55,6 +55,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_metadata.json index 6d38b47aa9762..a1b4338f57bb0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -29,7 +33,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "service_diagnostic_settings": "ServiceDiagnosticSettingsOperations" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py index b398173486c55..5e9c7e79f9fc0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py @@ -30,7 +30,6 @@ class MonitorClient(object): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.service_diagnostic_settings = ServiceDiagnosticSettingsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py index 920839695c54c..5ab782355f001 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,8 +39,7 @@ def __init__( self.credential = credential self.api_version = "2015-07-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -51,6 +51,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client.py index a1a585eb723d5..769c111b861aa 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client.py @@ -15,8 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import ServiceDiagnosticSettingsOperations +from ._configuration import MonitorClientConfiguration +from .operations import ServiceDiagnosticSettingsOperations from .. import models @@ -24,11 +24,10 @@ class MonitorClient(object): """Monitor Management Client. :ivar service_diagnostic_settings: ServiceDiagnosticSettingsOperations operations - :vartype service_diagnostic_settings: $(python-base-namespace).v2015_07_01.aio.operations_async.ServiceDiagnosticSettingsOperations + :vartype service_diagnostic_settings: $(python-base-namespace).v2015_07_01.aio.operations.ServiceDiagnosticSettingsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -44,6 +43,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.service_diagnostic_settings = ServiceDiagnosticSettingsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/__init__.py similarity index 84% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/__init__.py index f58ba4a0b9c60..c7d51f79a3e23 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._service_diagnostic_settings_operations_async import ServiceDiagnosticSettingsOperations +from ._service_diagnostic_settings_operations import ServiceDiagnosticSettingsOperations __all__ = [ 'ServiceDiagnosticSettingsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations_async/_service_diagnostic_settings_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/_service_diagnostic_settings_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations_async/_service_diagnostic_settings_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/_service_diagnostic_settings_operations.py index 80fc84aff3be8..a0b7bc888b530 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations_async/_service_diagnostic_settings_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/operations/_service_diagnostic_settings_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -55,9 +55,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -72,9 +75,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -110,10 +112,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -129,14 +134,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceDiagnosticSettingsResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/operations/_service_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/operations/_service_diagnostic_settings_operations.py index 4d187c7eb8d00..34b3c8e99fd8e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/operations/_service_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/operations/_service_diagnostic_settings_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -60,9 +60,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-07-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -77,9 +80,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -116,10 +118,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2015-07-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -135,14 +140,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceDiagnosticSettingsResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_configuration.py index a9d91e02858e6..49690a03aabb5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2016-03-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_metadata.json index b591f77cfab1f..e835b0d273c5b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "alert_rule_incidents": "AlertRuleIncidentsOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py index 272e501d57499..bdaa636693450 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py @@ -41,7 +41,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -59,6 +58,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.alert_rule_incidents = AlertRuleIncidentsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py index 3fac800b158e1..b656b9a5b462f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2016-03-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py similarity index 83% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py index eb41847148787..b4decfae27d65 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py @@ -15,11 +15,11 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import AlertRuleIncidentsOperations -from .operations_async import AlertRulesOperations -from .operations_async import LogProfilesOperations -from .operations_async import MetricDefinitionsOperations +from ._configuration import MonitorClientConfiguration +from .operations import AlertRuleIncidentsOperations +from .operations import AlertRulesOperations +from .operations import LogProfilesOperations +from .operations import MetricDefinitionsOperations from .. import models @@ -27,19 +27,18 @@ class MonitorClient(object): """Monitor Management Client. :ivar alert_rule_incidents: AlertRuleIncidentsOperations operations - :vartype alert_rule_incidents: $(python-base-namespace).v2016_03_01.aio.operations_async.AlertRuleIncidentsOperations + :vartype alert_rule_incidents: $(python-base-namespace).v2016_03_01.aio.operations.AlertRuleIncidentsOperations :ivar alert_rules: AlertRulesOperations operations - :vartype alert_rules: $(python-base-namespace).v2016_03_01.aio.operations_async.AlertRulesOperations + :vartype alert_rules: $(python-base-namespace).v2016_03_01.aio.operations.AlertRulesOperations :ivar log_profiles: LogProfilesOperations operations - :vartype log_profiles: $(python-base-namespace).v2016_03_01.aio.operations_async.LogProfilesOperations + :vartype log_profiles: $(python-base-namespace).v2016_03_01.aio.operations.LogProfilesOperations :ivar metric_definitions: MetricDefinitionsOperations operations - :vartype metric_definitions: $(python-base-namespace).v2016_03_01.aio.operations_async.MetricDefinitionsOperations + :vartype metric_definitions: $(python-base-namespace).v2016_03_01.aio.operations.MetricDefinitionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -56,6 +55,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.alert_rule_incidents = AlertRuleIncidentsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/__init__.py similarity index 67% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/__init__.py index b4cfe512142d6..ed7a68c9fa7ee 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/__init__.py @@ -6,10 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._alert_rule_incidents_operations_async import AlertRuleIncidentsOperations -from ._alert_rules_operations_async import AlertRulesOperations -from ._log_profiles_operations_async import LogProfilesOperations -from ._metric_definitions_operations_async import MetricDefinitionsOperations +from ._alert_rule_incidents_operations import AlertRuleIncidentsOperations +from ._alert_rules_operations import AlertRulesOperations +from ._log_profiles_operations import LogProfilesOperations +from ._metric_definitions_operations import MetricDefinitionsOperations __all__ = [ 'AlertRuleIncidentsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_alert_rule_incidents_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_alert_rule_incidents_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py index 0bd6743edd6b3..bb6896d7def24 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_alert_rule_incidents_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,9 +62,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Incident"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -82,9 +85,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -120,11 +122,18 @@ def list_by_alert_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.IncidentListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_alert_rule.metadata['url'] # type: ignore @@ -138,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_alert_rules_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_alert_rules_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py index 40fc33a916f85..7c88bc63ec653 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_alert_rules_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AlertRuleResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AlertRuleResource', pipeline_response) @@ -130,7 +130,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" @@ -150,7 +152,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -182,9 +183,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -201,9 +205,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -242,10 +245,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -263,14 +269,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(alert_rules_resource, 'AlertRuleResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -279,7 +283,6 @@ async def update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AlertRuleResource', pipeline_response) @@ -307,11 +310,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -324,15 +334,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -371,11 +377,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -387,15 +400,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_log_profiles_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_log_profiles_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py index 03f78acbcf151..c8d95ea6e0798 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_log_profiles_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -56,7 +56,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" @@ -75,7 +77,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,9 +105,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -122,9 +126,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -160,10 +163,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -180,14 +186,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogProfileResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -221,10 +225,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -241,14 +248,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(log_profiles_resource, 'LogProfileResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -277,11 +282,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -293,15 +305,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_metric_definitions_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_metric_definitions_operations.py similarity index 83% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_metric_definitions_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_metric_definitions_operations.py index 980e2560f8a8f..d788e2c65ddd6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations_async/_metric_definitions_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_metric_definitions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -52,11 +52,11 @@ def list( :param resource_uri: The identifier of the resource. :type resource_uri: str :param filter: Reduces the set of data collected by retrieving particular metric definitions - from all the definitions available for the resource.:code:`
`For example, to get just the - definition for the 'CPU percentage' counter: $filter=name.value eq '\Processor(_Total)\% - Processor Time'.:code:`
`Multiple metrics can be retrieved by joining together *'name eq - :code:``'* clauses separated by *or* logical operators.:code:`
`\ **NOTE**\ : No - other syntax is allowed. + from all the definitions available for the resource.:code:`
`For example, to get just the + definition for the 'CPU percentage' counter: $filter=name.value eq '\Processor(_Total)\% + Processor Time'.:code:`
`Multiple metrics can be retrieved by joining together *'name eq + :code:``'* clauses separated by *or* logical operators.:code:`
`\ **NOTE**\ : No + other syntax is allowed. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MetricDefinitionCollection or the result of cls(response) @@ -64,11 +64,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +89,11 @@ def prepare_request(next_link=None): if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_models.py index 2fac5f143e672..b4de0f130ae85 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_models.py @@ -348,7 +348,7 @@ def __init__( **kwargs ): super(RuleCondition, self).__init__(**kwargs) - self.odata_type = None + self.odata_type = None # type: Optional[str] self.data_source = kwargs.get('data_source', None) @@ -391,7 +391,7 @@ def __init__( **kwargs ): super(LocationThresholdRuleCondition, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition' # type: str self.window_size = kwargs.get('window_size', None) self.failed_location_count = kwargs['failed_location_count'] @@ -599,7 +599,7 @@ def __init__( **kwargs ): super(ManagementEventRuleCondition, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition' # type: str self.aggregation = kwargs.get('aggregation', None) @@ -759,7 +759,7 @@ def __init__( **kwargs ): super(RuleAction, self).__init__(**kwargs) - self.odata_type = None + self.odata_type = None # type: Optional[str] class RuleDataSource(msrest.serialization.Model): @@ -796,7 +796,7 @@ def __init__( **kwargs ): super(RuleDataSource, self).__init__(**kwargs) - self.odata_type = None + self.odata_type = None # type: Optional[str] self.resource_uri = kwargs.get('resource_uri', None) @@ -831,7 +831,7 @@ def __init__( **kwargs ): super(RuleEmailAction, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleEmailAction' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleEmailAction' # type: str self.send_to_service_owners = kwargs.get('send_to_service_owners', None) self.custom_emails = kwargs.get('custom_emails', None) @@ -911,7 +911,7 @@ def __init__( **kwargs ): super(RuleManagementEventDataSource, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource' # type: str self.event_name = kwargs.get('event_name', None) self.event_source = kwargs.get('event_source', None) self.level = kwargs.get('level', None) @@ -953,7 +953,7 @@ def __init__( **kwargs ): super(RuleMetricDataSource, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource' # type: str self.metric_name = kwargs.get('metric_name', None) @@ -988,7 +988,7 @@ def __init__( **kwargs ): super(RuleWebhookAction, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction' # type: str self.service_uri = kwargs.get('service_uri', None) self.properties = kwargs.get('properties', None) @@ -1042,7 +1042,7 @@ def __init__( **kwargs ): super(ThresholdRuleCondition, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition' # type: str self.operator = kwargs['operator'] self.threshold = kwargs['threshold'] self.window_size = kwargs.get('window_size', None) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_models_py3.py index 51442ba646293..c3a373a7946fd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_models_py3.py @@ -383,7 +383,7 @@ def __init__( **kwargs ): super(RuleCondition, self).__init__(**kwargs) - self.odata_type: Optional[str] = None + self.odata_type = None # type: Optional[str] self.data_source = data_source @@ -430,7 +430,7 @@ def __init__( **kwargs ): super(LocationThresholdRuleCondition, self).__init__(data_source=data_source, **kwargs) - self.odata_type: str = 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition' # type: str self.window_size = window_size self.failed_location_count = failed_location_count @@ -662,7 +662,7 @@ def __init__( **kwargs ): super(ManagementEventRuleCondition, self).__init__(data_source=data_source, **kwargs) - self.odata_type: str = 'Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition' # type: str self.aggregation = aggregation @@ -837,7 +837,7 @@ def __init__( **kwargs ): super(RuleAction, self).__init__(**kwargs) - self.odata_type: Optional[str] = None + self.odata_type = None # type: Optional[str] class RuleDataSource(msrest.serialization.Model): @@ -876,7 +876,7 @@ def __init__( **kwargs ): super(RuleDataSource, self).__init__(**kwargs) - self.odata_type: Optional[str] = None + self.odata_type = None # type: Optional[str] self.resource_uri = resource_uri @@ -914,7 +914,7 @@ def __init__( **kwargs ): super(RuleEmailAction, self).__init__(**kwargs) - self.odata_type: str = 'Microsoft.Azure.Management.Insights.Models.RuleEmailAction' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleEmailAction' # type: str self.send_to_service_owners = send_to_service_owners self.custom_emails = custom_emails @@ -1007,7 +1007,7 @@ def __init__( **kwargs ): super(RuleManagementEventDataSource, self).__init__(resource_uri=resource_uri, **kwargs) - self.odata_type: str = 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource' # type: str self.event_name = event_name self.event_source = event_source self.level = level @@ -1052,7 +1052,7 @@ def __init__( **kwargs ): super(RuleMetricDataSource, self).__init__(resource_uri=resource_uri, **kwargs) - self.odata_type: str = 'Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource' # type: str self.metric_name = metric_name @@ -1090,7 +1090,7 @@ def __init__( **kwargs ): super(RuleWebhookAction, self).__init__(**kwargs) - self.odata_type: str = 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction' # type: str self.service_uri = service_uri self.properties = properties @@ -1150,7 +1150,7 @@ def __init__( **kwargs ): super(ThresholdRuleCondition, self).__init__(data_source=data_source, **kwargs) - self.odata_type: str = 'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition' + self.odata_type = 'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition' # type: str self.operator = operator self.threshold = threshold self.window_size = window_size diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_monitor_client_enums.py index 07f95c5855828..1794d0c7662b8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_monitor_client_enums.py @@ -6,46 +6,64 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AggregationType(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the primary aggregation type value defining how to use the values for display. """ - none = "None" - average = "Average" - count = "Count" - minimum = "Minimum" - maximum = "Maximum" - total = "Total" + NONE = "None" + AVERAGE = "Average" + COUNT = "Count" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" -class ConditionOperator(str, Enum): +class ConditionOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Operators allowed in the rule condition. """ - greater_than = "GreaterThan" - greater_than_or_equal = "GreaterThanOrEqual" - less_than = "LessThan" - less_than_or_equal = "LessThanOrEqual" + GREATER_THAN = "GreaterThan" + GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + LESS_THAN = "LessThan" + LESS_THAN_OR_EQUAL = "LessThanOrEqual" -class TimeAggregationOperator(str, Enum): +class TimeAggregationOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Aggregation operators allowed in a rule. """ - average = "Average" - minimum = "Minimum" - maximum = "Maximum" - total = "Total" - last = "Last" + AVERAGE = "Average" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" + LAST = "Last" -class Unit(str, Enum): +class Unit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the unit of the metric. """ - count = "Count" - bytes = "Bytes" - seconds = "Seconds" - count_per_second = "CountPerSecond" - bytes_per_second = "BytesPerSecond" - percent = "Percent" - milli_seconds = "MilliSeconds" + COUNT = "Count" + BYTES = "Bytes" + SECONDS = "Seconds" + COUNT_PER_SECOND = "CountPerSecond" + BYTES_PER_SECOND = "BytesPerSecond" + PERCENT = "Percent" + MILLI_SECONDS = "MilliSeconds" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rule_incidents_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rule_incidents_operations.py index e8b53116f7957..71471635a72b9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rule_incidents_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rule_incidents_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,9 +67,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Incident"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -87,9 +90,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -126,11 +128,18 @@ def list_by_alert_rule( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.IncidentListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_alert_rule.metadata['url'] # type: ignore @@ -144,15 +153,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py index 00c493e770f7c..16ce47ce66af6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_alert_rules_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'AlertRuleResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AlertRuleResource', pipeline_response) @@ -136,7 +136,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" @@ -156,7 +158,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -189,9 +190,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -208,9 +212,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -250,10 +253,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -271,14 +277,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(alert_rules_resource, 'AlertRuleResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -287,7 +291,6 @@ def update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AlertRuleResource', pipeline_response) @@ -316,11 +319,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -333,15 +343,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -381,11 +387,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AlertRuleResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -397,15 +410,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_log_profiles_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_log_profiles_operations.py index 28287bfca490d..ee2669c3ce8fb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_log_profiles_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_log_profiles_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -61,7 +61,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" @@ -80,7 +82,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -110,9 +111,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -128,9 +132,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -167,10 +170,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -187,14 +193,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogProfileResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -229,10 +233,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -249,14 +256,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(log_profiles_resource, 'LogProfileResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -286,11 +291,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogProfileCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -302,15 +314,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_metric_definitions_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_metric_definitions_operations.py index 648a0e20c1523..2e0ed174ea4dd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_metric_definitions_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/operations/_metric_definitions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -57,11 +57,11 @@ def list( :param resource_uri: The identifier of the resource. :type resource_uri: str :param filter: Reduces the set of data collected by retrieving particular metric definitions - from all the definitions available for the resource.:code:`
`For example, to get just the - definition for the 'CPU percentage' counter: $filter=name.value eq '\Processor(_Total)\% - Processor Time'.:code:`
`Multiple metrics can be retrieved by joining together *'name eq - :code:``'* clauses separated by *or* logical operators.:code:`
`\ **NOTE**\ : No - other syntax is allowed. + from all the definitions available for the resource.:code:`
`For example, to get just the + definition for the 'CPU percentage' counter: $filter=name.value eq '\Processor(_Total)\% + Processor Time'.:code:`
`Multiple metrics can be retrieved by joining together *'name eq + :code:``'* clauses separated by *or* logical operators.:code:`
`\ **NOTE**\ : No + other syntax is allowed. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MetricDefinitionCollection or the result of cls(response) @@ -69,11 +69,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -87,15 +94,11 @@ def prepare_request(next_link=None): if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_configuration.py index 206b7ce5131c3..06cfd9215638d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -41,8 +42,7 @@ def __init__( self.credential = credential self.api_version = "2016-09-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -55,6 +55,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_metadata.json index 6b9145222c62b..9d418ad87650b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -29,7 +33,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "metrics": "MetricsOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py index 092371660e27a..bab11451938d6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py @@ -33,7 +33,6 @@ class MonitorClient(object): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metrics = MetricsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py index 01006fb881e4b..556fbaa2c95dc 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,8 +39,7 @@ def __init__( self.credential = credential self.api_version = "2016-09-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -51,6 +51,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py similarity index 85% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py index 2b91ff76733c9..46a3165ac3e5f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py @@ -15,9 +15,9 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import MetricsOperations -from .operations_async import ServiceDiagnosticSettingsOperations +from ._configuration import MonitorClientConfiguration +from .operations import MetricsOperations +from .operations import ServiceDiagnosticSettingsOperations from .. import models @@ -25,13 +25,12 @@ class MonitorClient(object): """Monitor Management Client. :ivar metrics: MetricsOperations operations - :vartype metrics: $(python-base-namespace).v2016_09_01.aio.operations_async.MetricsOperations + :vartype metrics: $(python-base-namespace).v2016_09_01.aio.operations.MetricsOperations :ivar service_diagnostic_settings: ServiceDiagnosticSettingsOperations operations - :vartype service_diagnostic_settings: $(python-base-namespace).v2016_09_01.aio.operations_async.ServiceDiagnosticSettingsOperations + :vartype service_diagnostic_settings: $(python-base-namespace).v2016_09_01.aio.operations.ServiceDiagnosticSettingsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metrics = MetricsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/__init__.py similarity index 78% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/__init__.py index 2077f89915700..5563e45b48c8a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._metrics_operations_async import MetricsOperations -from ._service_diagnostic_settings_operations_async import ServiceDiagnosticSettingsOperations +from ._metrics_operations import MetricsOperations +from ._service_diagnostic_settings_operations import ServiceDiagnosticSettingsOperations __all__ = [ 'MetricsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations_async/_metrics_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_metrics_operations.py similarity index 69% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations_async/_metrics_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_metrics_operations.py index a1e43e59135a4..d22879a77d72c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations_async/_metrics_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_metrics_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -52,23 +52,23 @@ def list( :param resource_uri: The identifier of the resource. :type resource_uri: str :param filter: Reduces the set of data collected.:code:`
`The filter is optional. If present - it must contain a list of metric names to retrieve of the form: *(name.value eq 'metricName' - [or name.value eq 'metricName' or ...])*. Optionally, the filter can contain conditions for the - following attributes *aggregationType*\ , *startTime*\ , *endTime*\ , and *timeGrain* of the - form *attributeName operator value*. Where operator is one of *ne*\ , *eq*\ , *gt*\ , - *lt*.:code:`
`Several conditions can be combined with parentheses and logical operators, - e.g: *and*\ , *or*.:code:`
`Some example filter expressions are::code:`
`- - $filter=(name.value eq 'RunsSucceeded') and aggregationType eq 'Total' and startTime eq - 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration'PT1M',:code:`
`- - $filter=(name.value eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq - 'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq - duration'PT1H',:code:`
`- $filter=(name.value eq 'ActionsCompleted' or name.value eq - 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq 'Average') and startTime - eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq - duration'PT1M'.:code:`
`:code:`
`\ **NOTE**\ : When a metrics query comes in with - multiple metrics, but with no aggregation types defined, the service will pick the Primary - aggregation type of the first metrics to be used as the default aggregation type for all the - metrics. + it must contain a list of metric names to retrieve of the form: *(name.value eq 'metricName' + [or name.value eq 'metricName' or ...])*. Optionally, the filter can contain conditions for the + following attributes *aggregationType*\ , *startTime*\ , *endTime*\ , and *timeGrain* of the + form *attributeName operator value*. Where operator is one of *ne*\ , *eq*\ , *gt*\ , + *lt*.:code:`
`Several conditions can be combined with parentheses and logical operators, + e.g: *and*\ , *or*.:code:`
`Some example filter expressions are::code:`
`- + $filter=(name.value eq 'RunsSucceeded') and aggregationType eq 'Total' and startTime eq + 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration'PT1M',:code:`
`- + $filter=(name.value eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq + 'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + duration'PT1H',:code:`
`- $filter=(name.value eq 'ActionsCompleted' or name.value eq + 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq 'Average') and startTime + eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + duration'PT1M'.:code:`
`:code:`
`\ **NOTE**\ : When a metrics query comes in with + multiple metrics, but with no aggregation types defined, the service will pick the Primary + aggregation type of the first metrics to be used as the default aggregation type for all the + metrics. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MetricCollection or the result of cls(response) @@ -76,11 +76,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -94,15 +101,11 @@ def prepare_request(next_link=None): query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations_async/_service_diagnostic_settings_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_service_diagnostic_settings_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations_async/_service_diagnostic_settings_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_service_diagnostic_settings_operations.py index 4a509e34389c1..b95f7509def48 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations_async/_service_diagnostic_settings_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/operations/_service_diagnostic_settings_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -56,9 +56,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -73,9 +76,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -112,10 +114,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -131,14 +136,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceDiagnosticSettingsResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -173,10 +176,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -192,14 +198,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_diagnostic_settings_resource, 'ServiceDiagnosticSettingsResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_monitor_client_enums.py index 4f06027c4bfef..a97775944d3f9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_monitor_client_enums.py @@ -6,16 +6,34 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class Unit(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class Unit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the unit of the metric. """ - count = "Count" - bytes = "Bytes" - seconds = "Seconds" - count_per_second = "CountPerSecond" - bytes_per_second = "BytesPerSecond" - percent = "Percent" - milli_seconds = "MilliSeconds" + COUNT = "Count" + BYTES = "Bytes" + SECONDS = "Seconds" + COUNT_PER_SECOND = "CountPerSecond" + BYTES_PER_SECOND = "BytesPerSecond" + PERCENT = "Percent" + MILLI_SECONDS = "MilliSeconds" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_metrics_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_metrics_operations.py index eb82005250b6c..07de5370bc39d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_metrics_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_metrics_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -57,23 +57,23 @@ def list( :param resource_uri: The identifier of the resource. :type resource_uri: str :param filter: Reduces the set of data collected.:code:`
`The filter is optional. If present - it must contain a list of metric names to retrieve of the form: *(name.value eq 'metricName' - [or name.value eq 'metricName' or ...])*. Optionally, the filter can contain conditions for the - following attributes *aggregationType*\ , *startTime*\ , *endTime*\ , and *timeGrain* of the - form *attributeName operator value*. Where operator is one of *ne*\ , *eq*\ , *gt*\ , - *lt*.:code:`
`Several conditions can be combined with parentheses and logical operators, - e.g: *and*\ , *or*.:code:`
`Some example filter expressions are::code:`
`- - $filter=(name.value eq 'RunsSucceeded') and aggregationType eq 'Total' and startTime eq - 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration'PT1M',:code:`
`- - $filter=(name.value eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq - 'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq - duration'PT1H',:code:`
`- $filter=(name.value eq 'ActionsCompleted' or name.value eq - 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq 'Average') and startTime - eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq - duration'PT1M'.:code:`
`:code:`
`\ **NOTE**\ : When a metrics query comes in with - multiple metrics, but with no aggregation types defined, the service will pick the Primary - aggregation type of the first metrics to be used as the default aggregation type for all the - metrics. + it must contain a list of metric names to retrieve of the form: *(name.value eq 'metricName' + [or name.value eq 'metricName' or ...])*. Optionally, the filter can contain conditions for the + following attributes *aggregationType*\ , *startTime*\ , *endTime*\ , and *timeGrain* of the + form *attributeName operator value*. Where operator is one of *ne*\ , *eq*\ , *gt*\ , + *lt*.:code:`
`Several conditions can be combined with parentheses and logical operators, + e.g: *and*\ , *or*.:code:`
`Some example filter expressions are::code:`
`- + $filter=(name.value eq 'RunsSucceeded') and aggregationType eq 'Total' and startTime eq + 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq duration'PT1M',:code:`
`- + $filter=(name.value eq 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq + 'Average') and startTime eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + duration'PT1H',:code:`
`- $filter=(name.value eq 'ActionsCompleted' or name.value eq + 'RunsSucceeded') and (aggregationType eq 'Total' or aggregationType eq 'Average') and startTime + eq 2016-02-20 and endTime eq 2016-02-21 and timeGrain eq + duration'PT1M'.:code:`
`:code:`
`\ **NOTE**\ : When a metrics query comes in with + multiple metrics, but with no aggregation types defined, the service will pick the Primary + aggregation type of the first metrics to be used as the default aggregation type for all the + metrics. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MetricCollection or the result of cls(response) @@ -81,11 +81,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -99,15 +106,11 @@ def prepare_request(next_link=None): query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_service_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_service_diagnostic_settings_operations.py index f8d3eb82c5f11..9d3dceb5e7853 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_service_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/operations/_service_diagnostic_settings_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -61,9 +61,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -78,9 +81,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -118,10 +120,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -137,14 +142,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ServiceDiagnosticSettingsResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -180,10 +183,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ServiceDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -199,14 +205,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(service_diagnostic_settings_resource, 'ServiceDiagnosticSettingsResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_configuration.py index 965215598a25f..6779035b4e492 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-03-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_metadata.json index 779f8a06521e7..23a85011ca53b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "activity_log_alerts": "ActivityLogAlertsOperations" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py index 2e35fac92af0c..e39815a810f4e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py @@ -32,7 +32,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.activity_log_alerts = ActivityLogAlertsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py index 434f3848d9450..a83bda6bfbcfe 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-03-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py index 841fd31af5704..77a618a91249c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py @@ -15,8 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import ActivityLogAlertsOperations +from ._configuration import MonitorClientConfiguration +from .operations import ActivityLogAlertsOperations from .. import models @@ -24,13 +24,12 @@ class MonitorClient(object): """Monitor Management Client. :ivar activity_log_alerts: ActivityLogAlertsOperations operations - :vartype activity_log_alerts: $(python-base-namespace).v2017_03_01_preview.aio.operations_async.ActivityLogAlertsOperations + :vartype activity_log_alerts: $(python-base-namespace).v2017_03_01_preview.aio.operations.ActivityLogAlertsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.activity_log_alerts = ActivityLogAlertsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/__init__.py similarity index 86% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/__init__.py index f802ea6908f9e..93b3b50f2d763 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._activity_log_alerts_operations_async import ActivityLogAlertsOperations +from ._activity_log_alerts_operations import ActivityLogAlertsOperations __all__ = [ 'ActivityLogAlertsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations_async/_activity_log_alerts_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations_async/_activity_log_alerts_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py index 01a945d606551..e52db335da2e5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations_async/_activity_log_alerts_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(activity_log_alert, 'ActivityLogAlertResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -130,9 +130,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -149,9 +152,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,9 +189,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -206,8 +211,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,10 +249,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -265,14 +273,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(activity_log_alert_patch, 'ActivityLogAlertResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -301,11 +307,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -317,15 +330,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -368,11 +377,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -385,15 +401,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/operations/_activity_log_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/operations/_activity_log_alerts_operations.py index 127095519b30a..1020ef2bd8a59 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/operations/_activity_log_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/operations/_activity_log_alerts_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(activity_log_alert, 'ActivityLogAlertResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -136,9 +136,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -155,9 +158,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -194,9 +196,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -213,8 +218,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -252,10 +257,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -273,14 +281,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(activity_log_alert_patch, 'ActivityLogAlertResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -310,11 +316,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -326,15 +339,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -378,11 +387,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-03-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -395,15 +411,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_configuration.py index cf97cd9b71c49..1a5aecea0642a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_metadata.json index 9aaf65edc25da..baad6b31e0ee1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "action_groups": "ActionGroupsOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py index 61ae4494b9f5a..2c4ba50d209c9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py @@ -35,7 +35,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -53,6 +52,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py index 5a2382219fea3..e55bc4d5c7dac 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2017-04-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py similarity index 86% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py index 4b67fc43999e2..c7575510e4410 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py @@ -15,9 +15,9 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import ActionGroupsOperations -from .operations_async import ActivityLogAlertsOperations +from ._configuration import MonitorClientConfiguration +from .operations import ActionGroupsOperations +from .operations import ActivityLogAlertsOperations from .. import models @@ -25,15 +25,14 @@ class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations - :vartype action_groups: $(python-base-namespace).v2017_04_01.aio.operations_async.ActionGroupsOperations + :vartype action_groups: $(python-base-namespace).v2017_04_01.aio.operations.ActionGroupsOperations :ivar activity_log_alerts: ActivityLogAlertsOperations operations - :vartype activity_log_alerts: $(python-base-namespace).v2017_04_01.aio.operations_async.ActivityLogAlertsOperations + :vartype activity_log_alerts: $(python-base-namespace).v2017_04_01.aio.operations.ActivityLogAlertsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/__init__.py similarity index 78% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/__init__.py index 9ba554f862383..f8d34639d441b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._action_groups_operations_async import ActionGroupsOperations -from ._activity_log_alerts_operations_async import ActivityLogAlertsOperations +from ._action_groups_operations import ActionGroupsOperations +from ._activity_log_alerts_operations import ActivityLogAlertsOperations __all__ = [ 'ActionGroupsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations_async/_action_groups_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations_async/_action_groups_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py index 976b7fee8363c..91b5b91f906ad 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations_async/_action_groups_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -130,9 +130,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -149,9 +152,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,9 +189,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -206,8 +211,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -243,10 +248,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -264,14 +272,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -300,11 +306,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -316,15 +329,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -367,11 +376,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -384,15 +400,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,10 +454,13 @@ async def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -463,13 +478,12 @@ async def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations_async/_activity_log_alerts_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations_async/_activity_log_alerts_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py index 5d57d7042881c..2e889f8bcc58a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations_async/_activity_log_alerts_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(activity_log_alert, 'ActivityLogAlertResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -130,9 +130,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -149,9 +152,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,9 +189,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -206,8 +211,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -244,10 +249,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -265,14 +273,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(activity_log_alert_patch, 'ActivityLogAlertPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -301,11 +307,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -317,15 +330,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -368,11 +377,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -385,15 +401,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/_monitor_client_enums.py index c823f8bd60265..238df22ea2f0b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/_monitor_client_enums.py @@ -6,13 +6,31 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class ReceiverStatus(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ReceiverStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications. """ - not_specified = "NotSpecified" - enabled = "Enabled" - disabled = "Disabled" + NOT_SPECIFIED = "NotSpecified" + ENABLED = "Enabled" + DISABLED = "Disabled" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_action_groups_operations.py index 3eece4fceea95..1a29bdc4ca452 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_action_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -136,9 +136,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -155,9 +158,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -194,9 +196,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -213,8 +218,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,10 +256,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -272,14 +280,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -309,11 +315,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -325,15 +338,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -377,11 +386,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -394,15 +410,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,10 +465,13 @@ def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -474,13 +489,12 @@ def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_activity_log_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_activity_log_alerts_operations.py index cc66de1cc6b21..31437df9c13f4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_activity_log_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/operations/_activity_log_alerts_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(activity_log_alert, 'ActivityLogAlertResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActivityLogAlertResource', pipeline_response) @@ -136,9 +136,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -155,9 +158,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -194,9 +196,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -213,8 +218,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -252,10 +257,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -273,14 +281,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(activity_log_alert_patch, 'ActivityLogAlertPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -310,11 +316,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -326,15 +339,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -378,11 +387,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActivityLogAlertList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-04-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -395,15 +411,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py index cc1fe7a23042b..7900fde3b236c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -41,8 +42,7 @@ def __init__( self.credential = credential self.api_version = "2017-05-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -55,6 +55,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_metadata.json index 49963f04cef87..52324983dd780 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -29,13 +33,17 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "diagnostic_settings_category": "DiagnosticSettingsCategoryOperations", "diagnostic_settings": "DiagnosticSettingsOperations", "metric_definitions": "MetricDefinitionsOperations", - "metrics": "MetricsOperations" + "metrics": "MetricsOperations", + "subscription_diagnostic_settings": "SubscriptionDiagnosticSettingsOperations" }, "operation_mixins": { }, diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py index 1049403f77d25..f993b0d21f3bc 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py @@ -22,6 +22,7 @@ from .operations import DiagnosticSettingsOperations from .operations import MetricDefinitionsOperations from .operations import MetricsOperations +from .operations import SubscriptionDiagnosticSettingsOperations from . import models @@ -36,10 +37,11 @@ class MonitorClient(object): :vartype metric_definitions: $(python-base-namespace).v2017_05_01_preview.operations.MetricDefinitionsOperations :ivar metrics: MetricsOperations operations :vartype metrics: $(python-base-namespace).v2017_05_01_preview.operations.MetricsOperations + :ivar subscription_diagnostic_settings: SubscriptionDiagnosticSettingsOperations operations + :vartype subscription_diagnostic_settings: $(python-base-namespace).v2017_05_01_preview.operations.SubscriptionDiagnosticSettingsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -56,6 +58,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.diagnostic_settings_category = DiagnosticSettingsCategoryOperations( @@ -66,6 +69,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.metrics = MetricsOperations( self._client, self._config, self._serialize, self._deserialize) + self.subscription_diagnostic_settings = SubscriptionDiagnosticSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) def close(self): # type: () -> None diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py index 8f25ed2388b74..ed3403f0731d9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,8 +39,7 @@ def __init__( self.credential = credential self.api_version = "2017-05-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -51,6 +51,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py similarity index 74% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py index bdf57250bac38..54b8e0318734e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py @@ -15,11 +15,12 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import DiagnosticSettingsCategoryOperations -from .operations_async import DiagnosticSettingsOperations -from .operations_async import MetricDefinitionsOperations -from .operations_async import MetricsOperations +from ._configuration import MonitorClientConfiguration +from .operations import DiagnosticSettingsCategoryOperations +from .operations import DiagnosticSettingsOperations +from .operations import MetricDefinitionsOperations +from .operations import MetricsOperations +from .operations import SubscriptionDiagnosticSettingsOperations from .. import models @@ -27,17 +28,18 @@ class MonitorClient(object): """Monitor Management Client. :ivar diagnostic_settings_category: DiagnosticSettingsCategoryOperations operations - :vartype diagnostic_settings_category: $(python-base-namespace).v2017_05_01_preview.aio.operations_async.DiagnosticSettingsCategoryOperations + :vartype diagnostic_settings_category: $(python-base-namespace).v2017_05_01_preview.aio.operations.DiagnosticSettingsCategoryOperations :ivar diagnostic_settings: DiagnosticSettingsOperations operations - :vartype diagnostic_settings: $(python-base-namespace).v2017_05_01_preview.aio.operations_async.DiagnosticSettingsOperations + :vartype diagnostic_settings: $(python-base-namespace).v2017_05_01_preview.aio.operations.DiagnosticSettingsOperations :ivar metric_definitions: MetricDefinitionsOperations operations - :vartype metric_definitions: $(python-base-namespace).v2017_05_01_preview.aio.operations_async.MetricDefinitionsOperations + :vartype metric_definitions: $(python-base-namespace).v2017_05_01_preview.aio.operations.MetricDefinitionsOperations :ivar metrics: MetricsOperations operations - :vartype metrics: $(python-base-namespace).v2017_05_01_preview.aio.operations_async.MetricsOperations + :vartype metrics: $(python-base-namespace).v2017_05_01_preview.aio.operations.MetricsOperations + :ivar subscription_diagnostic_settings: SubscriptionDiagnosticSettingsOperations operations + :vartype subscription_diagnostic_settings: $(python-base-namespace).v2017_05_01_preview.aio.operations.SubscriptionDiagnosticSettingsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -53,6 +55,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.diagnostic_settings_category = DiagnosticSettingsCategoryOperations( @@ -63,6 +66,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.metrics = MetricsOperations( self._client, self._config, self._serialize, self._deserialize) + self.subscription_diagnostic_settings = SubscriptionDiagnosticSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: await self._client.close() diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/__init__.py similarity index 58% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/__init__.py index 53c821159646e..615dffaaf0a74 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/__init__.py @@ -6,14 +6,16 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._diagnostic_settings_category_operations_async import DiagnosticSettingsCategoryOperations -from ._diagnostic_settings_operations_async import DiagnosticSettingsOperations -from ._metric_definitions_operations_async import MetricDefinitionsOperations -from ._metrics_operations_async import MetricsOperations +from ._diagnostic_settings_category_operations import DiagnosticSettingsCategoryOperations +from ._diagnostic_settings_operations import DiagnosticSettingsOperations +from ._metric_definitions_operations import MetricDefinitionsOperations +from ._metrics_operations import MetricsOperations +from ._subscription_diagnostic_settings_operations import SubscriptionDiagnosticSettingsOperations __all__ = [ 'DiagnosticSettingsCategoryOperations', 'DiagnosticSettingsOperations', 'MetricDefinitionsOperations', 'MetricsOperations', + 'SubscriptionDiagnosticSettingsOperations', ] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_diagnostic_settings_category_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_category_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_diagnostic_settings_category_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_category_operations.py index a87d1299ac9ab..2f8059814a66f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_diagnostic_settings_category_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_category_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -58,9 +58,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsCategoryResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -76,9 +79,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -111,9 +113,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsCategoryResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -128,9 +133,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_diagnostic_settings_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_diagnostic_settings_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_operations.py index 03fdbab28d738..1c24fe090cbc3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_diagnostic_settings_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_diagnostic_settings_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -58,9 +58,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -76,9 +79,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -117,10 +119,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -137,14 +142,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DiagnosticSettingsResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -179,9 +182,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -197,8 +203,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -228,9 +234,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -245,9 +254,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_metric_definitions_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metric_definitions_operations.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_metric_definitions_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metric_definitions_operations.py index 4eb76638b102d..4861496d3b7a7 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_metric_definitions_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metric_definitions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -56,11 +56,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -72,15 +79,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_metrics_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metrics_operations.py similarity index 94% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_metrics_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metrics_operations.py index 63aa465e09cf1..7c9ab28b7877c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations_async/_metrics_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_metrics_operations.py @@ -9,7 +9,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -94,9 +94,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Response"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -127,9 +130,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_subscription_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_subscription_diagnostic_settings_operations.py new file mode 100644 index 0000000000000..4a5cf58453bf1 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/operations/_subscription_diagnostic_settings_operations.py @@ -0,0 +1,274 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SubscriptionDiagnosticSettingsOperations: + """SubscriptionDiagnosticSettingsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2017_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + subscription_id: str, + name: str, + **kwargs + ) -> "models.SubscriptionDiagnosticSettingsResource": + """Gets the active subscription diagnostic settings for the specified resource. + + :param subscription_id: The subscription id. + :type subscription_id: str + :param name: The name of the diagnostic setting. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubscriptionDiagnosticSettingsResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SubscriptionDiagnosticSettingsResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + async def create_or_update( + self, + subscription_id: str, + name: str, + parameters: "models.SubscriptionDiagnosticSettingsResource", + **kwargs + ) -> "models.SubscriptionDiagnosticSettingsResource": + """Creates or updates subscription diagnostic settings for the specified resource. + + :param subscription_id: The subscription id. + :type subscription_id: str + :param name: The name of the diagnostic setting. + :type name: str + :param parameters: Parameters supplied to the operation. + :type parameters: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubscriptionDiagnosticSettingsResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SubscriptionDiagnosticSettingsResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SubscriptionDiagnosticSettingsResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + async def delete( + self, + subscription_id: str, + name: str, + **kwargs + ) -> None: + """Deletes existing subscription diagnostic settings for the specified resource. + + :param subscription_id: The subscription id. + :type subscription_id: str + :param name: The name of the diagnostic setting. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + async def list( + self, + subscription_id: str, + **kwargs + ) -> "models.SubscriptionDiagnosticSettingsResourceCollection": + """Gets the active subscription diagnostic settings list for the specified subscriptionId. + + :param subscription_id: The subscription id. + :type subscription_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubscriptionDiagnosticSettingsResourceCollection, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResourceCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SubscriptionDiagnosticSettingsResourceCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/diagnosticSettings'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/__init__.py index eb00bbd4670e3..c0dd979a816db 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/__init__.py @@ -24,6 +24,10 @@ from ._models_py3 import ProxyOnlyResource from ._models_py3 import Response from ._models_py3 import RetentionPolicy + from ._models_py3 import SubscriptionDiagnosticSettingsResource + from ._models_py3 import SubscriptionDiagnosticSettingsResourceCollection + from ._models_py3 import SubscriptionLogSettings + from ._models_py3 import SubscriptionProxyOnlyResource from ._models_py3 import TimeSeriesElement except (SyntaxError, ImportError): from ._models import DiagnosticSettingsCategoryResource # type: ignore @@ -43,6 +47,10 @@ from ._models import ProxyOnlyResource # type: ignore from ._models import Response # type: ignore from ._models import RetentionPolicy # type: ignore + from ._models import SubscriptionDiagnosticSettingsResource # type: ignore + from ._models import SubscriptionDiagnosticSettingsResourceCollection # type: ignore + from ._models import SubscriptionLogSettings # type: ignore + from ._models import SubscriptionProxyOnlyResource # type: ignore from ._models import TimeSeriesElement # type: ignore from ._monitor_client_enums import ( @@ -70,6 +78,10 @@ 'ProxyOnlyResource', 'Response', 'RetentionPolicy', + 'SubscriptionDiagnosticSettingsResource', + 'SubscriptionDiagnosticSettingsResourceCollection', + 'SubscriptionLogSettings', + 'SubscriptionProxyOnlyResource', 'TimeSeriesElement', 'AggregationType', 'CategoryType', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models.py index 712e141f8f616..eec0efc4acc0b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models.py @@ -616,6 +616,160 @@ def __init__( self.days = kwargs['days'] +class SubscriptionProxyOnlyResource(msrest.serialization.Model): + """A proxy only azure resource object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Location of the resource. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + + +class SubscriptionDiagnosticSettingsResource(SubscriptionProxyOnlyResource): + """The subscription diagnostic setting resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Location of the resource. + :type location: str + :param storage_account_id: The resource ID of the storage account to which you would like to + send Diagnostic Logs. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule Id of the diagnostic setting. This is here to + maintain backwards compatibility. + :type service_bus_rule_id: str + :param event_hub_authorization_rule_id: The resource Id for the event hub authorization rule. + :type event_hub_authorization_rule_id: str + :param event_hub_name: The name of the event hub. If none is specified, the default event hub + will be selected. + :type event_hub_name: str + :param logs: The list of logs settings. + :type logs: list[~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionLogSettings] + :param workspace_id: The full ARM resource ID of the Log Analytics workspace to which you would + like to send Diagnostic Logs. Example: + /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights- + integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. + :type workspace_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'event_hub_authorization_rule_id': {'key': 'properties.eventHubAuthorizationRuleId', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'logs': {'key': 'properties.logs', 'type': '[SubscriptionLogSettings]'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionDiagnosticSettingsResource, self).__init__(**kwargs) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.service_bus_rule_id = kwargs.get('service_bus_rule_id', None) + self.event_hub_authorization_rule_id = kwargs.get('event_hub_authorization_rule_id', None) + self.event_hub_name = kwargs.get('event_hub_name', None) + self.logs = kwargs.get('logs', None) + self.workspace_id = kwargs.get('workspace_id', None) + + +class SubscriptionDiagnosticSettingsResourceCollection(msrest.serialization.Model): + """Represents a collection of subscription diagnostic settings resources. + + :param value: The collection of subscription diagnostic settings resources. + :type value: list[~$(python-base- + namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SubscriptionDiagnosticSettingsResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionDiagnosticSettingsResourceCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class SubscriptionLogSettings(msrest.serialization.Model): + """Part of Subscription diagnostic setting. Specifies the settings for a particular log. + + All required parameters must be populated in order to send to Azure. + + :param category: Name of a Subscription Diagnostic Log category for a resource type this + setting is applied to. + :type category: str + :param enabled: Required. a value indicating whether this log is enabled. + :type enabled: bool + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(SubscriptionLogSettings, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.enabled = kwargs['enabled'] + + class TimeSeriesElement(msrest.serialization.Model): """A time series result type. The discriminator value is always TimeSeries in this case. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models_py3.py index cd987207b765e..5dba26e3628e8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_models_py3.py @@ -689,6 +689,175 @@ def __init__( self.days = days +class SubscriptionProxyOnlyResource(msrest.serialization.Model): + """A proxy only azure resource object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Location of the resource. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + **kwargs + ): + super(SubscriptionProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + + +class SubscriptionDiagnosticSettingsResource(SubscriptionProxyOnlyResource): + """The subscription diagnostic setting resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Location of the resource. + :type location: str + :param storage_account_id: The resource ID of the storage account to which you would like to + send Diagnostic Logs. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule Id of the diagnostic setting. This is here to + maintain backwards compatibility. + :type service_bus_rule_id: str + :param event_hub_authorization_rule_id: The resource Id for the event hub authorization rule. + :type event_hub_authorization_rule_id: str + :param event_hub_name: The name of the event hub. If none is specified, the default event hub + will be selected. + :type event_hub_name: str + :param logs: The list of logs settings. + :type logs: list[~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionLogSettings] + :param workspace_id: The full ARM resource ID of the Log Analytics workspace to which you would + like to send Diagnostic Logs. Example: + /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights- + integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. + :type workspace_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'event_hub_authorization_rule_id': {'key': 'properties.eventHubAuthorizationRuleId', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'logs': {'key': 'properties.logs', 'type': '[SubscriptionLogSettings]'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + storage_account_id: Optional[str] = None, + service_bus_rule_id: Optional[str] = None, + event_hub_authorization_rule_id: Optional[str] = None, + event_hub_name: Optional[str] = None, + logs: Optional[List["SubscriptionLogSettings"]] = None, + workspace_id: Optional[str] = None, + **kwargs + ): + super(SubscriptionDiagnosticSettingsResource, self).__init__(location=location, **kwargs) + self.storage_account_id = storage_account_id + self.service_bus_rule_id = service_bus_rule_id + self.event_hub_authorization_rule_id = event_hub_authorization_rule_id + self.event_hub_name = event_hub_name + self.logs = logs + self.workspace_id = workspace_id + + +class SubscriptionDiagnosticSettingsResourceCollection(msrest.serialization.Model): + """Represents a collection of subscription diagnostic settings resources. + + :param value: The collection of subscription diagnostic settings resources. + :type value: list[~$(python-base- + namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SubscriptionDiagnosticSettingsResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["SubscriptionDiagnosticSettingsResource"]] = None, + **kwargs + ): + super(SubscriptionDiagnosticSettingsResourceCollection, self).__init__(**kwargs) + self.value = value + + +class SubscriptionLogSettings(msrest.serialization.Model): + """Part of Subscription diagnostic setting. Specifies the settings for a particular log. + + All required parameters must be populated in order to send to Azure. + + :param category: Name of a Subscription Diagnostic Log category for a resource type this + setting is applied to. + :type category: str + :param enabled: Required. a value indicating whether this log is enabled. + :type enabled: bool + """ + + _validation = { + 'enabled': {'required': True}, + } + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + enabled: bool, + category: Optional[str] = None, + **kwargs + ): + super(SubscriptionLogSettings, self).__init__(**kwargs) + self.category = category + self.enabled = enabled + + class TimeSeriesElement(msrest.serialization.Model): """A time series result type. The discriminator value is always TimeSeries in this case. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_monitor_client_enums.py index b39eec2d2a1d5..929a353a9bea5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_monitor_client_enums.py @@ -6,41 +6,59 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AggregationType(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the primary aggregation type value defining how to use the values for display. """ - none = "None" - average = "Average" - count = "Count" - minimum = "Minimum" - maximum = "Maximum" - total = "Total" + NONE = "None" + AVERAGE = "Average" + COUNT = "Count" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" -class CategoryType(str, Enum): +class CategoryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of the diagnostic settings category. """ - metrics = "Metrics" - logs = "Logs" + METRICS = "Metrics" + LOGS = "Logs" -class ResultType(str, Enum): +class ResultType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - data = "Data" - metadata = "Metadata" + DATA = "Data" + METADATA = "Metadata" -class Unit(str, Enum): +class Unit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the unit of the metric. """ - count = "Count" - bytes = "Bytes" - seconds = "Seconds" - count_per_second = "CountPerSecond" - bytes_per_second = "BytesPerSecond" - percent = "Percent" - milli_seconds = "MilliSeconds" - byte_seconds = "ByteSeconds" - unspecified = "Unspecified" + COUNT = "Count" + BYTES = "Bytes" + SECONDS = "Seconds" + COUNT_PER_SECOND = "CountPerSecond" + BYTES_PER_SECOND = "BytesPerSecond" + PERCENT = "Percent" + MILLI_SECONDS = "MilliSeconds" + BYTE_SECONDS = "ByteSeconds" + UNSPECIFIED = "Unspecified" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/__init__.py index 2116e01abcba3..615dffaaf0a74 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/__init__.py @@ -10,10 +10,12 @@ from ._diagnostic_settings_operations import DiagnosticSettingsOperations from ._metric_definitions_operations import MetricDefinitionsOperations from ._metrics_operations import MetricsOperations +from ._subscription_diagnostic_settings_operations import SubscriptionDiagnosticSettingsOperations __all__ = [ 'DiagnosticSettingsCategoryOperations', 'DiagnosticSettingsOperations', 'MetricDefinitionsOperations', 'MetricsOperations', + 'SubscriptionDiagnosticSettingsOperations', ] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_category_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_category_operations.py index a71a88cf964c0..c02bcb56365d0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_category_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_category_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -63,9 +63,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsCategoryResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -81,9 +84,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -117,9 +119,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsCategoryResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -134,9 +139,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_operations.py index d9c8defa505c8..542a2b2ecd705 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -63,9 +63,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -81,9 +84,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -123,10 +125,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -143,14 +148,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'DiagnosticSettingsResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -186,9 +189,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -204,8 +210,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -236,9 +242,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.DiagnosticSettingsResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -253,9 +262,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metric_definitions_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metric_definitions_operations.py index 8f878cef212bf..9d055f98dceb2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metric_definitions_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metric_definitions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -61,11 +61,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py index 3ae0c17f51346..bda90bf8d2d4c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py @@ -9,7 +9,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -99,9 +99,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Response"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-05-01-preview" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -132,9 +135,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_subscription_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_subscription_diagnostic_settings_operations.py new file mode 100644 index 0000000000000..ed6be77f0587c --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_subscription_diagnostic_settings_operations.py @@ -0,0 +1,282 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class SubscriptionDiagnosticSettingsOperations(object): + """SubscriptionDiagnosticSettingsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2017_05_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + subscription_id, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SubscriptionDiagnosticSettingsResource" + """Gets the active subscription diagnostic settings for the specified resource. + + :param subscription_id: The subscription id. + :type subscription_id: str + :param name: The name of the diagnostic setting. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubscriptionDiagnosticSettingsResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SubscriptionDiagnosticSettingsResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + def create_or_update( + self, + subscription_id, # type: str + name, # type: str + parameters, # type: "models.SubscriptionDiagnosticSettingsResource" + **kwargs # type: Any + ): + # type: (...) -> "models.SubscriptionDiagnosticSettingsResource" + """Creates or updates subscription diagnostic settings for the specified resource. + + :param subscription_id: The subscription id. + :type subscription_id: str + :param name: The name of the diagnostic setting. + :type name: str + :param parameters: Parameters supplied to the operation. + :type parameters: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubscriptionDiagnosticSettingsResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SubscriptionDiagnosticSettingsResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SubscriptionDiagnosticSettingsResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + def delete( + self, + subscription_id, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes existing subscription diagnostic settings for the specified resource. + + :param subscription_id: The subscription id. + :type subscription_id: str + :param name: The name of the diagnostic setting. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + def list( + self, + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.SubscriptionDiagnosticSettingsResourceCollection" + """Gets the active subscription diagnostic settings list for the specified subscriptionId. + + :param subscription_id: The subscription id. + :type subscription_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubscriptionDiagnosticSettingsResourceCollection, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2017_05_01_preview.models.SubscriptionDiagnosticSettingsResourceCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.SubscriptionDiagnosticSettingsResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2017-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SubscriptionDiagnosticSettingsResourceCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/diagnosticSettings'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_configuration.py index f3f9eae35373a..519a3e172d74e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -41,8 +42,7 @@ def __init__( self.credential = credential self.api_version = "2017-11-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -55,6 +55,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_metadata.json index 6ea3215d0852c..27fac2a7af1f9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -29,7 +33,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "metric_baseline": "MetricBaselineOperations" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py index 88eb9aad1d344..251b6bd7ae113 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py @@ -30,7 +30,6 @@ class MonitorClient(object): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_baseline = MetricBaselineOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py index fdfa272febb73..fee89e6406961 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,8 +39,7 @@ def __init__( self.credential = credential self.api_version = "2017-11-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -51,6 +51,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client.py index eb3d6920bb9f8..eccc4e77501ae 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client.py @@ -15,8 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import MetricBaselineOperations +from ._configuration import MonitorClientConfiguration +from .operations import MetricBaselineOperations from .. import models @@ -24,11 +24,10 @@ class MonitorClient(object): """Monitor Management Client. :ivar metric_baseline: MetricBaselineOperations operations - :vartype metric_baseline: $(python-base-namespace).v2017_11_01_preview.aio.operations_async.MetricBaselineOperations + :vartype metric_baseline: $(python-base-namespace).v2017_11_01_preview.aio.operations.MetricBaselineOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -44,6 +43,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_baseline = MetricBaselineOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/__init__.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/__init__.py index 13f480229c079..04cb64ccf6304 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._metric_baseline_operations_async import MetricBaselineOperations +from ._metric_baseline_operations import MetricBaselineOperations __all__ = [ 'MetricBaselineOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations_async/_metric_baseline_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py similarity index 93% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations_async/_metric_baseline_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py index 5b36e3548064d..fff71a39e22b3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations_async/_metric_baseline_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py @@ -9,7 +9,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -79,9 +79,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -107,9 +110,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -149,10 +151,13 @@ async def calculate_baseline( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CalculateBaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.calculate_baseline.metadata['url'] # type: ignore @@ -168,14 +173,12 @@ async def calculate_baseline( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(time_series_information, 'TimeSeriesInformation') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_monitor_client_enums.py index fe9067ddf205b..6b954160c37c1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_monitor_client_enums.py @@ -6,17 +6,35 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class ResultType(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) - data = "Data" - metadata = "Metadata" + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) -class Sensitivity(str, Enum): + +class ResultType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + DATA = "Data" + METADATA = "Metadata" + +class Sensitivity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the sensitivity of the baseline. """ - low = "Low" - medium = "Medium" - high = "High" + LOW = "Low" + MEDIUM = "Medium" + HIGH = "High" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/operations/_metric_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/operations/_metric_baseline_operations.py index 38b3cf0129197..fee333322b085 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/operations/_metric_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/operations/_metric_baseline_operations.py @@ -9,7 +9,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -84,9 +84,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -112,9 +115,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -155,10 +157,13 @@ def calculate_baseline( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CalculateBaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-11-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.calculate_baseline.metadata['url'] # type: ignore @@ -174,14 +179,12 @@ def calculate_baseline( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(time_series_information, 'TimeSeriesInformation') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_configuration.py index 40e9270b11152..3b15522c5f9c7 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -41,8 +42,7 @@ def __init__( self.credential = credential self.api_version = "2017-12-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -55,6 +55,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_metadata.json index 0755c46f81233..5d938f67dd49c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -29,7 +33,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "metric_namespaces": "MetricNamespacesOperations" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py index 1c720df21fe0a..d3328a470f3a1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py @@ -30,7 +30,6 @@ class MonitorClient(object): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_namespaces = MetricNamespacesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py index c128028b22901..f9a108ffbc2bd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,8 +39,7 @@ def __init__( self.credential = credential self.api_version = "2017-12-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -51,6 +51,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client.py index 7e4009fcd63d3..93c631613bfa2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client.py @@ -15,8 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import MetricNamespacesOperations +from ._configuration import MonitorClientConfiguration +from .operations import MetricNamespacesOperations from .. import models @@ -24,11 +24,10 @@ class MonitorClient(object): """Monitor Management Client. :ivar metric_namespaces: MetricNamespacesOperations operations - :vartype metric_namespaces: $(python-base-namespace).v2017_12_01_preview.aio.operations_async.MetricNamespacesOperations + :vartype metric_namespaces: $(python-base-namespace).v2017_12_01_preview.aio.operations.MetricNamespacesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -44,6 +43,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_namespaces = MetricNamespacesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/__init__.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/__init__.py index 24667404760a2..a4430969ab2be 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._metric_namespaces_operations_async import MetricNamespacesOperations +from ._metric_namespaces_operations import MetricNamespacesOperations __all__ = [ 'MetricNamespacesOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations_async/_metric_namespaces_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/_metric_namespaces_operations.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations_async/_metric_namespaces_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/_metric_namespaces_operations.py index b7c67819f088e..29042ab210250 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations_async/_metric_namespaces_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/operations/_metric_namespaces_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -52,7 +52,7 @@ def list( :param resource_uri: The identifier of the resource. :type resource_uri: str :param start_time: The ISO 8601 conform Date start time from which to query for metric - namespaces. + namespaces. :type start_time: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MetricNamespaceCollection or the result of cls(response) @@ -60,11 +60,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricNamespaceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -78,15 +85,11 @@ def prepare_request(next_link=None): if start_time is not None: query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/operations/_metric_namespaces_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/operations/_metric_namespaces_operations.py index 527c7d50b2eaa..255ba377af8de 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/operations/_metric_namespaces_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/operations/_metric_namespaces_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -57,7 +57,7 @@ def list( :param resource_uri: The identifier of the resource. :type resource_uri: str :param start_time: The ISO 8601 conform Date start time from which to query for metric - namespaces. + namespaces. :type start_time: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MetricNamespaceCollection or the result of cls(response) @@ -65,11 +65,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricNamespaceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2017-12-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -83,15 +90,11 @@ def prepare_request(next_link=None): if start_time is not None: query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_configuration.py index 7e8d5a9c829f0..efc917163bc60 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -41,8 +42,7 @@ def __init__( self.credential = credential self.api_version = "2018-01-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -55,6 +55,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_metadata.json index 5a65f4d4904b1..773155f7320d3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -29,7 +33,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "metric_definitions": "MetricDefinitionsOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py index b77b243598dd7..49362a2013082 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py @@ -33,7 +33,6 @@ class MonitorClient(object): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_definitions = MetricDefinitionsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py index ed8190a7a3642..f38c670682263 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,8 +39,7 @@ def __init__( self.credential = credential self.api_version = "2018-01-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -51,6 +51,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py similarity index 86% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py index df73f24853718..2ea519ee0b2da 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py @@ -15,9 +15,9 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import MetricDefinitionsOperations -from .operations_async import MetricsOperations +from ._configuration import MonitorClientConfiguration +from .operations import MetricDefinitionsOperations +from .operations import MetricsOperations from .. import models @@ -25,13 +25,12 @@ class MonitorClient(object): """Monitor Management Client. :ivar metric_definitions: MetricDefinitionsOperations operations - :vartype metric_definitions: $(python-base-namespace).v2018_01_01.aio.operations_async.MetricDefinitionsOperations + :vartype metric_definitions: $(python-base-namespace).v2018_01_01.aio.operations.MetricDefinitionsOperations :ivar metrics: MetricsOperations operations - :vartype metrics: $(python-base-namespace).v2018_01_01.aio.operations_async.MetricsOperations + :vartype metrics: $(python-base-namespace).v2018_01_01.aio.operations.MetricsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.metric_definitions = MetricDefinitionsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/__init__.py similarity index 80% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/__init__.py index 72dc5b4e35a4a..79a3861ade2fc 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._metric_definitions_operations_async import MetricDefinitionsOperations -from ._metrics_operations_async import MetricsOperations +from ._metric_definitions_operations import MetricDefinitionsOperations +from ._metrics_operations import MetricsOperations __all__ = [ 'MetricDefinitionsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations_async/_metric_definitions_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metric_definitions_operations.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations_async/_metric_definitions_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metric_definitions_operations.py index f2610f4169219..d14bfaaef84ec 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations_async/_metric_definitions_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metric_definitions_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -59,11 +59,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,15 +84,11 @@ def prepare_request(next_link=None): if metricnamespace is not None: query_parameters['metricnamespace'] = self._serialize.query("metricnamespace", metricnamespace, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations_async/_metrics_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metrics_operations.py similarity index 95% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations_async/_metrics_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metrics_operations.py index 2619331a75dc2..60bd670a79eec 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations_async/_metrics_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/operations/_metrics_operations.py @@ -9,7 +9,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -97,9 +97,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Response"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -132,9 +135,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_client_enums.py index 5389d2c256a3e..02a44ae871bf2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_client_enums.py @@ -6,38 +6,56 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AggregationType(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the aggregation type of the metric. """ - none = "None" - average = "Average" - count = "Count" - minimum = "Minimum" - maximum = "Maximum" - total = "Total" + NONE = "None" + AVERAGE = "Average" + COUNT = "Count" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" -class ResultType(str, Enum): +class ResultType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - data = "Data" - metadata = "Metadata" + DATA = "Data" + METADATA = "Metadata" -class Unit(str, Enum): +class Unit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the unit of the metric. """ - count = "Count" - bytes = "Bytes" - seconds = "Seconds" - count_per_second = "CountPerSecond" - bytes_per_second = "BytesPerSecond" - percent = "Percent" - milli_seconds = "MilliSeconds" - byte_seconds = "ByteSeconds" - unspecified = "Unspecified" - cores = "Cores" - milli_cores = "MilliCores" - nano_cores = "NanoCores" - bits_per_second = "BitsPerSecond" + COUNT = "Count" + BYTES = "Bytes" + SECONDS = "Seconds" + COUNT_PER_SECOND = "CountPerSecond" + BYTES_PER_SECOND = "BytesPerSecond" + PERCENT = "Percent" + MILLI_SECONDS = "MilliSeconds" + BYTE_SECONDS = "ByteSeconds" + UNSPECIFIED = "Unspecified" + CORES = "Cores" + MILLI_CORES = "MilliCores" + NANO_CORES = "NanoCores" + BITS_PER_SECOND = "BitsPerSecond" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metric_definitions_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metric_definitions_operations.py index 189a8e7f566ea..59060fc385502 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metric_definitions_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metric_definitions_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -64,11 +64,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricDefinitionCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,15 +89,11 @@ def prepare_request(next_link=None): if metricnamespace is not None: query_parameters['metricnamespace'] = self._serialize.query("metricnamespace", metricnamespace, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metrics_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metrics_operations.py index 4ee3cdeac9baf..adef5b73c7d5b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metrics_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/operations/_metrics_operations.py @@ -9,7 +9,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -102,9 +102,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.Response"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-01-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -137,9 +140,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_configuration.py index c5a3205775625..e17c5db0c2000 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-03-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_metadata.json index a23555f95c44c..d19d65e12c339 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "action_groups": "ActionGroupsOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py index 5a86ef57b2a01..89ec276866767 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py @@ -38,7 +38,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -56,6 +55,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py index 0b538d62a0175..110ba3677e13d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-03-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py similarity index 84% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py index 3c25d6a30ea84..c494d8a983190 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py @@ -15,10 +15,10 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import ActionGroupsOperations -from .operations_async import MetricAlertsOperations -from .operations_async import MetricAlertsStatusOperations +from ._configuration import MonitorClientConfiguration +from .operations import ActionGroupsOperations +from .operations import MetricAlertsOperations +from .operations import MetricAlertsStatusOperations from .. import models @@ -26,17 +26,16 @@ class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations - :vartype action_groups: $(python-base-namespace).v2018_03_01.aio.operations_async.ActionGroupsOperations + :vartype action_groups: $(python-base-namespace).v2018_03_01.aio.operations.ActionGroupsOperations :ivar metric_alerts: MetricAlertsOperations operations - :vartype metric_alerts: $(python-base-namespace).v2018_03_01.aio.operations_async.MetricAlertsOperations + :vartype metric_alerts: $(python-base-namespace).v2018_03_01.aio.operations.MetricAlertsOperations :ivar metric_alerts_status: MetricAlertsStatusOperations operations - :vartype metric_alerts_status: $(python-base-namespace).v2018_03_01.aio.operations_async.MetricAlertsStatusOperations + :vartype metric_alerts_status: $(python-base-namespace).v2018_03_01.aio.operations.MetricAlertsStatusOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -53,6 +52,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/__init__.py similarity index 72% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/__init__.py index cfe306c119e5c..866bc341041b1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/__init__.py @@ -6,9 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._action_groups_operations_async import ActionGroupsOperations -from ._metric_alerts_operations_async import MetricAlertsOperations -from ._metric_alerts_status_operations_async import MetricAlertsStatusOperations +from ._action_groups_operations import ActionGroupsOperations +from ._metric_alerts_operations import MetricAlertsOperations +from ._metric_alerts_status_operations import MetricAlertsStatusOperations __all__ = [ 'ActionGroupsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/_action_groups_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/_action_groups_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py index 090ab5775c6dd..e0062d85fda31 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/_action_groups_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -130,9 +130,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -149,9 +152,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,9 +189,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -206,8 +211,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -243,10 +248,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -264,14 +272,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -300,11 +306,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -316,15 +329,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -367,11 +376,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -384,15 +400,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,10 +454,13 @@ async def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -463,13 +478,12 @@ async def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/_metric_alerts_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/_metric_alerts_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py index ef784a5b3e756..c1a2bffbd3431 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/_metric_alerts_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -53,11 +53,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -69,15 +76,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -120,11 +123,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -137,15 +147,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -191,9 +197,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -210,9 +219,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,10 +259,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -272,14 +283,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'MetricAlertResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -317,10 +326,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -338,14 +350,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'MetricAlertResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -380,7 +390,9 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" @@ -400,7 +412,6 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/_metric_alerts_status_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/_metric_alerts_status_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py index cb697fddff3fa..dbfe12ec9822f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations_async/_metric_alerts_status_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -58,9 +58,12 @@ async def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertStatusCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -77,9 +80,8 @@ async def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -118,9 +120,12 @@ async def list_by_name( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertStatusCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.list_by_name.metadata['url'] # type: ignore @@ -138,9 +143,8 @@ async def list_by_name( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py index fb6ba79f866cc..71bcd9cc55e57 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models.py @@ -342,6 +342,9 @@ class MultiMetricCriteria(msrest.serialization.Model): :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType :param dimensions: List of dimension conditions. :type dimensions: list[~$(python-base-namespace).v2018_03_01.models.MetricDimension] + :param skip_metric_validation: Allows creating an alert rule on a custom metric that isn't yet + emitted, by causing the metric validation to be skipped. + :type skip_metric_validation: bool """ _validation = { @@ -359,6 +362,7 @@ class MultiMetricCriteria(msrest.serialization.Model): 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'}, } _subtype_map = { @@ -371,12 +375,13 @@ def __init__( ): super(MultiMetricCriteria, self).__init__(**kwargs) self.additional_properties = kwargs.get('additional_properties', None) - self.criterion_type = 'MultiMetricCriteria' + self.criterion_type = 'MultiMetricCriteria' # type: str self.name = kwargs['name'] self.metric_name = kwargs['metric_name'] self.metric_namespace = kwargs.get('metric_namespace', None) self.time_aggregation = kwargs['time_aggregation'] self.dimensions = kwargs.get('dimensions', None) + self.skip_metric_validation = kwargs.get('skip_metric_validation', None) class DynamicMetricCriteria(MultiMetricCriteria): @@ -401,6 +406,9 @@ class DynamicMetricCriteria(MultiMetricCriteria): :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType :param dimensions: List of dimension conditions. :type dimensions: list[~$(python-base-namespace).v2018_03_01.models.MetricDimension] + :param skip_metric_validation: Allows creating an alert rule on a custom metric that isn't yet + emitted, by causing the metric validation to be skipped. + :type skip_metric_validation: bool :param operator: Required. The operator used to compare the metric value against the threshold. Possible values include: "GreaterThan", "LessThan", "GreaterOrLessThan". :type operator: str or ~$(python-base-namespace).v2018_03_01.models.DynamicThresholdOperator @@ -436,6 +444,7 @@ class DynamicMetricCriteria(MultiMetricCriteria): 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'}, 'operator': {'key': 'operator', 'type': 'str'}, 'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'str'}, 'failing_periods': {'key': 'failingPeriods', 'type': 'DynamicThresholdFailingPeriods'}, @@ -447,7 +456,7 @@ def __init__( **kwargs ): super(DynamicMetricCriteria, self).__init__(**kwargs) - self.criterion_type = 'DynamicThresholdCriterion' + self.criterion_type = 'DynamicThresholdCriterion' # type: str self.operator = kwargs['operator'] self.alert_sensitivity = kwargs['alert_sensitivity'] self.failing_periods = kwargs['failing_periods'] @@ -720,7 +729,7 @@ def __init__( ): super(MetricAlertCriteria, self).__init__(**kwargs) self.additional_properties = kwargs.get('additional_properties', None) - self.odata_type = 'MetricAlertCriteria' + self.odata_type = 'MetricAlertCriteria' # type: str class MetricAlertMultipleResourceMultipleMetricCriteria(MetricAlertCriteria): @@ -756,7 +765,7 @@ def __init__( **kwargs ): super(MetricAlertMultipleResourceMultipleMetricCriteria, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' + self.odata_type = 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' # type: str self.all_of = kwargs.get('all_of', None) @@ -995,7 +1004,7 @@ def __init__( **kwargs ): super(MetricAlertSingleResourceMultipleMetricCriteria, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' + self.odata_type = 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' # type: str self.all_of = kwargs.get('all_of', None) @@ -1098,6 +1107,9 @@ class MetricCriteria(MultiMetricCriteria): :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType :param dimensions: List of dimension conditions. :type dimensions: list[~$(python-base-namespace).v2018_03_01.models.MetricDimension] + :param skip_metric_validation: Allows creating an alert rule on a custom metric that isn't yet + emitted, by causing the metric validation to be skipped. + :type skip_metric_validation: bool :param operator: Required. the criteria operator. Possible values include: "Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual". :type operator: str or ~$(python-base-namespace).v2018_03_01.models.Operator @@ -1122,6 +1134,7 @@ class MetricCriteria(MultiMetricCriteria): 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'}, 'operator': {'key': 'operator', 'type': 'str'}, 'threshold': {'key': 'threshold', 'type': 'float'}, } @@ -1131,7 +1144,7 @@ def __init__( **kwargs ): super(MetricCriteria, self).__init__(**kwargs) - self.criterion_type = 'StaticThresholdCriterion' + self.criterion_type = 'StaticThresholdCriterion' # type: str self.operator = kwargs['operator'] self.threshold = kwargs['threshold'] @@ -1324,7 +1337,7 @@ def __init__( **kwargs ): super(WebtestLocationAvailabilityCriteria, self).__init__(**kwargs) - self.odata_type = 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' + self.odata_type = 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' # type: str self.web_test_id = kwargs['web_test_id'] self.component_id = kwargs['component_id'] self.failed_location_count = kwargs['failed_location_count'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py index d5557bbb3022b..71c354aaab1af 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_models_py3.py @@ -385,6 +385,9 @@ class MultiMetricCriteria(msrest.serialization.Model): :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType :param dimensions: List of dimension conditions. :type dimensions: list[~$(python-base-namespace).v2018_03_01.models.MetricDimension] + :param skip_metric_validation: Allows creating an alert rule on a custom metric that isn't yet + emitted, by causing the metric validation to be skipped. + :type skip_metric_validation: bool """ _validation = { @@ -402,6 +405,7 @@ class MultiMetricCriteria(msrest.serialization.Model): 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'}, } _subtype_map = { @@ -417,16 +421,18 @@ def __init__( additional_properties: Optional[Dict[str, object]] = None, metric_namespace: Optional[str] = None, dimensions: Optional[List["MetricDimension"]] = None, + skip_metric_validation: Optional[bool] = None, **kwargs ): super(MultiMetricCriteria, self).__init__(**kwargs) self.additional_properties = additional_properties - self.criterion_type: str = 'MultiMetricCriteria' + self.criterion_type = 'MultiMetricCriteria' # type: str self.name = name self.metric_name = metric_name self.metric_namespace = metric_namespace self.time_aggregation = time_aggregation self.dimensions = dimensions + self.skip_metric_validation = skip_metric_validation class DynamicMetricCriteria(MultiMetricCriteria): @@ -451,6 +457,9 @@ class DynamicMetricCriteria(MultiMetricCriteria): :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType :param dimensions: List of dimension conditions. :type dimensions: list[~$(python-base-namespace).v2018_03_01.models.MetricDimension] + :param skip_metric_validation: Allows creating an alert rule on a custom metric that isn't yet + emitted, by causing the metric validation to be skipped. + :type skip_metric_validation: bool :param operator: Required. The operator used to compare the metric value against the threshold. Possible values include: "GreaterThan", "LessThan", "GreaterOrLessThan". :type operator: str or ~$(python-base-namespace).v2018_03_01.models.DynamicThresholdOperator @@ -486,6 +495,7 @@ class DynamicMetricCriteria(MultiMetricCriteria): 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'}, 'operator': {'key': 'operator', 'type': 'str'}, 'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'str'}, 'failing_periods': {'key': 'failingPeriods', 'type': 'DynamicThresholdFailingPeriods'}, @@ -504,11 +514,12 @@ def __init__( additional_properties: Optional[Dict[str, object]] = None, metric_namespace: Optional[str] = None, dimensions: Optional[List["MetricDimension"]] = None, + skip_metric_validation: Optional[bool] = None, ignore_data_before: Optional[datetime.datetime] = None, **kwargs ): - super(DynamicMetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, **kwargs) - self.criterion_type: str = 'DynamicThresholdCriterion' + super(DynamicMetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, skip_metric_validation=skip_metric_validation, **kwargs) + self.criterion_type = 'DynamicThresholdCriterion' # type: str self.operator = operator self.alert_sensitivity = alert_sensitivity self.failing_periods = failing_periods @@ -807,7 +818,7 @@ def __init__( ): super(MetricAlertCriteria, self).__init__(**kwargs) self.additional_properties = additional_properties - self.odata_type: str = 'MetricAlertCriteria' + self.odata_type = 'MetricAlertCriteria' # type: str class MetricAlertMultipleResourceMultipleMetricCriteria(MetricAlertCriteria): @@ -846,7 +857,7 @@ def __init__( **kwargs ): super(MetricAlertMultipleResourceMultipleMetricCriteria, self).__init__(additional_properties=additional_properties, **kwargs) - self.odata_type: str = 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' + self.odata_type = 'Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria' # type: str self.all_of = all_of @@ -1117,7 +1128,7 @@ def __init__( **kwargs ): super(MetricAlertSingleResourceMultipleMetricCriteria, self).__init__(additional_properties=additional_properties, **kwargs) - self.odata_type: str = 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' + self.odata_type = 'Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria' # type: str self.all_of = all_of @@ -1231,6 +1242,9 @@ class MetricCriteria(MultiMetricCriteria): :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType :param dimensions: List of dimension conditions. :type dimensions: list[~$(python-base-namespace).v2018_03_01.models.MetricDimension] + :param skip_metric_validation: Allows creating an alert rule on a custom metric that isn't yet + emitted, by causing the metric validation to be skipped. + :type skip_metric_validation: bool :param operator: Required. the criteria operator. Possible values include: "Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual". :type operator: str or ~$(python-base-namespace).v2018_03_01.models.Operator @@ -1255,6 +1269,7 @@ class MetricCriteria(MultiMetricCriteria): 'metric_namespace': {'key': 'metricNamespace', 'type': 'str'}, 'time_aggregation': {'key': 'timeAggregation', 'type': 'str'}, 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'}, 'operator': {'key': 'operator', 'type': 'str'}, 'threshold': {'key': 'threshold', 'type': 'float'}, } @@ -1270,10 +1285,11 @@ def __init__( additional_properties: Optional[Dict[str, object]] = None, metric_namespace: Optional[str] = None, dimensions: Optional[List["MetricDimension"]] = None, + skip_metric_validation: Optional[bool] = None, **kwargs ): - super(MetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, **kwargs) - self.criterion_type: str = 'StaticThresholdCriterion' + super(MetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, skip_metric_validation=skip_metric_validation, **kwargs) + self.criterion_type = 'StaticThresholdCriterion' # type: str self.operator = operator self.threshold = threshold @@ -1486,7 +1502,7 @@ def __init__( **kwargs ): super(WebtestLocationAvailabilityCriteria, self).__init__(additional_properties=additional_properties, **kwargs) - self.odata_type: str = 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' + self.odata_type = 'Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria' # type: str self.web_test_id = web_test_id self.component_id = component_id self.failed_location_count = failed_location_count diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_client_enums.py index 26972cdcbee26..974c2895a8cb3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_client_enums.py @@ -6,66 +6,84 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AggregationType(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the criteria time aggregation types. """ - average = "Average" - count = "Count" - minimum = "Minimum" - maximum = "Maximum" - total = "Total" + AVERAGE = "Average" + COUNT = "Count" + MINIMUM = "Minimum" + MAXIMUM = "Maximum" + TOTAL = "Total" -class CriterionType(str, Enum): +class CriterionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the type of threshold criteria """ - static_threshold_criterion = "StaticThresholdCriterion" - dynamic_threshold_criterion = "DynamicThresholdCriterion" + STATIC_THRESHOLD_CRITERION = "StaticThresholdCriterion" + DYNAMIC_THRESHOLD_CRITERION = "DynamicThresholdCriterion" -class DynamicThresholdOperator(str, Enum): +class DynamicThresholdOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The operator used to compare the metric value against the threshold. """ - greater_than = "GreaterThan" - less_than = "LessThan" - greater_or_less_than = "GreaterOrLessThan" + GREATER_THAN = "GreaterThan" + LESS_THAN = "LessThan" + GREATER_OR_LESS_THAN = "GreaterOrLessThan" -class DynamicThresholdSensitivity(str, Enum): +class DynamicThresholdSensitivity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. """ - low = "Low" - medium = "Medium" - high = "High" + LOW = "Low" + MEDIUM = "Medium" + HIGH = "High" -class Odatatype(str, Enum): +class Odatatype(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """specifies the type of the alert criteria. """ - microsoft_azure_monitor_single_resource_multiple_metric_criteria = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" - microsoft_azure_monitor_multiple_resource_multiple_metric_criteria = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" - microsoft_azure_monitor_webtest_location_availability_criteria = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" + MICROSOFT_AZURE_MONITOR_SINGLE_RESOURCE_MULTIPLE_METRIC_CRITERIA = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" + MICROSOFT_AZURE_MONITOR_MULTIPLE_RESOURCE_MULTIPLE_METRIC_CRITERIA = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" + MICROSOFT_AZURE_MONITOR_WEBTEST_LOCATION_AVAILABILITY_CRITERIA = "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" -class Operator(str, Enum): +class Operator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the criteria operator. """ - equals = "Equals" - not_equals = "NotEquals" - greater_than = "GreaterThan" - greater_than_or_equal = "GreaterThanOrEqual" - less_than = "LessThan" - less_than_or_equal = "LessThanOrEqual" + EQUALS = "Equals" + NOT_EQUALS = "NotEquals" + GREATER_THAN = "GreaterThan" + GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + LESS_THAN = "LessThan" + LESS_THAN_OR_EQUAL = "LessThanOrEqual" -class ReceiverStatus(str, Enum): +class ReceiverStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications. """ - not_specified = "NotSpecified" - enabled = "Enabled" - disabled = "Disabled" + NOT_SPECIFIED = "NotSpecified" + ENABLED = "Enabled" + DISABLED = "Disabled" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_action_groups_operations.py index 4b66802d0a68b..e3123cfd1b688 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_action_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -136,9 +136,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -155,9 +158,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -194,9 +196,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -213,8 +218,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,10 +256,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -272,14 +280,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -309,11 +315,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -325,15 +338,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -377,11 +386,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -394,15 +410,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,10 +465,13 @@ def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -474,13 +489,12 @@ def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_operations.py index 9dd3a99353e11..c5ad151d7ce1b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -58,11 +58,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -74,15 +81,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -126,11 +129,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -143,15 +153,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -198,9 +204,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -217,9 +226,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -259,10 +267,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -280,14 +291,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'MetricAlertResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -326,10 +335,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -347,14 +359,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'MetricAlertResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -390,7 +400,9 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" @@ -410,7 +422,6 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_status_operations.py index db320c5be98dc..605a407e5c61d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_status_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/operations/_metric_alerts_status_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -63,9 +63,12 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertStatusCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore @@ -82,9 +85,8 @@ def list( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -124,9 +126,12 @@ def list_by_name( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricAlertStatusCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.list_by_name.metadata['url'] # type: ignore @@ -144,9 +149,8 @@ def list_by_name( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_configuration.py index 0e0dd7b8659b6..057a1701351fd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-04-16" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_metadata.json index ae1cfbc1b18f5..fb33a5064fd05 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "scheduled_query_rules": "ScheduledQueryRulesOperations" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py index 251c85804e31a..f79b4be96052c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py @@ -32,7 +32,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.scheduled_query_rules = ScheduledQueryRulesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py index 4e3b2e1431dd7..ca313cc14b8a4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-04-16" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py index 9c0d7cba5d1e9..d720ac96d6704 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py @@ -15,8 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import ScheduledQueryRulesOperations +from ._configuration import MonitorClientConfiguration +from .operations import ScheduledQueryRulesOperations from .. import models @@ -24,13 +24,12 @@ class MonitorClient(object): """Monitor Management Client. :ivar scheduled_query_rules: ScheduledQueryRulesOperations operations - :vartype scheduled_query_rules: $(python-base-namespace).v2018_04_16.aio.operations_async.ScheduledQueryRulesOperations + :vartype scheduled_query_rules: $(python-base-namespace).v2018_04_16.aio.operations.ScheduledQueryRulesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.scheduled_query_rules = ScheduledQueryRulesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/__init__.py similarity index 86% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/__init__.py index 1dd56d6b65497..f677702ed3df4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._scheduled_query_rules_operations_async import ScheduledQueryRulesOperations +from ._scheduled_query_rules_operations import ScheduledQueryRulesOperations __all__ = [ 'ScheduledQueryRulesOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations_async/_scheduled_query_rules_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations_async/_scheduled_query_rules_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py index 4f06359015b60..05fe997303bc6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations_async/_scheduled_query_rules_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogSearchRuleResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('LogSearchRuleResource', pipeline_response) @@ -130,9 +130,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -149,9 +152,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -190,10 +192,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -211,14 +216,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogSearchRuleResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -253,9 +256,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -272,8 +278,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -296,7 +302,7 @@ def list_by_subscription( """List the Log Search rules within a subscription group. :param filter: The filter to apply on the operation. For more information please see - https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. + https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LogSearchRuleResourceCollection or the result of cls(response) @@ -304,11 +310,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -322,15 +335,11 @@ def prepare_request(next_link=None): if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -369,7 +378,7 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param filter: The filter to apply on the operation. For more information please see - https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. + https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LogSearchRuleResourceCollection or the result of cls(response) @@ -377,11 +386,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -396,15 +412,11 @@ def prepare_request(next_link=None): if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/__init__.py index 5de9dfdd0550f..414cf032d41ac 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/__init__.py @@ -44,7 +44,9 @@ ConditionalOperator, Enabled, MetricTriggerType, + Operator, ProvisioningState, + QueryType, ) __all__ = [ @@ -67,5 +69,7 @@ 'ConditionalOperator', 'Enabled', 'MetricTriggerType', + 'Operator', 'ProvisioningState', + 'QueryType', ] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_models.py index 5cdd6cc36046f..6fd144dc7a89b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_models.py @@ -40,7 +40,7 @@ def __init__( **kwargs ): super(Action, self).__init__(**kwargs) - self.odata_type = None + self.odata_type = None # type: Optional[str] class AlertingAction(Action): @@ -81,7 +81,7 @@ def __init__( **kwargs ): super(AlertingAction, self).__init__(**kwargs) - self.odata_type = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction' + self.odata_type = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction' # type: str self.severity = kwargs['severity'] self.azns_action = kwargs.get('azns_action', None) self.throttling_in_min = kwargs.get('throttling_in_min', None) @@ -148,21 +148,19 @@ def __init__( class Dimension(msrest.serialization.Model): """Specifies the criteria for converting log to metric. - 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 Azure. :param name: Required. Name of the dimension. :type name: str - :ivar operator: Required. Operator for dimension values. Default value: "Include". - :vartype operator: str + :param operator: Required. Operator for dimension values. Possible values include: "Include". + :type operator: str or ~$(python-base-namespace).v2018_04_16.models.Operator :param values: Required. List of dimension values. :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True, 'constant': True}, + 'operator': {'required': True}, 'values': {'required': True}, } @@ -172,14 +170,13 @@ class Dimension(msrest.serialization.Model): 'values': {'key': 'values', 'type': '[str]'}, } - operator = "Include" - def __init__( self, **kwargs ): super(Dimension, self).__init__(**kwargs) self.name = kwargs['name'] + self.operator = kwargs['operator'] self.values = kwargs['values'] @@ -434,7 +431,7 @@ def __init__( **kwargs ): super(LogToMetricAction, self).__init__(**kwargs) - self.odata_type = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction' + self.odata_type = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction' # type: str self.criteria = kwargs['criteria'] @@ -473,8 +470,6 @@ def __init__( class Source(msrest.serialization.Model): """Specifies the log search query. - 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 Azure. :param query: Log search query. Required for action type - AlertingAction. @@ -483,13 +478,12 @@ class Source(msrest.serialization.Model): :type authorized_resources: list[str] :param data_source_id: Required. The resource uri over which log search query is to be run. :type data_source_id: str - :ivar query_type: Set value to 'ResultCount' . Default value: "ResultCount". - :vartype query_type: str + :param query_type: Set value to 'ResultCount' . Possible values include: "ResultCount". + :type query_type: str or ~$(python-base-namespace).v2018_04_16.models.QueryType """ _validation = { 'data_source_id': {'required': True}, - 'query_type': {'constant': True}, } _attribute_map = { @@ -499,8 +493,6 @@ class Source(msrest.serialization.Model): 'query_type': {'key': 'queryType', 'type': 'str'}, } - query_type = "ResultCount" - def __init__( self, **kwargs @@ -509,6 +501,7 @@ def __init__( self.query = kwargs.get('query', None) self.authorized_resources = kwargs.get('authorized_resources', None) self.data_source_id = kwargs['data_source_id'] + self.query_type = kwargs.get('query_type', None) class TriggerCondition(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_models_py3.py index 0cb4a45a5ab9f..a8cb4d9a7a60a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_models_py3.py @@ -44,7 +44,7 @@ def __init__( **kwargs ): super(Action, self).__init__(**kwargs) - self.odata_type: Optional[str] = None + self.odata_type = None # type: Optional[str] class AlertingAction(Action): @@ -90,7 +90,7 @@ def __init__( **kwargs ): super(AlertingAction, self).__init__(**kwargs) - self.odata_type: str = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction' + self.odata_type = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction' # type: str self.severity = severity self.azns_action = azns_action self.throttling_in_min = throttling_in_min @@ -164,21 +164,19 @@ def __init__( class Dimension(msrest.serialization.Model): """Specifies the criteria for converting log to metric. - 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 Azure. :param name: Required. Name of the dimension. :type name: str - :ivar operator: Required. Operator for dimension values. Default value: "Include". - :vartype operator: str + :param operator: Required. Operator for dimension values. Possible values include: "Include". + :type operator: str or ~$(python-base-namespace).v2018_04_16.models.Operator :param values: Required. List of dimension values. :type values: list[str] """ _validation = { 'name': {'required': True}, - 'operator': {'required': True, 'constant': True}, + 'operator': {'required': True}, 'values': {'required': True}, } @@ -188,17 +186,17 @@ class Dimension(msrest.serialization.Model): 'values': {'key': 'values', 'type': '[str]'}, } - operator = "Include" - def __init__( self, *, name: str, + operator: Union[str, "Operator"], values: List[str], **kwargs ): super(Dimension, self).__init__(**kwargs) self.name = name + self.operator = operator self.values = values @@ -479,7 +477,7 @@ def __init__( **kwargs ): super(LogToMetricAction, self).__init__(**kwargs) - self.odata_type: str = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction' + self.odata_type = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction' # type: str self.criteria = criteria @@ -521,8 +519,6 @@ def __init__( class Source(msrest.serialization.Model): """Specifies the log search query. - 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 Azure. :param query: Log search query. Required for action type - AlertingAction. @@ -531,13 +527,12 @@ class Source(msrest.serialization.Model): :type authorized_resources: list[str] :param data_source_id: Required. The resource uri over which log search query is to be run. :type data_source_id: str - :ivar query_type: Set value to 'ResultCount' . Default value: "ResultCount". - :vartype query_type: str + :param query_type: Set value to 'ResultCount' . Possible values include: "ResultCount". + :type query_type: str or ~$(python-base-namespace).v2018_04_16.models.QueryType """ _validation = { 'data_source_id': {'required': True}, - 'query_type': {'constant': True}, } _attribute_map = { @@ -547,20 +542,20 @@ class Source(msrest.serialization.Model): 'query_type': {'key': 'queryType', 'type': 'str'}, } - query_type = "ResultCount" - def __init__( self, *, data_source_id: str, query: Optional[str] = None, authorized_resources: Optional[List[str]] = None, + query_type: Optional[Union[str, "QueryType"]] = None, **kwargs ): super(Source, self).__init__(**kwargs) self.query = query self.authorized_resources = authorized_resources self.data_source_id = data_source_id + self.query_type = query_type class TriggerCondition(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_monitor_client_enums.py index 08d5bbbba0cbf..67e81c2a01444 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_monitor_client_enums.py @@ -6,46 +6,76 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class AlertSeverity(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AlertSeverity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Severity Level of Alert """ - zero = "0" - one = "1" - two = "2" - three = "3" - four = "4" + ZERO = "0" + ONE = "1" + TWO = "2" + THREE = "3" + FOUR = "4" -class ConditionalOperator(str, Enum): +class ConditionalOperator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Result Condition Evaluation criteria. Supported Values - 'GreaterThan' or 'LessThan' or 'Equal'. """ - greater_than = "GreaterThan" - less_than = "LessThan" - equal = "Equal" + GREATER_THAN = "GreaterThan" + LESS_THAN = "LessThan" + EQUAL = "Equal" -class Enabled(str, Enum): +class Enabled(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The flag which indicates whether the Log Search rule is enabled. Value should be true or false """ - true = "true" - false = "false" + TRUE = "true" + FALSE = "false" -class MetricTriggerType(str, Enum): +class MetricTriggerType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Metric Trigger Evaluation Type """ - consecutive = "Consecutive" - total = "Total" + CONSECUTIVE = "Consecutive" + TOTAL = "Total" + +class Operator(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Operator for dimension values + """ -class ProvisioningState(str, Enum): + INCLUDE = "Include" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Provisioning state of the scheduled query rule """ - succeeded = "Succeeded" - deploying = "Deploying" - canceled = "Canceled" - failed = "Failed" + SUCCEEDED = "Succeeded" + DEPLOYING = "Deploying" + CANCELED = "Canceled" + FAILED = "Failed" + +class QueryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Set value to 'ResultAccount' + """ + + RESULT_COUNT = "ResultCount" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/operations/_scheduled_query_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/operations/_scheduled_query_rules_operations.py index 9b9a052c444a3..190bb72db8dc1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/operations/_scheduled_query_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/operations/_scheduled_query_rules_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogSearchRuleResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('LogSearchRuleResource', pipeline_response) @@ -136,9 +136,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -155,9 +158,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,10 +199,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -218,14 +223,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'LogSearchRuleResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -261,9 +264,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -280,8 +286,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -305,7 +311,7 @@ def list_by_subscription( """List the Log Search rules within a subscription group. :param filter: The filter to apply on the operation. For more information please see - https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. + https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LogSearchRuleResourceCollection or the result of cls(response) @@ -313,11 +319,18 @@ def list_by_subscription( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore @@ -331,15 +344,11 @@ def prepare_request(next_link=None): if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -379,7 +388,7 @@ def list_by_resource_group( :param resource_group_name: The name of the resource group. :type resource_group_name: str :param filter: The filter to apply on the operation. For more information please see - https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. + https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LogSearchRuleResourceCollection or the result of cls(response) @@ -387,11 +396,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.LogSearchRuleResourceCollection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-04-16" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -406,15 +422,11 @@ def prepare_request(next_link=None): if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_configuration.py index f184b74117050..5ac948acf27a6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-06-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_metadata.json index 28ea8a1298819..04a8308bde250 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "guest_diagnostics_settings_association": "GuestDiagnosticsSettingsAssociationOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py index 5ee0e53de7d94..4c51e4bdb45e6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py @@ -35,7 +35,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -53,6 +52,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.guest_diagnostics_settings_association = GuestDiagnosticsSettingsAssociationOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py index bdcff4840e503..169f07e9f2e80 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-06-01-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py similarity index 84% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py index 97f29b9afcea3..9210c25c55154 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py @@ -15,9 +15,9 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import GuestDiagnosticsSettingsAssociationOperations -from .operations_async import GuestDiagnosticsSettingsOperations +from ._configuration import MonitorClientConfiguration +from .operations import GuestDiagnosticsSettingsAssociationOperations +from .operations import GuestDiagnosticsSettingsOperations from .. import models @@ -25,15 +25,14 @@ class MonitorClient(object): """Monitor Management Client. :ivar guest_diagnostics_settings_association: GuestDiagnosticsSettingsAssociationOperations operations - :vartype guest_diagnostics_settings_association: $(python-base-namespace).v2018_06_01_preview.aio.operations_async.GuestDiagnosticsSettingsAssociationOperations + :vartype guest_diagnostics_settings_association: $(python-base-namespace).v2018_06_01_preview.aio.operations.GuestDiagnosticsSettingsAssociationOperations :ivar guest_diagnostics_settings: GuestDiagnosticsSettingsOperations operations - :vartype guest_diagnostics_settings: $(python-base-namespace).v2018_06_01_preview.aio.operations_async.GuestDiagnosticsSettingsOperations + :vartype guest_diagnostics_settings: $(python-base-namespace).v2018_06_01_preview.aio.operations.GuestDiagnosticsSettingsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.guest_diagnostics_settings_association = GuestDiagnosticsSettingsAssociationOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/__init__.py similarity index 73% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/__init__.py index 3f4591e3ff071..3ba5f92c180a8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._guest_diagnostics_settings_association_operations_async import GuestDiagnosticsSettingsAssociationOperations -from ._guest_diagnostics_settings_operations_async import GuestDiagnosticsSettingsOperations +from ._guest_diagnostics_settings_association_operations import GuestDiagnosticsSettingsAssociationOperations +from ._guest_diagnostics_settings_operations import GuestDiagnosticsSettingsOperations __all__ = [ 'GuestDiagnosticsSettingsAssociationOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations_async/_guest_diagnostics_settings_association_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations_async/_guest_diagnostics_settings_association_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py index 800a4871fffe6..1b1ebe3f7d3e0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations_async/_guest_diagnostics_settings_association_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -64,10 +64,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -84,14 +87,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(diagnostic_settings_association, 'GuestDiagnosticSettingsAssociationResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -100,7 +101,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('GuestDiagnosticSettingsAssociationResource', pipeline_response) @@ -132,9 +132,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -150,9 +153,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -189,9 +191,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -207,8 +212,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -246,10 +251,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -266,14 +274,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'GuestDiagnosticSettingsAssociationResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -302,11 +308,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -318,15 +331,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -369,11 +378,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -386,15 +402,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations_async/_guest_diagnostics_settings_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations_async/_guest_diagnostics_settings_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py index e660487924184..0d71030a2a171 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations_async/_guest_diagnostics_settings_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(diagnostic_settings, 'GuestDiagnosticSettingsResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('GuestDiagnosticSettingsResource', pipeline_response) @@ -130,9 +130,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -149,9 +152,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -190,10 +192,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -211,14 +216,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'GuestDiagnosticSettingsPatchResource') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -227,7 +230,6 @@ async def update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('GuestDiagnosticSettingsResource', pipeline_response) @@ -258,9 +260,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -277,8 +282,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -305,11 +310,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -321,15 +333,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -372,11 +380,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -389,15 +404,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_monitor_client_enums.py index f6540e4dabc59..fdd4cc87df813 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_monitor_client_enums.py @@ -6,25 +6,43 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class DataSourceKind(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class DataSourceKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Datasource kind """ - performance_counter = "PerformanceCounter" - etw_providers = "ETWProviders" - windows_event_logs = "WindowsEventLogs" + PERFORMANCE_COUNTER = "PerformanceCounter" + ETW_PROVIDERS = "ETWProviders" + WINDOWS_EVENT_LOGS = "WindowsEventLogs" -class GuestDiagnosticSettingsOsType(str, Enum): +class GuestDiagnosticSettingsOsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Operating system type for the configuration """ - windows = "Windows" - linux = "Linux" + WINDOWS = "Windows" + LINUX = "Linux" -class SinkConfigurationKind(str, Enum): +class SinkConfigurationKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - event_hub = "EventHub" - application_insights = "ApplicationInsights" - log_analytics = "LogAnalytics" + EVENT_HUB = "EventHub" + APPLICATION_INSIGHTS = "ApplicationInsights" + LOG_ANALYTICS = "LogAnalytics" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_association_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_association_operations.py index ca51c9811a8fe..c730084dc51ce 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_association_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_association_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -69,10 +69,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -89,14 +92,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(diagnostic_settings_association, 'GuestDiagnosticSettingsAssociationResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -105,7 +106,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('GuestDiagnosticSettingsAssociationResource', pipeline_response) @@ -138,9 +138,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -156,9 +159,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -196,9 +198,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -214,8 +219,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -254,10 +259,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -274,14 +282,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'GuestDiagnosticSettingsAssociationResourcePatch') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -311,11 +317,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -327,15 +340,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -379,11 +388,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsAssociationList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -396,15 +412,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_operations.py index 698890fa7a0f6..67a7f766c3e8f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/operations/_guest_diagnostics_settings_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(diagnostic_settings, 'GuestDiagnosticSettingsResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('GuestDiagnosticSettingsResource', pipeline_response) @@ -136,9 +136,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -155,9 +158,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -197,10 +199,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -218,14 +223,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'GuestDiagnosticSettingsPatchResource') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -234,7 +237,6 @@ def update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('GuestDiagnosticSettingsResource', pipeline_response) @@ -266,9 +268,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -285,8 +290,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -314,11 +319,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -330,15 +342,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -382,11 +390,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.GuestDiagnosticSettingsList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-06-01-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -399,15 +414,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_configuration.py index 7ab63db49e75d..37323d0126ed3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-09-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_metadata.json index 4f5250641ce92..3e61eec803470 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "action_groups": "ActionGroupsOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py index 45cb90630f5b6..425ab6863cfa9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py @@ -38,7 +38,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -56,6 +55,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py index 8fb5fdd41e108..eed1aaa61ef21 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2018-09-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py similarity index 85% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py index 1107a0a923001..5549ee3ad4c34 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py @@ -15,10 +15,10 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import ActionGroupsOperations -from .operations_async import MetricBaselineOperations -from .operations_async import BaselineOperations +from ._configuration import MonitorClientConfiguration +from .operations import ActionGroupsOperations +from .operations import MetricBaselineOperations +from .operations import BaselineOperations from .. import models @@ -26,17 +26,16 @@ class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations - :vartype action_groups: $(python-base-namespace).v2018_09_01.aio.operations_async.ActionGroupsOperations + :vartype action_groups: $(python-base-namespace).v2018_09_01.aio.operations.ActionGroupsOperations :ivar metric_baseline: MetricBaselineOperations operations - :vartype metric_baseline: $(python-base-namespace).v2018_09_01.aio.operations_async.MetricBaselineOperations + :vartype metric_baseline: $(python-base-namespace).v2018_09_01.aio.operations.MetricBaselineOperations :ivar baseline: BaselineOperations operations - :vartype baseline: $(python-base-namespace).v2018_09_01.aio.operations_async.BaselineOperations + :vartype baseline: $(python-base-namespace).v2018_09_01.aio.operations.BaselineOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -53,6 +52,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/__init__.py similarity index 74% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/__init__.py index 684c9ebce7227..636f48f0362a0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/__init__.py @@ -6,9 +6,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._action_groups_operations_async import ActionGroupsOperations -from ._metric_baseline_operations_async import MetricBaselineOperations -from ._baseline_operations_async import BaselineOperations +from ._action_groups_operations import ActionGroupsOperations +from ._metric_baseline_operations import MetricBaselineOperations +from ._baseline_operations import BaselineOperations __all__ = [ 'ActionGroupsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/_action_groups_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/_action_groups_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py index bf9cea406dbb8..df135300c0d2e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/_action_groups_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -130,9 +130,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -149,9 +152,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,9 +189,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -206,8 +211,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -243,10 +248,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -264,14 +272,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -300,11 +306,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -316,15 +329,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -367,11 +376,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -384,15 +400,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,10 +454,13 @@ async def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -463,13 +478,12 @@ async def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/_baseline_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py similarity index 94% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/_baseline_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py index 2c521e7c4ca9d..a1e357bac8155 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/_baseline_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py @@ -9,7 +9,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -86,9 +86,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -119,9 +122,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/_metric_baseline_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py similarity index 94% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/_metric_baseline_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py index 920b35d247b48..b3b9cd22981fa 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations_async/_metric_baseline_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py @@ -9,7 +9,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -86,9 +86,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -118,9 +121,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -160,10 +162,13 @@ async def calculate_baseline( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CalculateBaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.calculate_baseline.metadata['url'] # type: ignore @@ -179,14 +184,12 @@ async def calculate_baseline( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(time_series_information, 'TimeSeriesInformation') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_client_enums.py index e1b9ee4c9cc76..26ccadca63031 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_client_enums.py @@ -6,26 +6,44 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class ReceiverStatus(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ReceiverStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications. """ - not_specified = "NotSpecified" - enabled = "Enabled" - disabled = "Disabled" + NOT_SPECIFIED = "NotSpecified" + ENABLED = "Enabled" + DISABLED = "Disabled" -class ResultType(str, Enum): +class ResultType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - data = "Data" - metadata = "Metadata" + DATA = "Data" + METADATA = "Metadata" -class Sensitivity(str, Enum): +class Sensitivity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The sensitivity of the baseline. """ - low = "Low" - medium = "Medium" - high = "High" + LOW = "Low" + MEDIUM = "Medium" + HIGH = "High" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_action_groups_operations.py index 9c226edce714b..027d0716ac1af 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_action_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -136,9 +136,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -155,9 +158,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -194,9 +196,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -213,8 +218,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,10 +256,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -272,14 +280,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -309,11 +315,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -325,15 +338,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -377,11 +386,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -394,15 +410,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,10 +465,13 @@ def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -474,13 +489,12 @@ def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baseline_operations.py index 93c20fda662d1..95712395f509e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baseline_operations.py @@ -9,7 +9,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -91,9 +91,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -124,9 +127,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_metric_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_metric_baseline_operations.py index fe1f3b950f409..b2cdb7bb6e428 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_metric_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_metric_baseline_operations.py @@ -9,7 +9,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -91,9 +91,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.BaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -123,9 +126,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -166,10 +168,13 @@ def calculate_baseline( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.CalculateBaselineResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-09-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.calculate_baseline.metadata['url'] # type: ignore @@ -185,14 +190,12 @@ def calculate_baseline( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(time_series_information, 'TimeSeriesInformation') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_configuration.py index 250981e72cfbd..f9dcf79d380dc 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -41,8 +42,7 @@ def __init__( self.credential = credential self.api_version = "2018-11-27-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -55,6 +55,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_metadata.json index 745cd36e4eaa8..904ce44141fbf 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -29,7 +33,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "vm_insights": "VMInsightsOperations" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py index e88bbd8ead29c..3d0dfcc9d9d5a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py @@ -30,7 +30,6 @@ class MonitorClient(object): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.vm_insights = VMInsightsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py index 583ba020a07d3..ebb294089737c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -38,8 +39,7 @@ def __init__( self.credential = credential self.api_version = "2018-11-27-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -51,6 +51,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py index b53e78c6f94c9..062436d432e40 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py @@ -15,8 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import VMInsightsOperations +from ._configuration import MonitorClientConfiguration +from .operations import VMInsightsOperations from .. import models @@ -24,11 +24,10 @@ class MonitorClient(object): """Monitor Management Client. :ivar vm_insights: VMInsightsOperations operations - :vartype vm_insights: $(python-base-namespace).v2018_11_27_preview.aio.operations_async.VMInsightsOperations + :vartype vm_insights: $(python-base-namespace).v2018_11_27_preview.aio.operations.VMInsightsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -44,6 +43,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.vm_insights = VMInsightsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/__init__.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/__init__.py index 5bb4831cef8e6..4cae115ca3237 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._vm_insights_operations_async import VMInsightsOperations +from ._vm_insights_operations import VMInsightsOperations __all__ = [ 'VMInsightsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations_async/_vm_insights_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/_vm_insights_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations_async/_vm_insights_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/_vm_insights_operations.py index 2e7dbbbd96ad1..f0d98fcfa390b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations_async/_vm_insights_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/operations/_vm_insights_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -56,9 +56,12 @@ async def get_onboarding_status( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VMInsightsOnboardingStatus"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-27-preview" + accept = "application/json" # Construct URL url = self.get_onboarding_status.metadata['url'] # type: ignore @@ -73,9 +76,8 @@ async def get_onboarding_status( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_monitor_client_enums.py index 17760b6fcb268..6e32583e2c0c0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_monitor_client_enums.py @@ -6,22 +6,40 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class DataStatus(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class DataStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The status of VM Insights data from the resource. When reported as ``present`` the data array will contain information about the data containers to which data for the specified resource is being routed. """ - present = "present" - not_present = "notPresent" + PRESENT = "present" + NOT_PRESENT = "notPresent" -class OnboardingStatus(str, Enum): +class OnboardingStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at least one resource under it is onboarded. """ - onboarded = "onboarded" - not_onboarded = "notOnboarded" - unknown = "unknown" + ONBOARDED = "onboarded" + NOT_ONBOARDED = "notOnboarded" + UNKNOWN = "unknown" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/operations/_vm_insights_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/operations/_vm_insights_operations.py index 3dfca063b20b3..a76ef6e7f3ce0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/operations/_vm_insights_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/operations/_vm_insights_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -61,9 +61,12 @@ def get_onboarding_status( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.VMInsightsOnboardingStatus"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-11-27-preview" + accept = "application/json" # Construct URL url = self.get_onboarding_status.metadata['url'] # type: ignore @@ -78,9 +81,8 @@ def get_onboarding_status( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_configuration.py index f7cc1344ba244..b745daf540470 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-03-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_metadata.json index 10c6294053c26..24a87bcac7c46 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "action_groups": "ActionGroupsOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py index 23d723fb460fe..694541caa5e98 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py @@ -35,7 +35,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -53,6 +52,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py index 8253b4e03d89f..407068f252da7 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-03-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py index 08b5318277b77..a02d6dfbcf12b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py @@ -15,9 +15,9 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import ActionGroupsOperations -from .operations_async import BaselinesOperations +from ._configuration import MonitorClientConfiguration +from .operations import ActionGroupsOperations +from .operations import BaselinesOperations from .. import models @@ -25,15 +25,14 @@ class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations - :vartype action_groups: $(python-base-namespace).v2019_03_01.aio.operations_async.ActionGroupsOperations + :vartype action_groups: $(python-base-namespace).v2019_03_01.aio.operations.ActionGroupsOperations :ivar baselines: BaselinesOperations operations - :vartype baselines: $(python-base-namespace).v2019_03_01.aio.operations_async.BaselinesOperations + :vartype baselines: $(python-base-namespace).v2019_03_01.aio.operations.BaselinesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/__init__.py similarity index 80% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/__init__.py index fc892d08d4f98..1c9050bc3370a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._action_groups_operations_async import ActionGroupsOperations -from ._baselines_operations_async import BaselinesOperations +from ._action_groups_operations import ActionGroupsOperations +from ._baselines_operations import BaselinesOperations __all__ = [ 'ActionGroupsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations_async/_action_groups_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations_async/_action_groups_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py index f1b204ad18027..71171f8d75e8f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations_async/_action_groups_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -130,9 +130,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -149,9 +152,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,9 +189,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -206,8 +211,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -243,10 +248,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -264,14 +272,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -300,11 +306,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -316,15 +329,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -367,11 +376,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -384,15 +400,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,10 +454,13 @@ async def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -463,13 +478,12 @@ async def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations_async/_baselines_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py similarity index 83% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations_async/_baselines_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py index 85fcf01a50b41..1fbc07aa9dbc3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations_async/_baselines_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py @@ -10,7 +10,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -64,7 +64,7 @@ def list( :param metricnamespace: Metric namespace to query metric definitions for. :type metricnamespace: str :param timespan: The timespan of the query. It is a string with the following format - 'startDateTime_ISO/endDateTime_ISO'. + 'startDateTime_ISO/endDateTime_ISO'. :type timespan: str :param interval: The interval (i.e. timegrain) of the query. :type interval: ~datetime.timedelta @@ -73,17 +73,17 @@ def list( :param sensitivities: The list of sensitivities (comma separated) to retrieve. :type sensitivities: str :param filter: The **$filter** is used to reduce the set of metric data - returned.:code:`
`Example::code:`
`Metric contains metadata A, B and C.:code:`
`- - Return all time series of C where A = a1 and B = b1 or b2:code:`
`\ **$filter=A eq ‘a1’ and - B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**\ :code:`
`- Invalid variant::code:`
`\ **$filter=A - eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**\ :code:`
`This is invalid because the - logical or operator cannot separate two different metadata names.:code:`
`- Return all time - series where A = a1, B = b1 and C = c1::code:`
`\ **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq - ‘c1’**\ :code:`
`- Return all time series where A = a1:code:`
`\ **$filter=A eq ‘a1’ and - B eq ‘\ *’ and C eq ‘*\ ’**. + returned.:code:`
`Example::code:`
`Metric contains metadata A, B and C.:code:`
`- + Return all time series of C where A = a1 and B = b1 or b2:code:`
`\ **$filter=A eq ‘a1’ and + B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**\ :code:`
`- Invalid variant::code:`
`\ **$filter=A + eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**\ :code:`
`This is invalid because the + logical or operator cannot separate two different metadata names.:code:`
`- Return all time + series where A = a1, B = b1 and C = c1::code:`
`\ **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq + ‘c1’**\ :code:`
`- Return all time series where A = a1:code:`
`\ **$filter=A eq ‘a1’ and + B eq ‘\ *’ and C eq ‘*\ ’**. :type filter: str :param result_type: Allows retrieving only metadata of the baseline. On data request all - information is retrieved. + information is retrieved. :type result_type: str or ~$(python-base-namespace).v2019_03_01.models.ResultType :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MetricBaselinesResponse or the result of cls(response) @@ -91,11 +91,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricBaselinesResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -123,15 +130,11 @@ def prepare_request(next_link=None): query_parameters['resultType'] = self._serialize.query("result_type", result_type, 'str') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_monitor_client_enums.py index ac24b327880c2..3c4ff02d458d3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_monitor_client_enums.py @@ -6,26 +6,44 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class BaselineSensitivity(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class BaselineSensitivity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the sensitivity of the baseline. """ - low = "Low" - medium = "Medium" - high = "High" + LOW = "Low" + MEDIUM = "Medium" + HIGH = "High" -class ReceiverStatus(str, Enum): +class ReceiverStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications. """ - not_specified = "NotSpecified" - enabled = "Enabled" - disabled = "Disabled" + NOT_SPECIFIED = "NotSpecified" + ENABLED = "Enabled" + DISABLED = "Disabled" -class ResultType(str, Enum): +class ResultType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - data = "Data" - metadata = "Metadata" + DATA = "Data" + METADATA = "Metadata" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_action_groups_operations.py index 1e5486def040b..51eb052aeaca5 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_action_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -136,9 +136,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -155,9 +158,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -194,9 +196,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -213,8 +218,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,10 +256,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -272,14 +280,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -309,11 +315,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -325,15 +338,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -377,11 +386,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -394,15 +410,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,10 +465,13 @@ def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -474,13 +489,12 @@ def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py index 4cf7882d5ff0c..9cd5ecd4ec9f3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/operations/_baselines_operations.py @@ -9,7 +9,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -69,7 +69,7 @@ def list( :param metricnamespace: Metric namespace to query metric definitions for. :type metricnamespace: str :param timespan: The timespan of the query. It is a string with the following format - 'startDateTime_ISO/endDateTime_ISO'. + 'startDateTime_ISO/endDateTime_ISO'. :type timespan: str :param interval: The interval (i.e. timegrain) of the query. :type interval: ~datetime.timedelta @@ -78,17 +78,17 @@ def list( :param sensitivities: The list of sensitivities (comma separated) to retrieve. :type sensitivities: str :param filter: The **$filter** is used to reduce the set of metric data - returned.:code:`
`Example::code:`
`Metric contains metadata A, B and C.:code:`
`- - Return all time series of C where A = a1 and B = b1 or b2:code:`
`\ **$filter=A eq ‘a1’ and - B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**\ :code:`
`- Invalid variant::code:`
`\ **$filter=A - eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**\ :code:`
`This is invalid because the - logical or operator cannot separate two different metadata names.:code:`
`- Return all time - series where A = a1, B = b1 and C = c1::code:`
`\ **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq - ‘c1’**\ :code:`
`- Return all time series where A = a1:code:`
`\ **$filter=A eq ‘a1’ and - B eq ‘\ *’ and C eq ‘*\ ’**. + returned.:code:`
`Example::code:`
`Metric contains metadata A, B and C.:code:`
`- + Return all time series of C where A = a1 and B = b1 or b2:code:`
`\ **$filter=A eq ‘a1’ and + B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**\ :code:`
`- Invalid variant::code:`
`\ **$filter=A + eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**\ :code:`
`This is invalid because the + logical or operator cannot separate two different metadata names.:code:`
`- Return all time + series where A = a1, B = b1 and C = c1::code:`
`\ **$filter=A eq ‘a1’ and B eq ‘b1’ and C eq + ‘c1’**\ :code:`
`- Return all time series where A = a1:code:`
`\ **$filter=A eq ‘a1’ and + B eq ‘\ *’ and C eq ‘*\ ’**. :type filter: str :param result_type: Allows retrieving only metadata of the baseline. On data request all - information is retrieved. + information is retrieved. :type result_type: str or ~$(python-base-namespace).v2019_03_01.models.ResultType :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either MetricBaselinesResponse or the result of cls(response) @@ -96,11 +96,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.MetricBaselinesResponse"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-03-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -128,15 +135,11 @@ def prepare_request(next_link=None): query_parameters['resultType'] = self._serialize.query("result_type", result_type, 'str') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_configuration.py index 8f5230d5c179c..e5a8708721ec1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-06-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_metadata.json index e96e85be04084..f4fd97631fd60 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "action_groups": "ActionGroupsOperations" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py index 4b1ea55019ec2..69d3e351d3036 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py @@ -32,7 +32,6 @@ class MonitorClient(object): :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -50,6 +49,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py index 2982866c0c9a9..4926cceb67f89 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-06-01" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py index 122783dbad527..5e632bf1b35f2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py @@ -15,8 +15,8 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import ActionGroupsOperations +from ._configuration import MonitorClientConfiguration +from .operations import ActionGroupsOperations from .. import models @@ -24,13 +24,12 @@ class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations - :vartype action_groups: $(python-base-namespace).v2019_06_01.aio.operations_async.ActionGroupsOperations + :vartype action_groups: $(python-base-namespace).v2019_06_01.aio.operations.ActionGroupsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. :type subscription_id: str :param str base_url: Service URL - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -47,6 +46,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_groups = ActionGroupsOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/__init__.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/__init__.py index 912860b50fa45..dc488c51fcad0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/__init__.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._action_groups_operations_async import ActionGroupsOperations +from ._action_groups_operations import ActionGroupsOperations __all__ = [ 'ActionGroupsOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations_async/_action_groups_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations_async/_action_groups_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py index fe5353de618c1..011ea1f3e2c52 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations_async/_action_groups_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -62,10 +62,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -83,14 +86,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -99,7 +100,6 @@ async def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -130,9 +130,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -149,9 +152,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -187,9 +189,12 @@ async def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -206,8 +211,8 @@ async def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -243,10 +248,13 @@ async def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -264,14 +272,12 @@ async def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -300,11 +306,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -316,15 +329,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -367,11 +376,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -384,15 +400,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -442,10 +454,13 @@ async def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -463,13 +478,12 @@ async def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/_monitor_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/_monitor_client_enums.py index c823f8bd60265..238df22ea2f0b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/_monitor_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/_monitor_client_enums.py @@ -6,13 +6,31 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from enum import Enum +from enum import Enum, EnumMeta +from six import with_metaclass -class ReceiverStatus(str, Enum): +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class ReceiverStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications. """ - not_specified = "NotSpecified" - enabled = "Enabled" - disabled = "Disabled" + NOT_SPECIFIED = "NotSpecified" + ENABLED = "Enabled" + DISABLED = "Disabled" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/operations/_action_groups_operations.py index eaaf8b65c6f6d..6ce83244aee85 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/operations/_action_groups_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -67,10 +67,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -88,14 +91,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group, 'ActionGroupResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -104,7 +105,6 @@ def create_or_update( error = self._deserialize(models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('ActionGroupResource', pipeline_response) @@ -136,9 +136,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -155,9 +158,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -194,9 +196,12 @@ def delete( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore @@ -213,8 +218,8 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -251,10 +256,13 @@ def update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update.metadata['url'] # type: ignore @@ -272,14 +280,12 @@ def update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(action_group_patch, 'ActionGroupPatchBody') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -309,11 +315,18 @@ def list_by_subscription_id( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore @@ -325,15 +338,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -377,11 +386,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ActionGroupList"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -394,15 +410,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -453,10 +465,13 @@ def enable_receiver( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-06-01" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.enable_receiver.metadata['url'] # type: ignore @@ -474,13 +489,12 @@ def enable_receiver( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(enable_request, 'EnableRequest') body_content_kwargs['content'] = body_content request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/__init__.py index aa2ae096d6f8c..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/__init__.py @@ -10,7 +10,7 @@ __all__ = ['MonitorClient'] try: - from ._patch import patch_sdk + from ._patch import patch_sdk # type: ignore patch_sdk() except ImportError: pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py index c230061c60bb1..ae5dc051a0ced 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -47,8 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-10-17-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -61,6 +61,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_metadata.json index c674b0932bc0e..db10af186408c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_metadata.json @@ -4,7 +4,11 @@ "client": { "name": "MonitorClient", "filename": "_monitor_client", - "description": "Monitor Management Client." + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true }, "global_parameters": { "sync_method": { @@ -41,7 +45,10 @@ }, "config": { "credential": true, - "credential_scopes": ["https://management.azure.com/.default"] + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null }, "operation_groups": { "private_link_scopes": "PrivateLinkScopesOperations", diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py index 2ffccb0ba2ef8..7e250df0fab0d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py @@ -62,6 +62,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.private_link_scopes = PrivateLinkScopesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/__init__.py index 94deb09d251b6..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_client_async import MonitorClient +from ._monitor_client import MonitorClient __all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py index 1169ccfa22829..21d6b4e30631d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py @@ -10,6 +10,7 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -44,8 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = "2019-10-17-preview" - self.credential_scopes = ['https://management.azure.com/.default'] - self.credential_scopes.extend(kwargs.pop('credential_scopes', [])) + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) self._configure(**kwargs) @@ -57,6 +57,7 @@ def _configure( self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py similarity index 83% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py index def98547305f1..17ff10edd5762 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py @@ -15,12 +15,12 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration_async import MonitorClientConfiguration -from .operations_async import PrivateLinkScopesOperations -from .operations_async import PrivateLinkScopeOperationStatusOperations -from .operations_async import PrivateLinkResourcesOperations -from .operations_async import PrivateEndpointConnectionsOperations -from .operations_async import PrivateLinkScopedResourcesOperations +from ._configuration import MonitorClientConfiguration +from .operations import PrivateLinkScopesOperations +from .operations import PrivateLinkScopeOperationStatusOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkScopedResourcesOperations from .. import models @@ -28,15 +28,15 @@ class MonitorClient(object): """Monitor Management Client. :ivar private_link_scopes: PrivateLinkScopesOperations operations - :vartype private_link_scopes: $(python-base-namespace).v2019_10_17.aio.operations_async.PrivateLinkScopesOperations + :vartype private_link_scopes: $(python-base-namespace).v2019_10_17.aio.operations.PrivateLinkScopesOperations :ivar private_link_scope_operation_status: PrivateLinkScopeOperationStatusOperations operations - :vartype private_link_scope_operation_status: $(python-base-namespace).v2019_10_17.aio.operations_async.PrivateLinkScopeOperationStatusOperations + :vartype private_link_scope_operation_status: $(python-base-namespace).v2019_10_17.aio.operations.PrivateLinkScopeOperationStatusOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: $(python-base-namespace).v2019_10_17.aio.operations_async.PrivateLinkResourcesOperations + :vartype private_link_resources: $(python-base-namespace).v2019_10_17.aio.operations.PrivateLinkResourcesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations - :vartype private_endpoint_connections: $(python-base-namespace).v2019_10_17.aio.operations_async.PrivateEndpointConnectionsOperations + :vartype private_endpoint_connections: $(python-base-namespace).v2019_10_17.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_scoped_resources: PrivateLinkScopedResourcesOperations operations - :vartype private_link_scoped_resources: $(python-base-namespace).v2019_10_17.aio.operations_async.PrivateLinkScopedResourcesOperations + :vartype private_link_scoped_resources: $(python-base-namespace).v2019_10_17.aio.operations.PrivateLinkScopedResourcesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The Azure subscription Id. @@ -59,6 +59,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.private_link_scopes = PrivateLinkScopesOperations( diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/__init__.py similarity index 59% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/__init__.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/__init__.py index fd3f0de9e2810..2d05e3becea9c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/__init__.py @@ -6,11 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._private_link_scopes_operations_async import PrivateLinkScopesOperations -from ._private_link_scope_operation_status_operations_async import PrivateLinkScopeOperationStatusOperations -from ._private_link_resources_operations_async import PrivateLinkResourcesOperations -from ._private_endpoint_connections_operations_async import PrivateEndpointConnectionsOperations -from ._private_link_scoped_resources_operations_async import PrivateLinkScopedResourcesOperations +from ._private_link_scopes_operations import PrivateLinkScopesOperations +from ._private_link_scope_operation_status_operations import PrivateLinkScopeOperationStatusOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_scoped_resources_operations import PrivateLinkScopedResourcesOperations __all__ = [ 'PrivateLinkScopesOperations', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_endpoint_connections_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_endpoint_connections_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py index 2f46ba3d40059..b41712ae5507f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_endpoint_connections_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -84,9 +87,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -110,12 +112,15 @@ async def _create_or_update_initial( private_endpoint_connection_name: str, parameters: "models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.PrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -134,14 +139,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -166,7 +169,7 @@ async def begin_create_or_update( private_endpoint_connection_name: str, parameters: "models.PrivateEndpointConnection", **kwargs - ) -> "models.PrivateEndpointConnection": + ) -> AsyncLROPoller["models.PrivateEndpointConnection"]: """Approve or reject a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -183,8 +186,8 @@ async def begin_create_or_update( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~$(python-base-namespace).v2019_10_17.models.PrivateEndpointConnection + :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~$(python-base-namespace).v2019_10_17.models.PrivateEndpointConnection] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -236,7 +239,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" @@ -257,7 +262,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -277,7 +281,7 @@ async def begin_delete( scope_name: str, private_endpoint_connection_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -292,8 +296,8 @@ async def begin_delete( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :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: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -351,11 +355,18 @@ def list_by_private_link_scope( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore @@ -369,15 +380,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_resources_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_resources_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py index d391ed980c2c2..12fcc4dbf9965 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_resources_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -59,11 +59,18 @@ def list_by_private_link_scope( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore @@ -77,15 +84,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -133,9 +136,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -153,9 +159,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_scope_operation_status_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_scope_operation_status_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py index 13ad723c14729..3243b12b7d98e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_scope_operation_status_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py @@ -8,7 +8,7 @@ from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat @@ -59,9 +59,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -78,9 +81,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_scoped_resources_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_scoped_resources_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py index 008a6c2682dd5..2ca14616f0fa8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_scoped_resources_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod @@ -64,9 +64,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -84,9 +87,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -110,12 +112,15 @@ async def _create_or_update_initial( name: str, parameters: "models.ScopedResource", **kwargs - ) -> "models.ScopedResource": - cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + ) -> Optional["models.ScopedResource"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ScopedResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -134,14 +139,12 @@ async def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ScopedResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -169,7 +172,7 @@ async def begin_create_or_update( name: str, parameters: "models.ScopedResource", **kwargs - ) -> "models.ScopedResource": + ) -> AsyncLROPoller["models.ScopedResource"]: """Approve or reject a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -186,8 +189,8 @@ async def begin_create_or_update( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: ScopedResource, or the result of cls(response) - :rtype: ~$(python-base-namespace).v2019_10_17.models.ScopedResource + :return: An instance of AsyncLROPoller that returns either ScopedResource or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~$(python-base-namespace).v2019_10_17.models.ScopedResource] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -239,7 +242,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" @@ -260,7 +265,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -280,7 +284,7 @@ async def begin_delete( scope_name: str, name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -295,8 +299,8 @@ async def begin_delete( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :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: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -354,11 +358,18 @@ def list_by_private_link_scope( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResourceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore @@ -372,15 +383,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_scopes_operations_async.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_scopes_operations_async.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py index 7a29cfc8f2762..1ff852ac71bc9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations_async/_private_link_scopes_operations_async.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py @@ -9,7 +9,7 @@ import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod @@ -55,11 +55,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScopeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -71,15 +78,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -121,11 +124,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScopeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -138,15 +148,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request async def extract_data(pipeline_response): @@ -180,7 +186,9 @@ async def _delete_initial( **kwargs ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" @@ -200,7 +208,6 @@ async def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -219,7 +226,7 @@ async def begin_delete( resource_group_name: str, scope_name: str, **kwargs - ) -> None: + ) -> AsyncLROPoller[None]: """Deletes a Azure Monitor PrivateLinkScope. :param resource_group_name: The name of the resource group. @@ -232,8 +239,8 @@ async def begin_delete( polling object for personal polling strategy :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. - :return: None, or the result of cls(response) - :rtype: None + :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: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -290,9 +297,12 @@ async def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -309,9 +319,8 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -351,10 +360,13 @@ async def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -372,14 +384,12 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(azure_monitor_private_link_scope_payload, 'AzureMonitorPrivateLinkScope') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -387,7 +397,6 @@ async def create_or_update( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureMonitorPrivateLinkScope', pipeline_response) @@ -423,10 +432,13 @@ async def update_tags( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update_tags.metadata['url'] # type: ignore @@ -444,14 +456,12 @@ async def update_tags( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(private_link_scope_tags, 'TagsResource') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py index df618206c2b19..795d9364097f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_endpoint_connections_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -116,12 +118,15 @@ def _create_or_update_initial( parameters, # type: "models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> "models.PrivateEndpointConnection" - cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnection"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.PrivateEndpointConnection"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -140,14 +145,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -173,7 +176,7 @@ def begin_create_or_update( parameters, # type: "models.PrivateEndpointConnection" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.PrivateEndpointConnection"] """Approve or reject a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -244,7 +247,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" @@ -265,7 +270,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -286,7 +290,7 @@ def begin_delete( private_endpoint_connection_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -361,11 +365,18 @@ def list_by_private_link_scope( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateEndpointConnectionListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore @@ -379,15 +390,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py index c1dbec515c6c3..25bd633a17fd2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_resources_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -64,11 +64,18 @@ def list_by_private_link_scope( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResourceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore @@ -82,15 +89,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -139,9 +142,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.PrivateLinkResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -159,9 +165,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py index e514981b159e3..3f289ceffea14 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scope_operation_status_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -64,9 +64,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -83,9 +86,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py index 140d8c183ef8d..6c192514ac5aa 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scoped_resources_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -69,9 +69,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -89,9 +92,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -116,12 +118,15 @@ def _create_or_update_initial( parameters, # type: "models.ScopedResource" **kwargs # type: Any ): - # type: (...) -> "models.ScopedResource" - cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResource"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + # type: (...) -> Optional["models.ScopedResource"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.ScopedResource"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore @@ -140,14 +145,12 @@ def _create_or_update_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(parameters, 'ScopedResource') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -176,7 +179,7 @@ def begin_create_or_update( parameters, # type: "models.ScopedResource" **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller["models.ScopedResource"] """Approve or reject a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -247,7 +250,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" @@ -268,7 +273,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -289,7 +293,7 @@ def begin_delete( name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a private endpoint connection with a given name. :param resource_group_name: The name of the resource group. @@ -364,11 +368,18 @@ def list_by_private_link_scope( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.ScopedResourceListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore @@ -382,15 +393,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py index c444be7cab8e7..8e10edb8e9ed0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/operations/_private_link_scopes_operations.py @@ -8,7 +8,7 @@ from typing import TYPE_CHECKING import warnings -from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse @@ -60,11 +60,18 @@ def list( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScopeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list.metadata['url'] # type: ignore @@ -76,15 +83,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -127,11 +130,18 @@ def list_by_resource_group( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScopeListResult"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore @@ -144,15 +154,11 @@ def prepare_request(next_link=None): query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + request = self._client.get(url, query_parameters, header_parameters) else: url = next_link query_parameters = {} # type: Dict[str, Any] - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) return request def extract_data(pipeline_response): @@ -187,7 +193,9 @@ def _delete_initial( ): # type: (...) -> None cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" @@ -207,7 +215,6 @@ def _delete_initial( # Construct headers header_parameters = {} # type: Dict[str, Any] - # Construct and send request request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -227,7 +234,7 @@ def begin_delete( scope_name, # type: str **kwargs # type: Any ): - # type: (...) -> LROPoller + # type: (...) -> LROPoller[None] """Deletes a Azure Monitor PrivateLinkScope. :param resource_group_name: The name of the resource group. @@ -299,9 +306,12 @@ def get( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" + accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore @@ -318,9 +328,8 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -361,10 +370,13 @@ def create_or_update( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.create_or_update.metadata['url'] # type: ignore @@ -382,14 +394,12 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(azure_monitor_private_link_scope_payload, 'AzureMonitorPrivateLinkScope') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response @@ -397,7 +407,6 @@ def create_or_update( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = None if response.status_code == 200: deserialized = self._deserialize('AzureMonitorPrivateLinkScope', pipeline_response) @@ -434,10 +443,13 @@ def update_tags( :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["models.AzureMonitorPrivateLinkScope"] - error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } error_map.update(kwargs.pop('error_map', {})) api_version = "2019-10-17-preview" content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" # Construct URL url = self.update_tags.metadata['url'] # type: ignore @@ -455,14 +467,12 @@ def update_tags( # Construct headers header_parameters = {} # type: Dict[str, Any] header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = 'application/json' + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - # Construct and send request body_content_kwargs = {} # type: Dict[str, Any] body_content = self._serialize.body(private_link_scope_tags, 'TagsResource') body_content_kwargs['content'] = body_content request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/__init__.py new file mode 100644 index 0000000000000..fa63968b37592 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/__init__.py @@ -0,0 +1,16 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_configuration.py new file mode 100644 index 0000000000000..7eb739ad65a6b --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_configuration.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 typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + """ + + def __init__( + self, + credential, # type: "TokenCredential" + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + super(MonitorClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.api_version = "2020-01-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_metadata.json new file mode 100644 index 0000000000000..b801d74bf6ca4 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_metadata.json @@ -0,0 +1,48 @@ +{ + "chosen_version": "2020-01-01-preview", + "total_api_version_list": ["2020-01-01-preview"], + "client": { + "name": "MonitorClient", + "filename": "_monitor_client", + "description": "Monitor Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false + }, + "global_parameters": { + "sync_method": { + "credential": { + "method_signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + } + }, + "async_method": { + "credential": { + "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + } + }, + "constant": { + }, + "call": "credential" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "management_group_diagnostic_settings": "ManagementGroupDiagnosticSettingsOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py new file mode 100644 index 0000000000000..91f0fd5aed89b --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 typing import TYPE_CHECKING + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + +from ._configuration import MonitorClientConfiguration +from .operations import ManagementGroupDiagnosticSettingsOperations +from . import models + + +class MonitorClient(object): + """Monitor Management Client. + + :ivar management_group_diagnostic_settings: ManagementGroupDiagnosticSettingsOperations operations + :vartype management_group_diagnostic_settings: $(python-base-namespace).v2020_01_01_preview.operations.ManagementGroupDiagnosticSettingsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = MonitorClientConfiguration(credential, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.management_group_diagnostic_settings = ManagementGroupDiagnosticSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> MonitorClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/__init__.py new file mode 100644 index 0000000000000..7096a59fbc1f0 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_configuration.py new file mode 100644 index 0000000000000..9fc93fa75bffc --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_configuration.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + super(MonitorClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.api_version = "2020-01-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-eventhub/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py new file mode 100644 index 0000000000000..1d880d8d1aeea --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py @@ -0,0 +1,60 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 typing import Any, Optional, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import MonitorClientConfiguration +from .operations import ManagementGroupDiagnosticSettingsOperations +from .. import models + + +class MonitorClient(object): + """Monitor Management Client. + + :ivar management_group_diagnostic_settings: ManagementGroupDiagnosticSettingsOperations operations + :vartype management_group_diagnostic_settings: $(python-base-namespace).v2020_01_01_preview.aio.operations.ManagementGroupDiagnosticSettingsOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = MonitorClientConfiguration(credential, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.management_group_diagnostic_settings = ManagementGroupDiagnosticSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "MonitorClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/__init__.py new file mode 100644 index 0000000000000..c619e75688002 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 ._management_group_diagnostic_settings_operations import ManagementGroupDiagnosticSettingsOperations + +__all__ = [ + 'ManagementGroupDiagnosticSettingsOperations', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/_management_group_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/_management_group_diagnostic_settings_operations.py new file mode 100644 index 0000000000000..cb67e01cbfc83 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/operations/_management_group_diagnostic_settings_operations.py @@ -0,0 +1,291 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ManagementGroupDiagnosticSettingsOperations: + """ManagementGroupDiagnosticSettingsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2020_01_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + management_group_id: str, + name: str, + **kwargs + ) -> "models.ManagementGroupDiagnosticSettingsResource": + """Gets the active management group diagnostic settings for the specified resource. + + :param management_group_id: The management group id. + :type management_group_id: str + :param name: The name of the diagnostic setting. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementGroupDiagnosticSettingsResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/microsoft.management/managementGroups/{managementGroupId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + async def create_or_update( + self, + management_group_id: str, + name: str, + parameters: "models.ManagementGroupDiagnosticSettingsResource", + **kwargs + ) -> "models.ManagementGroupDiagnosticSettingsResource": + """Creates or updates management group diagnostic settings for the specified resource. + + :param management_group_id: The management group id. + :type management_group_id: str + :param name: The name of the diagnostic setting. + :type name: str + :param parameters: Parameters supplied to the operation. + :type parameters: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementGroupDiagnosticSettingsResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ManagementGroupDiagnosticSettingsResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/providers/microsoft.management/managementGroups/{managementGroupId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + async def delete( + self, + management_group_id: str, + name: str, + **kwargs + ) -> None: + """Deletes existing management group diagnostic settings for the specified resource. + + :param management_group_id: The management group id. + :type management_group_id: str + :param name: The name of the diagnostic setting. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/providers/microsoft.management/managementGroups/{managementGroupId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + def list( + self, + management_group_id: str, + **kwargs + ) -> AsyncIterable["models.ManagementGroupDiagnosticSettingsResourceCollection"]: + """Gets the active management group diagnostic settings list for the specified management group. + + :param management_group_id: The management group id. + :type management_group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagementGroupDiagnosticSettingsResourceCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/microsoft.management/managementGroups/{managementGroupId}/providers/microsoft.insights/diagnosticSettings'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/__init__.py new file mode 100644 index 0000000000000..b5d8c1b8e24dc --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/__init__.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ErrorResponse + from ._models_py3 import ManagementGroupDiagnosticSettingsResource + from ._models_py3 import ManagementGroupDiagnosticSettingsResourceCollection + from ._models_py3 import ManagementGroupLogSettings + from ._models_py3 import ManagementGroupProxyOnlyResource +except (SyntaxError, ImportError): + from ._models import ErrorResponse # type: ignore + from ._models import ManagementGroupDiagnosticSettingsResource # type: ignore + from ._models import ManagementGroupDiagnosticSettingsResourceCollection # type: ignore + from ._models import ManagementGroupLogSettings # type: ignore + from ._models import ManagementGroupProxyOnlyResource # type: ignore + +__all__ = [ + 'ErrorResponse', + 'ManagementGroupDiagnosticSettingsResource', + 'ManagementGroupDiagnosticSettingsResourceCollection', + 'ManagementGroupLogSettings', + 'ManagementGroupProxyOnlyResource', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models.py new file mode 100644 index 0000000000000..f0ecc19cab410 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models.py @@ -0,0 +1,189 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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.core.exceptions import HttpResponseError +import msrest.serialization + + +class ErrorResponse(msrest.serialization.Model): + """Describes the format of Error response. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ManagementGroupProxyOnlyResource(msrest.serialization.Model): + """A proxy only azure resource object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Location of the resource. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementGroupProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + + +class ManagementGroupDiagnosticSettingsResource(ManagementGroupProxyOnlyResource): + """The management group diagnostic setting resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Location of the resource. + :type location: str + :param storage_account_id: The resource ID of the storage account to which you would like to + send Diagnostic Logs. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule Id of the diagnostic setting. This is here to + maintain backwards compatibility. + :type service_bus_rule_id: str + :param event_hub_authorization_rule_id: The resource Id for the event hub authorization rule. + :type event_hub_authorization_rule_id: str + :param event_hub_name: The name of the event hub. If none is specified, the default event hub + will be selected. + :type event_hub_name: str + :param logs: The list of logs settings. + :type logs: list[~$(python-base- + namespace).v2020_01_01_preview.models.ManagementGroupLogSettings] + :param workspace_id: The full ARM resource ID of the Log Analytics workspace to which you would + like to send Diagnostic Logs. Example: + /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights- + integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. + :type workspace_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'event_hub_authorization_rule_id': {'key': 'properties.eventHubAuthorizationRuleId', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'logs': {'key': 'properties.logs', 'type': '[ManagementGroupLogSettings]'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementGroupDiagnosticSettingsResource, self).__init__(**kwargs) + self.storage_account_id = kwargs.get('storage_account_id', None) + self.service_bus_rule_id = kwargs.get('service_bus_rule_id', None) + self.event_hub_authorization_rule_id = kwargs.get('event_hub_authorization_rule_id', None) + self.event_hub_name = kwargs.get('event_hub_name', None) + self.logs = kwargs.get('logs', None) + self.workspace_id = kwargs.get('workspace_id', None) + + +class ManagementGroupDiagnosticSettingsResourceCollection(msrest.serialization.Model): + """Represents a collection of management group diagnostic settings resources. + + :param value: The collection of management group diagnostic settings resources. + :type value: list[~$(python-base- + namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagementGroupDiagnosticSettingsResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementGroupDiagnosticSettingsResourceCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ManagementGroupLogSettings(msrest.serialization.Model): + """Part of Management Group diagnostic setting. Specifies the settings for a particular log. + + All required parameters must be populated in order to send to Azure. + + :param category: Required. Name of a Management Group Diagnostic Log category for a resource + type this setting is applied to. + :type category: str + :param enabled: Required. a value indicating whether this log is enabled. + :type enabled: bool + """ + + _validation = { + 'category': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagementGroupLogSettings, self).__init__(**kwargs) + self.category = kwargs['category'] + self.enabled = kwargs['enabled'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models_py3.py new file mode 100644 index 0000000000000..47525123592b7 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models_py3.py @@ -0,0 +1,209 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 typing import List, Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class ErrorResponse(msrest.serialization.Model): + """Describes the format of Error response. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ManagementGroupProxyOnlyResource(msrest.serialization.Model): + """A proxy only azure resource object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Location of the resource. + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + **kwargs + ): + super(ManagementGroupProxyOnlyResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + + +class ManagementGroupDiagnosticSettingsResource(ManagementGroupProxyOnlyResource): + """The management group diagnostic setting resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Location of the resource. + :type location: str + :param storage_account_id: The resource ID of the storage account to which you would like to + send Diagnostic Logs. + :type storage_account_id: str + :param service_bus_rule_id: The service bus rule Id of the diagnostic setting. This is here to + maintain backwards compatibility. + :type service_bus_rule_id: str + :param event_hub_authorization_rule_id: The resource Id for the event hub authorization rule. + :type event_hub_authorization_rule_id: str + :param event_hub_name: The name of the event hub. If none is specified, the default event hub + will be selected. + :type event_hub_name: str + :param logs: The list of logs settings. + :type logs: list[~$(python-base- + namespace).v2020_01_01_preview.models.ManagementGroupLogSettings] + :param workspace_id: The full ARM resource ID of the Log Analytics workspace to which you would + like to send Diagnostic Logs. Example: + /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights- + integration/providers/Microsoft.OperationalInsights/workspaces/viruela2. + :type workspace_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'}, + 'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'}, + 'event_hub_authorization_rule_id': {'key': 'properties.eventHubAuthorizationRuleId', 'type': 'str'}, + 'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'}, + 'logs': {'key': 'properties.logs', 'type': '[ManagementGroupLogSettings]'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + storage_account_id: Optional[str] = None, + service_bus_rule_id: Optional[str] = None, + event_hub_authorization_rule_id: Optional[str] = None, + event_hub_name: Optional[str] = None, + logs: Optional[List["ManagementGroupLogSettings"]] = None, + workspace_id: Optional[str] = None, + **kwargs + ): + super(ManagementGroupDiagnosticSettingsResource, self).__init__(location=location, **kwargs) + self.storage_account_id = storage_account_id + self.service_bus_rule_id = service_bus_rule_id + self.event_hub_authorization_rule_id = event_hub_authorization_rule_id + self.event_hub_name = event_hub_name + self.logs = logs + self.workspace_id = workspace_id + + +class ManagementGroupDiagnosticSettingsResourceCollection(msrest.serialization.Model): + """Represents a collection of management group diagnostic settings resources. + + :param value: The collection of management group diagnostic settings resources. + :type value: list[~$(python-base- + namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ManagementGroupDiagnosticSettingsResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["ManagementGroupDiagnosticSettingsResource"]] = None, + **kwargs + ): + super(ManagementGroupDiagnosticSettingsResourceCollection, self).__init__(**kwargs) + self.value = value + + +class ManagementGroupLogSettings(msrest.serialization.Model): + """Part of Management Group diagnostic setting. Specifies the settings for a particular log. + + All required parameters must be populated in order to send to Azure. + + :param category: Required. Name of a Management Group Diagnostic Log category for a resource + type this setting is applied to. + :type category: str + :param enabled: Required. a value indicating whether this log is enabled. + :type enabled: bool + """ + + _validation = { + 'category': {'required': True}, + 'enabled': {'required': True}, + } + + _attribute_map = { + 'category': {'key': 'category', 'type': 'str'}, + 'enabled': {'key': 'enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + category: str, + enabled: bool, + **kwargs + ): + super(ManagementGroupLogSettings, self).__init__(**kwargs) + self.category = category + self.enabled = enabled diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/__init__.py new file mode 100644 index 0000000000000..c619e75688002 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 ._management_group_diagnostic_settings_operations import ManagementGroupDiagnosticSettingsOperations + +__all__ = [ + 'ManagementGroupDiagnosticSettingsOperations', +] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/_management_group_diagnostic_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/_management_group_diagnostic_settings_operations.py new file mode 100644 index 0000000000000..b1054afd8e9c1 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/_management_group_diagnostic_settings_operations.py @@ -0,0 +1,299 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ManagementGroupDiagnosticSettingsOperations(object): + """ManagementGroupDiagnosticSettingsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~$(python-base-namespace).v2020_01_01_preview.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + management_group_id, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.ManagementGroupDiagnosticSettingsResource" + """Gets the active management group diagnostic settings for the specified resource. + + :param management_group_id: The management group id. + :type management_group_id: str + :param name: The name of the diagnostic setting. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementGroupDiagnosticSettingsResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/providers/microsoft.management/managementGroups/{managementGroupId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + def create_or_update( + self, + management_group_id, # type: str + name, # type: str + parameters, # type: "models.ManagementGroupDiagnosticSettingsResource" + **kwargs # type: Any + ): + # type: (...) -> "models.ManagementGroupDiagnosticSettingsResource" + """Creates or updates management group diagnostic settings for the specified resource. + + :param management_group_id: The management group id. + :type management_group_id: str + :param name: The name of the diagnostic setting. + :type name: str + :param parameters: Parameters supplied to the operation. + :type parameters: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagementGroupDiagnosticSettingsResource, or the result of cls(response) + :rtype: ~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ManagementGroupDiagnosticSettingsResource') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/providers/microsoft.management/managementGroups/{managementGroupId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + def delete( + self, + management_group_id, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes existing management group diagnostic settings for the specified resource. + + :param management_group_id: The management group id. + :type management_group_id: str + :param name: The name of the diagnostic setting. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str', skip_quote=True), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/providers/microsoft.management/managementGroups/{managementGroupId}/providers/microsoft.insights/diagnosticSettings/{name}'} # type: ignore + + def list( + self, + management_group_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.ManagementGroupDiagnosticSettingsResourceCollection"] + """Gets the active management group diagnostic settings list for the specified management group. + + :param management_group_id: The management group id. + :type management_group_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagementGroupDiagnosticSettingsResourceCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2020_01_01_preview.models.ManagementGroupDiagnosticSettingsResourceCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.ManagementGroupDiagnosticSettingsResourceCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-01-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'managementGroupId': self._serialize.url("management_group_id", management_group_id, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ManagementGroupDiagnosticSettingsResourceCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/microsoft.management/managementGroups/{managementGroupId}/providers/microsoft.insights/diagnosticSettings'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/py.typed b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/py.typed new file mode 100644 index 0000000000000..e5aff4f83af86 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_action_groups.yaml b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_action_groups.yaml index c1c83fd183168..eb2849fa15dd7 100644 --- a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_action_groups.yaml +++ b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_action_groups.yaml @@ -16,7 +16,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/actionGroups/actiongroup534a109d?api-version=2019-06-01 response: @@ -28,11 +28,11 @@ interactions: cache-control: - no-cache content-length: - - '805' + - '832' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:03 GMT + - Wed, 16 Sep 2020 03:19:07 GMT expires: - '-1' pragma: @@ -58,7 +58,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/actionGroups/actiongroup534a109d?api-version=2019-06-01 response: @@ -70,11 +70,11 @@ interactions: cache-control: - no-cache content-length: - - '805' + - '832' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:03 GMT + - Wed, 16 Sep 2020 03:19:08 GMT expires: - '-1' pragma: @@ -96,7 +96,7 @@ interactions: body: '{"receiverName": "John Doe''s mobile"}' headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -106,7 +106,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/actionGroups/actiongroup534a109d/subscribe?api-version=2019-06-01 response: @@ -120,7 +120,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:05 GMT + - Wed, 16 Sep 2020 03:19:08 GMT expires: - '-1' pragma: @@ -151,7 +151,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/actionGroups/actiongroup534a109d?api-version=2019-06-01 response: @@ -163,11 +163,11 @@ interactions: cache-control: - no-cache content-length: - - '834' + - '861' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:07 GMT + - Wed, 16 Sep 2020 03:19:10 GMT expires: - '-1' pragma: @@ -191,7 +191,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -199,7 +199,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/actionGroups/actiongroup534a109d?api-version=2019-06-01 response: @@ -211,7 +211,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 16:35:09 GMT + - Wed, 16 Sep 2020 03:19:14 GMT expires: - '-1' pragma: diff --git a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_activity_log_alerts.yaml b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_activity_log_alerts.yaml index 53a7380e54e74..a3a9b0544a8cf 100644 --- a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_activity_log_alerts.yaml +++ b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_activity_log_alerts.yaml @@ -16,7 +16,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/activityLogAlerts/activitylogalertxbfb21318?api-version=2017-04-01 response: @@ -27,11 +27,11 @@ interactions: cache-control: - no-cache content-length: - - '718' + - '739' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:25 GMT + - Wed, 16 Sep 2020 03:19:35 GMT expires: - '-1' pragma: @@ -43,7 +43,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1195' status: code: 201 message: Created @@ -57,7 +57,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/activityLogAlerts/activitylogalertxbfb21318?api-version=2017-04-01 response: @@ -68,11 +68,11 @@ interactions: cache-control: - no-cache content-length: - - '718' + - '739' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:25 GMT + - Wed, 16 Sep 2020 03:19:35 GMT expires: - '-1' pragma: @@ -105,7 +105,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/activityLogAlerts/activitylogalertxbfb21318?api-version=2017-04-01 response: @@ -116,11 +116,11 @@ interactions: cache-control: - no-cache content-length: - - '750' + - '771' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:27 GMT + - Wed, 16 Sep 2020 03:19:38 GMT expires: - '-1' pragma: @@ -136,7 +136,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1194' status: code: 200 message: OK @@ -144,7 +144,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -152,7 +152,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/activityLogAlerts/activitylogalertxbfb21318?api-version=2017-04-01 response: @@ -164,7 +164,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 16:35:29 GMT + - Wed, 16 Sep 2020 03:19:41 GMT expires: - '-1' pragma: diff --git a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_autoscale_settings.yaml b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_autoscale_settings.yaml index d9ed1fd6b273d..7f2a473663bc8 100644 --- a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_autoscale_settings.yaml +++ b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_autoscale_settings.yaml @@ -15,18 +15,18 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"networkxx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx\"\ - ,\r\n \"etag\": \"W/\\\"b277f328-a928-488d-a8b4-8e9bbbd78577\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"b95b2875-fd69-487f-8ae1-cc565481af3a\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"0c3cb874-cd09-44e4-be3a-cb6dbf2331c6\",\r\n \"\ + \ \"resourceGuid\": \"03570805-0b36-439f-9a10-d3187585b688\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +35,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5226cb68-86f5-4348-b819-6f36711a436a?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/b1cda953-6d71-4011-8b7e-a1996cb0f5c6?api-version=2019-09-01 cache-control: - no-cache content-length: - - '683' + - '705' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:46 GMT + - Wed, 16 Sep 2020 03:20:03 GMT expires: - '-1' pragma: @@ -56,9 +56,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 6eef7f94-13a1-41cf-b23f-98fdf883713e + - d282c572-d6c7-4aa3-8daa-163e2865d6f7 x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' status: code: 201 message: Created @@ -73,9 +73,9 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/5226cb68-86f5-4348-b819-6f36711a436a?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/b1cda953-6d71-4011-8b7e-a1996cb0f5c6?api-version=2019-09-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -87,7 +87,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:49 GMT + - Wed, 16 Sep 2020 03:20:07 GMT expires: - '-1' pragma: @@ -104,7 +104,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 9e5177dc-1e8e-47de-95cd-020fb4e80d92 + - f17c41bb-f8e9-4332-954a-5cc250fa74f1 status: code: 200 message: OK @@ -119,16 +119,16 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"networkxx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx\"\ - ,\r\n \"etag\": \"W/\\\"ea500581-d9ae-482d-bc43-ed5447125575\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"7c86ceac-0e97-44cb-99ef-2f55a2348d9d\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"0c3cb874-cd09-44e4-be3a-cb6dbf2331c6\",\r\n \"\ + \ \"resourceGuid\": \"03570805-0b36-439f-9a10-d3187585b688\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -137,13 +137,13 @@ interactions: cache-control: - no-cache content-length: - - '684' + - '706' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:50 GMT + - Wed, 16 Sep 2020 03:20:08 GMT etag: - - W/"ea500581-d9ae-482d-bc43-ed5447125575" + - W/"7c86ceac-0e97-44cb-99ef-2f55a2348d9d" expires: - '-1' pragma: @@ -160,7 +160,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 621b3300-3ff8-446d-9d30-2b6ca1842259 + - 7789143e-2c4b-459f-ab25-e81f6bdf872e status: code: 200 message: OK @@ -179,30 +179,30 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"subnetx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx\"\ - ,\r\n \"etag\": \"W/\\\"a5321d9d-65e7-47d1-9bf2-09c10918ded7\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"5979efd2-9ecd-4039-a69b-1045cb56b4b6\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/27214114-2fa5-4bc3-a2ee-760d843d152d?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/764fb77f-a60d-4e99-be29-e4b8dea236ae?api-version=2019-09-01 cache-control: - no-cache content-length: - - '567' + - '589' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:51 GMT + - Wed, 16 Sep 2020 03:20:10 GMT expires: - '-1' pragma: @@ -215,9 +215,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d760ad7c-062e-47f8-8a22-b8dc1b051415 + - 54d84dfc-a271-4480-b7c6-9f32730948b2 x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1196' status: code: 201 message: Created @@ -232,9 +232,9 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/27214114-2fa5-4bc3-a2ee-760d843d152d?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/764fb77f-a60d-4e99-be29-e4b8dea236ae?api-version=2019-09-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -246,7 +246,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:54 GMT + - Wed, 16 Sep 2020 03:20:14 GMT expires: - '-1' pragma: @@ -263,7 +263,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d34824a5-62bd-44ad-9c22-38f83d872e70 + - 694b569f-34be-44c9-8a52-6a8060e5749e status: code: 200 message: OK @@ -278,13 +278,13 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"subnetx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx\"\ - ,\r\n \"etag\": \"W/\\\"8dc032e6-2896-49d7-9e6d-f86122fa811e\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"e14d74a4-27b0-4949-acca-8d2adec459b8\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -293,13 +293,13 @@ interactions: cache-control: - no-cache content-length: - - '568' + - '590' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:54 GMT + - Wed, 16 Sep 2020 03:20:14 GMT etag: - - W/"8dc032e6-2896-49d7-9e6d-f86122fa811e" + - W/"e14d74a4-27b0-4949-acca-8d2adec459b8" expires: - '-1' pragma: @@ -316,14 +316,14 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 564d8f2f-8b46-4f8b-a280-50cde28a0649 + - 5a2d64e6-013e-4ccf-a721-61daef403ff4 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"ipConfigurations": [{"properties": + body: 'b''b\''{"location": "eastus", "properties": {"ipConfigurations": [{"properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx"}}, - "name": "MyIpConfig"}]}}''' + "name": "MyIpConfig"}]}}\''''' headers: Accept: - application/json @@ -332,25 +332,25 @@ interactions: Connection: - keep-alive Content-Length: - - '312' + - '334' Content-Type: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"interfacexx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx\"\ - ,\r\n \"etag\": \"W/\\\"04a90b19-b5fe-4a29-b050-48724583beae\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"25731bbc-2483-4462-8697-47499c73e239\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"16b28d7f-2841-4a01-8a5c-2b33e8a3530e\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"83220cc4-7a23-4796-bf7c-375454b55a53\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"04a90b19-b5fe-4a29-b050-48724583beae\\\"\"\ + ,\r\n \"etag\": \"W/\\\"25731bbc-2483-4462-8697-47499c73e239\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -358,24 +358,23 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"os2dydajzxsejpr0znw14izryg.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"auefoazwbopuhgqq0mmhlbnwra.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ - : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\ - \n \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\ - \r\n}" + : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": []\r\ + \n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/f643bf24-833f-4627-ac2f-634db648a233?api-version=2020-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/117bec7c-2f58-4a6c-94cf-4470317e9557?api-version=2019-09-01 cache-control: - no-cache content-length: - - '1757' + - '1795' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:35:57 GMT + - Wed, 16 Sep 2020 03:20:19 GMT expires: - '-1' pragma: @@ -388,9 +387,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - a5d34a43-2b89-40cc-9243-5457843e8212 + - 93704773-ea03-4d5c-9e1a-effd58948fb6 x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1195' status: code: 201 message: Created @@ -405,9 +404,9 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/f643bf24-833f-4627-ac2f-634db648a233?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/117bec7c-2f58-4a6c-94cf-4470317e9557?api-version=2019-09-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -419,7 +418,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:36:32 GMT + - Wed, 16 Sep 2020 03:20:51 GMT expires: - '-1' pragma: @@ -436,7 +435,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - edbeafff-edd2-40c4-af1d-086b99ea9a37 + - acf3a505-a62b-4782-982e-f0f818ebd230 status: code: 200 message: OK @@ -451,18 +450,18 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-network/10.2.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx?api-version=2020-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx?api-version=2019-09-01 response: body: string: "{\r\n \"name\": \"interfacexx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx\"\ - ,\r\n \"etag\": \"W/\\\"04a90b19-b5fe-4a29-b050-48724583beae\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"25731bbc-2483-4462-8697-47499c73e239\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"16b28d7f-2841-4a01-8a5c-2b33e8a3530e\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"83220cc4-7a23-4796-bf7c-375454b55a53\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"04a90b19-b5fe-4a29-b050-48724583beae\\\"\"\ + ,\r\n \"etag\": \"W/\\\"25731bbc-2483-4462-8697-47499c73e239\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -470,22 +469,21 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"os2dydajzxsejpr0znw14izryg.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"auefoazwbopuhgqq0mmhlbnwra.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ - : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\ - \n \"nicType\": \"Standard\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\ - \r\n}" + : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": []\r\ + \n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" headers: cache-control: - no-cache content-length: - - '1757' + - '1795' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:36:32 GMT + - Wed, 16 Sep 2020 03:20:52 GMT etag: - - W/"04a90b19-b5fe-4a29-b050-48724583beae" + - W/"25731bbc-2483-4462-8697-47499c73e239" expires: - '-1' pragma: @@ -502,22 +500,22 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 1c7f2297-5dd2-4648-870e-68d2ac170f9f + - b12ac33c-d63a-4346-be5d-a912500c4955 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": "Standard", - "capacity": 2}, "properties": {"upgradePolicy": {"mode": "Manual"}, "virtualMachineProfile": - {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": "testuser", - "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": {"publisher": - "Canonical", "offer": "UbuntuServer", "sku": "18.04-LTS", "version": "latest"}, - "osDisk": {"caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": + body: 'b''b\''{"location": "eastus", "sku": {"name": "Standard_D1_v2", "tier": + "Standard", "capacity": 2}, "properties": {"upgradePolicy": {"mode": "Manual"}, + "virtualMachineProfile": {"osProfile": {"computerNamePrefix": "testPC", "adminUsername": + "testuser", "adminPassword": "Aa!1()-xyz"}, "storageProfile": {"imageReference": + {"publisher": "Canonical", "offer": "UbuntuServer", "sku": "18.04-LTS", "version": + "latest"}, "osDisk": {"caching": "ReadWrite", "createOption": "FromImage", "diskSizeGB": 512, "managedDisk": {"storageAccountType": "Standard_LRS"}}}, "networkProfile": {"networkInterfaceConfigurations": [{"name": "testPC", "properties": {"primary": true, "ipConfigurations": [{"name": "testPC", "properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx"}}}]}}]}}, - "overprovision": true}}''' + "overprovision": true}}\''''' headers: Accept: - application/json @@ -526,16 +524,16 @@ interactions: Connection: - keep-alive Content-Length: - - '952' + - '974' Content-Type: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-compute/12.0.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-compute/10.0.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name?api-version=2019-07-01 response: body: string: "{\r\n \"name\": \"vmss_name\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name\"\ @@ -563,21 +561,21 @@ interactions: :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx\"\ },\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n },\r\n \"provisioningState\"\ : \"Creating\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ - : false,\r\n \"uniqueId\": \"6be9a6d3-046a-4226-9d32-e37754b0de5b\"\r\n\ + : false,\r\n \"uniqueId\": \"d5ca337d-36f7-4ccc-bbf1-f78d0d9798df\"\r\n\ \ }\r\n}" headers: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f5fc63b3-37f3-42a1-b6ef-d8d7998973e9?api-version=2019-12-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/64b72848-6b3c-4092-a655-b016e5b079db?api-version=2019-07-01 cache-control: - no-cache content-length: - - '2025' + - '2069' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:36:39 GMT + - Wed, 16 Sep 2020 03:21:01 GMT expires: - '-1' pragma: @@ -590,7 +588,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/CreateVMScaleSet3Min;143,Microsoft.Compute/CreateVMScaleSet30Min;719,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;2877,Microsoft.Compute/VmssQueuedVMOperations;4796 + - Microsoft.Compute/CreateVMScaleSet3Min;59,Microsoft.Compute/CreateVMScaleSet30Min;299,Microsoft.Compute/VMScaleSetBatchedVMRequests5Min;1196,Microsoft.Compute/VmssQueuedVMOperations;4796 x-ms-ratelimit-remaining-subscription-writes: - '1199' x-ms-request-charge: @@ -609,13 +607,13 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-compute/12.0.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-compute/10.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f5fc63b3-37f3-42a1-b6ef-d8d7998973e9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/64b72848-6b3c-4092-a655-b016e5b079db?api-version=2019-07-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T16:36:38.9481385+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f5fc63b3-37f3-42a1-b6ef-d8d7998973e9\"\ + string: "{\r\n \"startTime\": \"2020-09-16T03:20:59.8077948+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"64b72848-6b3c-4092-a655-b016e5b079db\"\ \r\n}" headers: cache-control: @@ -625,7 +623,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:36:50 GMT + - Wed, 16 Sep 2020 03:21:13 GMT expires: - '-1' pragma: @@ -642,7 +640,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14983,Microsoft.Compute/GetOperation30Min;29983 + - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29999 status: code: 200 message: OK @@ -657,62 +655,14 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-compute/12.0.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-compute/10.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f5fc63b3-37f3-42a1-b6ef-d8d7998973e9?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/64b72848-6b3c-4092-a655-b016e5b079db?api-version=2019-07-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-19T16:36:38.9481385+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"f5fc63b3-37f3-42a1-b6ef-d8d7998973e9\"\ - \r\n}" - headers: - cache-control: - - no-cache - content-length: - - '134' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 19 May 2020 16:37:51 GMT - expires: - - '-1' - pragma: - - no-cache - server: - - Microsoft-HTTPAPI/2.0 - - Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14978,Microsoft.Compute/GetOperation30Min;29974 - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-compute/12.0.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/f5fc63b3-37f3-42a1-b6ef-d8d7998973e9?api-version=2019-12-01 - response: - body: - string: "{\r\n \"startTime\": \"2020-05-19T16:36:38.9481385+00:00\",\r\n \"\ - endTime\": \"2020-05-19T16:37:52.6829235+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"f5fc63b3-37f3-42a1-b6ef-d8d7998973e9\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T03:20:59.8077948+00:00\",\r\n \"\ + endTime\": \"2020-09-16T03:21:54.9175421+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"64b72848-6b3c-4092-a655-b016e5b079db\"\r\n}" headers: cache-control: - no-cache @@ -721,7 +671,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:38:21 GMT + - Wed, 16 Sep 2020 03:22:14 GMT expires: - '-1' pragma: @@ -738,7 +688,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14972,Microsoft.Compute/GetOperation30Min;29964 + - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29997 status: code: 200 message: OK @@ -753,9 +703,9 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-compute/12.0.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-compute/10.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name?api-version=2019-12-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name?api-version=2019-07-01 response: body: string: "{\r\n \"name\": \"vmss_name\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name\"\ @@ -783,17 +733,17 @@ interactions: :\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx\"\ },\"privateIPAddressVersion\":\"IPv4\"}}]}}]}\r\n },\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"overprovision\": true,\r\n \"doNotRunExtensionsOnOverprovisionedVMs\"\ - : false,\r\n \"uniqueId\": \"6be9a6d3-046a-4226-9d32-e37754b0de5b\"\r\n\ + : false,\r\n \"uniqueId\": \"d5ca337d-36f7-4ccc-bbf1-f78d0d9798df\"\r\n\ \ }\r\n}" headers: cache-control: - no-cache content-length: - - '2026' + - '2070' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:38:22 GMT + - Wed, 16 Sep 2020 03:22:15 GMT expires: - '-1' pragma: @@ -810,16 +760,16 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetVMScaleSet3Min;396,Microsoft.Compute/GetVMScaleSet30Min;2594 + - Microsoft.Compute/GetVMScaleSet3Min;396,Microsoft.Compute/GetVMScaleSet30Min;2596 status: code: 200 message: OK - request: - body: 'b''{"location": "West US", "properties": {"profiles": [{"name": "adios", + body: 'b''b\''{"location": "West US", "properties": {"profiles": [{"name": "adios", "capacity": {"minimum": "1", "maximum": "10", "default": "1"}, "rules": []}], "notifications": [{"operation": "Scale", "email": {"sendToSubscriptionAdministrator": true, "sendToSubscriptionCoAdministrators": true, "customEmails": ["gu@ms.com", - "ge@ns.net"]}, "webhooks": []}], "enabled": true, "targetResourceUri": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name"}}''' + "ge@ns.net"]}, "webhooks": []}], "enabled": true, "targetResourceUri": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name"}}\''''' headers: Accept: - application/json @@ -828,11 +778,11 @@ interactions: Connection: - keep-alive Content-Length: - - '571' + - '593' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.insights/autoscalesettings/autoscalesetting?api-version=2015-04-01 response: @@ -843,11 +793,11 @@ interactions: cache-control: - no-cache content-length: - - '840' + - '884' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:38:35 GMT + - Wed, 16 Sep 2020 03:22:26 GMT expires: - '-1' pragma: @@ -859,7 +809,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' status: code: 201 message: Created @@ -873,7 +823,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.insights/autoscalesettings/autoscalesetting?api-version=2015-04-01 response: @@ -884,11 +834,11 @@ interactions: cache-control: - no-cache content-length: - - '840' + - '884' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:38:35 GMT + - Wed, 16 Sep 2020 03:22:26 GMT expires: - '-1' pragma: @@ -907,11 +857,11 @@ interactions: code: 200 message: OK - request: - body: 'b''{"properties": {"profiles": [{"name": "adios", "capacity": {"minimum": + body: 'b''b\''{"properties": {"profiles": [{"name": "adios", "capacity": {"minimum": "1", "maximum": "10", "default": "1"}, "rules": []}], "notifications": [{"operation": "Scale", "email": {"sendToSubscriptionAdministrator": true, "sendToSubscriptionCoAdministrators": true, "customEmails": ["gu@ms.com", "ge@ns.net"]}, "webhooks": []}], "enabled": - true, "targetResourceUri": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name"}}''' + true, "targetResourceUri": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachineScaleSets/vmss_name"}}\''''' headers: Accept: - application/json @@ -920,11 +870,11 @@ interactions: Connection: - keep-alive Content-Length: - - '548' + - '570' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.insights/autoscalesettings/autoscalesetting?api-version=2015-04-01 response: @@ -935,11 +885,11 @@ interactions: cache-control: - no-cache content-length: - - '840' + - '884' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:38:37 GMT + - Wed, 16 Sep 2020 03:22:28 GMT expires: - '-1' pragma: @@ -955,7 +905,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' status: code: 200 message: OK @@ -963,7 +913,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -971,7 +921,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.insights/autoscalesettings/autoscalesetting?api-version=2015-04-01 response: @@ -983,7 +933,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 16:38:39 GMT + - Wed, 16 Sep 2020 03:22:31 GMT expires: - '-1' pragma: diff --git a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_log_profiles.yaml b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_log_profiles.yaml index f894583c02ca0..16b646ca76f62 100644 --- a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_log_profiles.yaml +++ b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_log_profiles.yaml @@ -30,11 +30,11 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Wed, 27 May 2020 03:50:24 GMT + - Wed, 16 Sep 2020 03:22:54 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/709d914c-9804-4c85-8d4e-c5a067215eaa?monitor=true&api-version=2019-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/e60f99d2-b390-401c-bb67-9a086cbef957?monitor=true&api-version=2019-04-01 pragma: - no-cache server: @@ -44,7 +44,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1198' status: code: 202 message: Accepted @@ -61,101 +61,19 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/709d914c-9804-4c85-8d4e-c5a067215eaa?monitor=true&api-version=2019-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/e60f99d2-b390-401c-bb67-9a086cbef957?monitor=true&api-version=2019-04-01 response: body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - content-type: - - text/plain; charset=utf-8 - date: - - Wed, 27 May 2020 03:50:42 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/709d914c-9804-4c85-8d4e-c5a067215eaa?monitor=true&api-version=2019-04-01 - pragma: - - no-cache - server: - - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/709d914c-9804-4c85-8d4e-c5a067215eaa?monitor=true&api-version=2019-04-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - content-type: - - text/plain; charset=utf-8 - date: - - Wed, 27 May 2020 03:50:45 GMT - expires: - - '-1' - location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/709d914c-9804-4c85-8d4e-c5a067215eaa?monitor=true&api-version=2019-04-01 - pragma: - - no-cache - server: - - Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0 - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/709d914c-9804-4c85-8d4e-c5a067215eaa?monitor=true&api-version=2019-04-01 - response: - body: - string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx430e1025","name":"storageaccountx430e1025","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-05-27T03:50:24.7550293Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-05-27T03:50:24.7550293Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-05-27T03:50:24.6613212Z","primaryEndpoints":{"blob":"https://storageaccountx430e1025.blob.core.windows.net/","queue":"https://storageaccountx430e1025.queue.core.windows.net/","table":"https://storageaccountx430e1025.table.core.windows.net/","file":"https://storageaccountx430e1025.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx430e1025","name":"storageaccountx430e1025","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-09-16T03:22:55.1085297Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-09-16T03:22:55.1085297Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-09-16T03:22:55.0147927Z","primaryEndpoints":{"blob":"https://storageaccountx430e1025.blob.core.windows.net/","queue":"https://storageaccountx430e1025.queue.core.windows.net/","table":"https://storageaccountx430e1025.table.core.windows.net/","file":"https://storageaccountx430e1025.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' headers: cache-control: - no-cache content-length: - - '1134' + - '1162' content-type: - application/json date: - - Wed, 27 May 2020 03:50:49 GMT + - Wed, 16 Sep 2020 03:23:12 GMT expires: - '-1' pragma: @@ -174,9 +92,9 @@ interactions: code: 200 message: OK - request: - body: 'b''{"location": "", "properties": {"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx430e1025", + body: 'b''b\''{"location": "", "properties": {"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx430e1025", "locations": ["global"], "categories": ["Write", "Delete", "Action"], "retentionPolicy": - {"enabled": true, "days": 3}}}''' + {"enabled": true, "days": 3}}}\''''' headers: Accept: - application/json @@ -185,11 +103,11 @@ interactions: Connection: - keep-alive Content-Length: - - '357' + - '385' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.insights/logprofiles/logprofilex430e1025?api-version=2016-03-01 response: @@ -199,11 +117,11 @@ interactions: cache-control: - no-cache content-length: - - '567' + - '595' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:50:54 GMT + - Wed, 16 Sep 2020 03:23:16 GMT expires: - '-1' pragma: @@ -219,7 +137,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 200 message: OK @@ -233,7 +151,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.insights/logprofiles/logprofilex430e1025?api-version=2016-03-01 response: @@ -243,11 +161,11 @@ interactions: cache-control: - no-cache content-length: - - '569' + - '597' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:51:26 GMT + - Wed, 16 Sep 2020 03:23:46 GMT expires: - '-1' pragma: @@ -277,7 +195,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.insights/logprofiles/logprofilex430e1025?api-version=2016-03-01 response: @@ -289,7 +207,7 @@ interactions: content-length: - '0' date: - - Wed, 27 May 2020 03:51:27 GMT + - Wed, 16 Sep 2020 03:23:47 GMT expires: - '-1' pragma: @@ -301,7 +219,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14999' status: code: 200 message: OK diff --git a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_metric_alerts.yaml b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_metric_alerts.yaml index ada8577cd6d75..cad2949acb8f1 100644 --- a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_metric_alerts.yaml +++ b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_metric_alerts.yaml @@ -23,10 +23,10 @@ interactions: response: body: string: "{\r\n \"name\": \"networkxx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx\"\ - ,\r\n \"etag\": \"W/\\\"e51c1544-1c41-41f4-8256-327bfde999b6\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"c8ff383c-3f95-4bc7-b5d9-458332db7a4f\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \ - \ \"resourceGuid\": \"06e100c2-3270-4565-92c5-9898b1bbf87f\",\r\n \"\ + \ \"resourceGuid\": \"d2c35ae1-0bfc-49b1-b026-f7148752aac7\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -35,15 +35,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/ee31e68a-1db2-452c-aa8e-9cda55e2307a?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fa6ad004-dd99-4b06-8089-c6d58d8e7fca?api-version=2019-09-01 cache-control: - no-cache content-length: - - '678' + - '705' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:09:32 GMT + - Wed, 16 Sep 2020 03:24:10 GMT expires: - '-1' pragma: @@ -56,7 +56,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 040789e7-d322-4777-8aed-8460e9ccc8b8 + - 2dcb5c94-41f9-4051-99ff-276dfa59bd36 x-ms-ratelimit-remaining-subscription-writes: - '1199' status: @@ -75,7 +75,7 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/ee31e68a-1db2-452c-aa8e-9cda55e2307a?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/fa6ad004-dd99-4b06-8089-c6d58d8e7fca?api-version=2019-09-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -87,7 +87,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:09:38 GMT + - Wed, 16 Sep 2020 03:24:16 GMT expires: - '-1' pragma: @@ -104,7 +104,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - dda408d4-601f-4cfa-97ed-6e1839017803 + - 0b1542a2-d22d-4f05-a406-3a9c7252ff9f status: code: 200 message: OK @@ -125,10 +125,10 @@ interactions: response: body: string: "{\r\n \"name\": \"networkxx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx\"\ - ,\r\n \"etag\": \"W/\\\"663d6a09-9c96-4661-81b9-db50538ca5ed\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"115625bd-a3ae-4895-a523-a66ca0d618d7\\\"\",\r\n \ \ \"type\": \"Microsoft.Network/virtualNetworks\",\r\n \"location\": \"eastus\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n\ - \ \"resourceGuid\": \"06e100c2-3270-4565-92c5-9898b1bbf87f\",\r\n \"\ + \ \"resourceGuid\": \"d2c35ae1-0bfc-49b1-b026-f7148752aac7\",\r\n \"\ addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"10.0.0.0/16\"\ \r\n ]\r\n },\r\n \"subnets\": [],\r\n \"virtualNetworkPeerings\"\ : [],\r\n \"enableDdosProtection\": false,\r\n \"enableVmProtection\"\ @@ -137,13 +137,13 @@ interactions: cache-control: - no-cache content-length: - - '679' + - '706' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:09:38 GMT + - Wed, 16 Sep 2020 03:24:16 GMT etag: - - W/"663d6a09-9c96-4661-81b9-db50538ca5ed" + - W/"115625bd-a3ae-4895-a523-a66ca0d618d7" expires: - '-1' pragma: @@ -160,7 +160,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 351683e3-3194-409f-b7ff-8cab5f6f0215 + - d843fe92-06e0-430a-850c-a48822befa5f status: code: 200 message: OK @@ -187,22 +187,22 @@ interactions: response: body: string: "{\r\n \"name\": \"subnetx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx\"\ - ,\r\n \"etag\": \"W/\\\"948010da-8504-4a6f-8835-71404b180f9a\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"b62d5877-784c-4917-9ea2-87b8cf908884\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ \n },\r\n \"type\": \"Microsoft.Network/virtualNetworks/subnets\"\r\n}" headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/4d6a7b9d-65cf-435b-b0f6-634baa584af9?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/be8c9bc9-186d-414f-af83-07c8525463f4?api-version=2019-09-01 cache-control: - no-cache content-length: - - '562' + - '589' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:09:38 GMT + - Wed, 16 Sep 2020 03:24:17 GMT expires: - '-1' pragma: @@ -215,7 +215,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 965470c8-b085-4ada-8755-932f54fe8b66 + - 2fe2422e-944a-449a-9344-e1780bd2cc95 x-ms-ratelimit-remaining-subscription-writes: - '1198' status: @@ -234,7 +234,7 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/4d6a7b9d-65cf-435b-b0f6-634baa584af9?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/be8c9bc9-186d-414f-af83-07c8525463f4?api-version=2019-09-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -246,7 +246,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:09:44 GMT + - Wed, 16 Sep 2020 03:24:22 GMT expires: - '-1' pragma: @@ -263,7 +263,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e916377e-c40b-4b40-84c4-a57d27a077cb + - e2fe370e-1a4c-43d9-b1fd-98ac76785cb4 status: code: 200 message: OK @@ -284,7 +284,7 @@ interactions: response: body: string: "{\r\n \"name\": \"subnetx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx\"\ - ,\r\n \"etag\": \"W/\\\"47f34bbb-c7b1-4411-8fa1-c41ac930e5f2\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"5d9fad09-91aa-47ee-90a6-8a0d7d475967\\\"\",\r\n \ \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"\ addressPrefix\": \"10.0.0.0/24\",\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\"\ : \"Enabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\ @@ -293,13 +293,13 @@ interactions: cache-control: - no-cache content-length: - - '563' + - '590' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:09:44 GMT + - Wed, 16 Sep 2020 03:24:23 GMT etag: - - W/"47f34bbb-c7b1-4411-8fa1-c41ac930e5f2" + - W/"5d9fad09-91aa-47ee-90a6-8a0d7d475967" expires: - '-1' pragma: @@ -316,14 +316,14 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 5d0d33da-61b6-4699-8188-7e72930a45f8 + - b699a9ef-f80c-4ed1-9004-d858698aa386 status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"ipConfigurations": [{"properties": + body: 'b''b\''{"location": "eastus", "properties": {"ipConfigurations": [{"properties": {"subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/virtualNetworks/networkxx/subnets/subnetx"}}, - "name": "MyIpConfig"}]}}''' + "name": "MyIpConfig"}]}}\''''' headers: Accept: - application/json @@ -332,7 +332,7 @@ interactions: Connection: - keep-alive Content-Length: - - '307' + - '334' Content-Type: - application/json; charset=utf-8 User-Agent: @@ -345,12 +345,12 @@ interactions: response: body: string: "{\r\n \"name\": \"interfacexx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx\"\ - ,\r\n \"etag\": \"W/\\\"7f888b1b-0bc5-48eb-ac05-c50985cafe51\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"74e4251a-1c2e-4cb4-852b-e22d6bc29b51\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"e6bc2ffc-e27d-49db-b956-ff2907e33890\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"85c192a0-55e4-4f1e-ac93-5e0f869d3042\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"7f888b1b-0bc5-48eb-ac05-c50985cafe51\\\"\"\ + ,\r\n \"etag\": \"W/\\\"74e4251a-1c2e-4cb4-852b-e22d6bc29b51\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -358,7 +358,7 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"yiaocbtqgjsulewftcmldo5yph.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"2fnmhux2boyutmbg42kiouvkyh.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": []\r\ \n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" @@ -366,15 +366,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/c252b0c9-92c7-4f4d-8800-027688462ce9?api-version=2019-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0f332d83-0e98-4662-b2bd-41f69b6b6619?api-version=2019-09-01 cache-control: - no-cache content-length: - - '1714' + - '1795' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:09:49 GMT + - Wed, 16 Sep 2020 03:24:28 GMT expires: - '-1' pragma: @@ -387,7 +387,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d7d287f6-7333-426d-b605-4d48688c8abc + - d046b277-6e12-44c5-87e7-e02b48a6bf50 x-ms-ratelimit-remaining-subscription-writes: - '1197' status: @@ -406,7 +406,7 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-network/7.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/c252b0c9-92c7-4f4d-8800-027688462ce9?api-version=2019-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus/operations/0f332d83-0e98-4662-b2bd-41f69b6b6619?api-version=2019-09-01 response: body: string: "{\r\n \"status\": \"Succeeded\"\r\n}" @@ -418,7 +418,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:10:21 GMT + - Wed, 16 Sep 2020 03:24:59 GMT expires: - '-1' pragma: @@ -435,7 +435,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d73e9c1e-4e4d-484e-8ece-da7f89eaa32c + - e30d4874-db84-4309-a098-aeea11cbecdf status: code: 200 message: OK @@ -456,12 +456,12 @@ interactions: response: body: string: "{\r\n \"name\": \"interfacexx\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx\"\ - ,\r\n \"etag\": \"W/\\\"7f888b1b-0bc5-48eb-ac05-c50985cafe51\\\"\",\r\n \ + ,\r\n \"etag\": \"W/\\\"74e4251a-1c2e-4cb4-852b-e22d6bc29b51\\\"\",\r\n \ \ \"location\": \"eastus\",\r\n \"properties\": {\r\n \"provisioningState\"\ - : \"Succeeded\",\r\n \"resourceGuid\": \"e6bc2ffc-e27d-49db-b956-ff2907e33890\"\ + : \"Succeeded\",\r\n \"resourceGuid\": \"85c192a0-55e4-4f1e-ac93-5e0f869d3042\"\ ,\r\n \"ipConfigurations\": [\r\n {\r\n \"name\": \"MyIpConfig\"\ ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx/ipConfigurations/MyIpConfig\"\ - ,\r\n \"etag\": \"W/\\\"7f888b1b-0bc5-48eb-ac05-c50985cafe51\\\"\"\ + ,\r\n \"etag\": \"W/\\\"74e4251a-1c2e-4cb4-852b-e22d6bc29b51\\\"\"\ ,\r\n \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\"\ ,\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\ ,\r\n \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\"\ @@ -469,7 +469,7 @@ interactions: \r\n },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\"\ : \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n\ \ \"dnsServers\": [],\r\n \"appliedDnsServers\": [],\r\n \"\ - internalDomainNameSuffix\": \"yiaocbtqgjsulewftcmldo5yph.bx.internal.cloudapp.net\"\ + internalDomainNameSuffix\": \"2fnmhux2boyutmbg42kiouvkyh.bx.internal.cloudapp.net\"\ \r\n },\r\n \"enableAcceleratedNetworking\": false,\r\n \"enableIPForwarding\"\ : false,\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": []\r\ \n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\"\r\n}" @@ -477,13 +477,13 @@ interactions: cache-control: - no-cache content-length: - - '1714' + - '1795' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:10:21 GMT + - Wed, 16 Sep 2020 03:25:00 GMT etag: - - W/"7f888b1b-0bc5-48eb-ac05-c50985cafe51" + - W/"74e4251a-1c2e-4cb4-852b-e22d6bc29b51" expires: - '-1' pragma: @@ -500,12 +500,12 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - ec20de50-58ba-4e99-b75b-3500c29ab00f + - add0089e-ea1a-41cd-8d7b-4cc8568e451f status: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"hardwareProfile": {"vmSize": + body: 'b''b\''{"location": "eastus", "properties": {"hardwareProfile": {"vmSize": "Standard_D2_v2"}, "storageProfile": {"imageReference": {"publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", "sku": "2016-Datacenter", "version": "latest"}, "osDisk": {"name": "myVMosdisk", "caching": "ReadWrite", "createOption": "FromImage", @@ -514,7 +514,7 @@ interactions: "Empty", "diskSizeGB": 1023}]}, "osProfile": {"computerName": "myVM", "adminUsername": "testuser", "adminPassword": "Aa1!zyx_", "windowsConfiguration": {"enableAutomaticUpdates": true}}, "networkProfile": {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Network/networkInterfaces/interfacexx", - "properties": {"primary": true}}]}}}''' + "properties": {"primary": true}}]}}}\''''' headers: Accept: - application/json @@ -523,7 +523,7 @@ interactions: Connection: - keep-alive Content-Length: - - '926' + - '953' Content-Type: - application/json; charset=utf-8 User-Agent: @@ -537,12 +537,12 @@ interactions: body: string: "{\r\n \"name\": \"vm_name\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vm_name\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"6970ba6d-543d-4448-9f7c-87378e42b9fc\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"3f145f13-f7ad-43e0-a499-37a258b865a7\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ @@ -568,15 +568,15 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9973da41-f0cb-47cd-8f69-eb05152184c3?api-version=2019-07-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/81f9ee6f-1e7f-4970-9565-33f9978ca670?api-version=2019-07-01 cache-control: - no-cache content-length: - - '2144' + - '2198' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:10:31 GMT + - Wed, 16 Sep 2020 03:25:09 GMT expires: - '-1' pragma: @@ -589,7 +589,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1198 + - Microsoft.Compute/PutVM3Min;239,Microsoft.Compute/PutVM30Min;1199 x-ms-ratelimit-remaining-subscription-writes: - '1199' status: @@ -608,11 +608,11 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-compute/10.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9973da41-f0cb-47cd-8f69-eb05152184c3?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/81f9ee6f-1e7f-4970-9565-33f9978ca670?api-version=2019-07-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-27T05:10:29.6634035+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"9973da41-f0cb-47cd-8f69-eb05152184c3\"\ + string: "{\r\n \"startTime\": \"2020-09-16T03:25:08.9656355+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"81f9ee6f-1e7f-4970-9565-33f9978ca670\"\ \r\n}" headers: cache-control: @@ -622,7 +622,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:10:41 GMT + - Wed, 16 Sep 2020 03:25:22 GMT expires: - '-1' pragma: @@ -639,7 +639,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14999,Microsoft.Compute/GetOperation30Min;29983 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29993 status: code: 200 message: OK @@ -656,11 +656,11 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-compute/10.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9973da41-f0cb-47cd-8f69-eb05152184c3?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/81f9ee6f-1e7f-4970-9565-33f9978ca670?api-version=2019-07-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-27T05:10:29.6634035+00:00\",\r\n \"\ - status\": \"InProgress\",\r\n \"name\": \"9973da41-f0cb-47cd-8f69-eb05152184c3\"\ + string: "{\r\n \"startTime\": \"2020-09-16T03:25:08.9656355+00:00\",\r\n \"\ + status\": \"InProgress\",\r\n \"name\": \"81f9ee6f-1e7f-4970-9565-33f9978ca670\"\ \r\n}" headers: cache-control: @@ -670,7 +670,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:11:32 GMT + - Wed, 16 Sep 2020 03:26:12 GMT expires: - '-1' pragma: @@ -687,7 +687,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14998,Microsoft.Compute/GetOperation30Min;29982 + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29991 status: code: 200 message: OK @@ -704,12 +704,12 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-compute/10.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/9973da41-f0cb-47cd-8f69-eb05152184c3?api-version=2019-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus/operations/81f9ee6f-1e7f-4970-9565-33f9978ca670?api-version=2019-07-01 response: body: - string: "{\r\n \"startTime\": \"2020-05-27T05:10:29.6634035+00:00\",\r\n \"\ - endTime\": \"2020-05-27T05:11:56.2102129+00:00\",\r\n \"status\": \"Succeeded\"\ - ,\r\n \"name\": \"9973da41-f0cb-47cd-8f69-eb05152184c3\"\r\n}" + string: "{\r\n \"startTime\": \"2020-09-16T03:25:08.9656355+00:00\",\r\n \"\ + endTime\": \"2020-09-16T03:26:25.0440116+00:00\",\r\n \"status\": \"Succeeded\"\ + ,\r\n \"name\": \"81f9ee6f-1e7f-4970-9565-33f9978ca670\"\r\n}" headers: cache-control: - no-cache @@ -718,7 +718,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:12:02 GMT + - Wed, 16 Sep 2020 03:26:42 GMT expires: - '-1' pragma: @@ -735,7 +735,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29980 + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29989 status: code: 200 message: OK @@ -757,28 +757,28 @@ interactions: body: string: "{\r\n \"name\": \"vm_name\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vm_name\"\ ,\r\n \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\"\ - : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"6970ba6d-543d-4448-9f7c-87378e42b9fc\"\ + : \"eastus\",\r\n \"properties\": {\r\n \"vmId\": \"3f145f13-f7ad-43e0-a499-37a258b865a7\"\ ,\r\n \"hardwareProfile\": {\r\n \"vmSize\": \"Standard_D2_v2\"\r\n\ \ },\r\n \"storageProfile\": {\r\n \"imageReference\": {\r\n \ \ \"publisher\": \"MicrosoftWindowsServer\",\r\n \"offer\": \"\ WindowsServer\",\r\n \"sku\": \"2016-Datacenter\",\r\n \"version\"\ - : \"latest\",\r\n \"exactVersion\": \"14393.3686.2005061700\"\r\n \ + : \"latest\",\r\n \"exactVersion\": \"14393.3930.2009041537\"\r\n \ \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \ \ \"name\": \"myVMosdisk\",\r\n \"createOption\": \"FromImage\"\ ,\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": {\r\n\ \ \"storageAccountType\": \"Standard_LRS\",\r\n \"id\":\ - \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/myVMosdisk\"\ + \ \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/T3YSTF6ZWQW5NJU6RGJD6JDB43ZG4R5DPXWT423BKGVAFUJ5BHL4FFN2F67NJYLISNRT3LFORAE/providers/Microsoft.Compute/disks/myVMosdisk\"\ \r\n },\r\n \"diskSizeGB\": 127\r\n },\r\n \"dataDisks\"\ - : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"vm_name_disk2_e41807eba91a48e3b56df4551adf767f\"\ + : [\r\n {\r\n \"lun\": 0,\r\n \"name\": \"vm_name_disk2_7453cbbaab4a4fcf88f83430dcb7d429\"\ ,\r\n \"createOption\": \"Empty\",\r\n \"caching\": \"None\"\ ,\r\n \"managedDisk\": {\r\n \"storageAccountType\": \"\ - Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/vm_name_disk2_e41807eba91a48e3b56df4551adf767f\"\ + Standard_LRS\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/T3YSTF6ZWQW5NJU6RGJD6JDB43ZG4R5DPXWT423BKGVAFUJ5BHL4FFN2F67NJYLISNRT3LFORAE/providers/Microsoft.Compute/disks/vm_name_disk2_7453cbbaab4a4fcf88f83430dcb7d429\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n },\r\n {\r\n \"lun\": 1,\r\n \"\ - name\": \"vm_name_disk3_530d798b661242f1a348217eebcd0263\",\r\n \"\ + name\": \"vm_name_disk3_dd107b82c8bd4708839b16a71e3e52a3\",\r\n \"\ createOption\": \"Empty\",\r\n \"caching\": \"None\",\r\n \ \ \"managedDisk\": {\r\n \"storageAccountType\": \"Standard_LRS\"\ - ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/disks/vm_name_disk3_530d798b661242f1a348217eebcd0263\"\ + ,\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/T3YSTF6ZWQW5NJU6RGJD6JDB43ZG4R5DPXWT423BKGVAFUJ5BHL4FFN2F67NJYLISNRT3LFORAE/providers/Microsoft.Compute/disks/vm_name_disk3_dd107b82c8bd4708839b16a71e3e52a3\"\ \r\n },\r\n \"diskSizeGB\": 1023,\r\n \"toBeDetached\"\ : false\r\n }\r\n ]\r\n },\r\n \"osProfile\": {\r\n \ \ \"computerName\": \"myVM\",\r\n \"adminUsername\": \"testuser\",\r\ @@ -793,11 +793,11 @@ interactions: cache-control: - no-cache content-length: - - '2902' + - '3037' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:12:02 GMT + - Wed, 16 Sep 2020 03:26:42 GMT expires: - '-1' pragma: @@ -814,7 +814,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-resource: - - Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31984 + - Microsoft.Compute/LowCostGet3Min;3997,Microsoft.Compute/LowCostGet30Min;31997 status: code: 200 message: OK @@ -828,7 +828,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/providers/microsoft.insights/operations?api-version=2015-04-01 response: @@ -1334,24 +1334,187 @@ interactions: Azure Monitor","resource":"Scheduled query rule","operation":"Scheduled query rule delete","description":"Deleting a scheduled query rule"},"properties":{}},{"name":"Microsoft.Insights/Logs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"Logs","operation":"Read Logs","description":"Reading - data from all your logs"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from all your logs"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADDomainServicesAccountLogon/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADDomainServicesAccountLogon","operation":"Read + AADDomainServicesAccountLogon data","description":"Read data from the AADDomainServicesAccountLogon + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADDomainServicesAccountManagement/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADDomainServicesAccountManagement","operation":"Read + AADDomainServicesAccountManagement data","description":"Read data from the + AADDomainServicesAccountManagement table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADDomainServicesDirectoryServiceAccess/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADDomainServicesDirectoryServiceAccess","operation":"Read + AADDomainServicesDirectoryServiceAccess data","description":"Read data from + the AADDomainServicesDirectoryServiceAccess table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADDomainServicesLogonLogoff/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADDomainServicesLogonLogoff","operation":"Read + AADDomainServicesLogonLogoff data","description":"Read data from the AADDomainServicesLogonLogoff + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADDomainServicesPolicyChange/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADDomainServicesPolicyChange","operation":"Read + AADDomainServicesPolicyChange data","description":"Read data from the AADDomainServicesPolicyChange + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADDomainServicesPrivilegeUse/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADDomainServicesPrivilegeUse","operation":"Read + AADDomainServicesPrivilegeUse data","description":"Read data from the AADDomainServicesPrivilegeUse + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADDomainServicesSystemSecurity/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADDomainServicesSystemSecurity","operation":"Read + AADDomainServicesSystemSecurity data","description":"Read data from the AADDomainServicesSystemSecurity + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADManagedIdentitySignInLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADManagedIdentitySignInLogs","operation":"Read + AADManagedIdentitySignInLogs data","description":"Read data from the AADManagedIdentitySignInLogs + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADNonInteractiveUserSignInLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADNonInteractiveUserSignInLogs","operation":"Read + AADNonInteractiveUserSignInLogs data","description":"Read data from the AADNonInteractiveUserSignInLogs + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AADServicePrincipalSignInLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AADServicePrincipalSignInLogs","operation":"Read + AADServicePrincipalSignInLogs data","description":"Read data from the AADServicePrincipalSignInLogs + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"ADAssessmentRecommendation","operation":"Read ADAssessmentRecommendation - data","description":"Read data from the ADAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADReplicationResult/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the ADAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AddonAzureBackupAlerts/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AddonAzureBackupAlerts","operation":"Read AddonAzureBackupAlerts + data","description":"Read data from the AddonAzureBackupAlerts table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AddonAzureBackupJobs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AddonAzureBackupJobs","operation":"Read AddonAzureBackupJobs + data","description":"Read data from the AddonAzureBackupJobs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AddonAzureBackupPolicy/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AddonAzureBackupPolicy","operation":"Read AddonAzureBackupPolicy + data","description":"Read data from the AddonAzureBackupPolicy table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AddonAzureBackupProtectedInstance/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AddonAzureBackupProtectedInstance","operation":"Read + AddonAzureBackupProtectedInstance data","description":"Read data from the + AddonAzureBackupProtectedInstance table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AddonAzureBackupStorage/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AddonAzureBackupStorage","operation":"Read AddonAzureBackupStorage + data","description":"Read data from the AddonAzureBackupStorage table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADFActivityRun/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADFActivityRun","operation":"Read ADFActivityRun + data","description":"Read data from the ADFActivityRun table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADFPipelineRun/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADFPipelineRun","operation":"Read ADFPipelineRun + data","description":"Read data from the ADFPipelineRun table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADFSSISIntegrationRuntimeLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADFSSISIntegrationRuntimeLogs","operation":"Read + ADFSSISIntegrationRuntimeLogs data","description":"Read data from the ADFSSISIntegrationRuntimeLogs + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADFSSISPackageEventMessageContext/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADFSSISPackageEventMessageContext","operation":"Read + ADFSSISPackageEventMessageContext data","description":"Read data from the + ADFSSISPackageEventMessageContext table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADFSSISPackageEventMessages/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADFSSISPackageEventMessages","operation":"Read + ADFSSISPackageEventMessages data","description":"Read data from the ADFSSISPackageEventMessages + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADFSSISPackageExecutableStatistics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADFSSISPackageExecutableStatistics","operation":"Read + ADFSSISPackageExecutableStatistics data","description":"Read data from the + ADFSSISPackageExecutableStatistics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADFSSISPackageExecutionComponentPhases/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADFSSISPackageExecutionComponentPhases","operation":"Read + ADFSSISPackageExecutionComponentPhases data","description":"Read data from + the ADFSSISPackageExecutionComponentPhases table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADFSSISPackageExecutionDataStatistics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADFSSISPackageExecutionDataStatistics","operation":"Read + ADFSSISPackageExecutionDataStatistics data","description":"Read data from + the ADFSSISPackageExecutionDataStatistics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADFTriggerRun/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADFTriggerRun","operation":"Read ADFTriggerRun + data","description":"Read data from the ADFTriggerRun table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADReplicationResult/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"ADReplicationResult","operation":"Read ADReplicationResult data","description":"Read data from the ADReplicationResult table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADSecurityAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"ADSecurityAssessmentRecommendation","operation":"Read ADSecurityAssessmentRecommendation data","description":"Read data from the - ADSecurityAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Alert/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + ADSecurityAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADTDigitalTwinsOperation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADTDigitalTwinsOperation","operation":"Read ADTDigitalTwinsOperation + data","description":"Read data from the ADTDigitalTwinsOperation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADTEventRoutesOperation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADTEventRoutesOperation","operation":"Read ADTEventRoutesOperation + data","description":"Read data from the ADTEventRoutesOperation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADTModelsOperation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADTModelsOperation","operation":"Read ADTModelsOperation + data","description":"Read data from the ADTModelsOperation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ADTQueryOperation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ADTQueryOperation","operation":"Read ADTQueryOperation + data","description":"Read data from the ADTQueryOperation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AegDeliveryFailureLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AegDeliveryFailureLogs","operation":"Read AegDeliveryFailureLogs + data","description":"Read data from the AegDeliveryFailureLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AegPublishFailureLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AegPublishFailureLogs","operation":"Read AegPublishFailureLogs + data","description":"Read data from the AegPublishFailureLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Alert/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"Alert","operation":"Read Alert data","description":"Read data from the Alert table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AlertHistory/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"AlertHistory","operation":"Read AlertHistory data","description":"Read - data from the AlertHistory table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ApplicationInsights/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the AlertHistory table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AmlComputeClusterEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AmlComputeClusterEvent","operation":"Read AmlComputeClusterEvent + data","description":"Read data from the AmlComputeClusterEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AmlComputeClusterNodeEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AmlComputeClusterNodeEvent","operation":"Read AmlComputeClusterNodeEvent + data","description":"Read data from the AmlComputeClusterNodeEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AmlComputeCpuGpuUtilization/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AmlComputeCpuGpuUtilization","operation":"Read + AmlComputeCpuGpuUtilization data","description":"Read data from the AmlComputeCpuGpuUtilization + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AmlComputeJobEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AmlComputeJobEvent","operation":"Read AmlComputeJobEvent + data","description":"Read data from the AmlComputeJobEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AmlRunStatusChangedEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AmlRunStatusChangedEvent","operation":"Read AmlRunStatusChangedEvent + data","description":"Read data from the AmlRunStatusChangedEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ApiManagementGatewayLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ApiManagementGatewayLogs","operation":"Read ApiManagementGatewayLogs + data","description":"Read data from the ApiManagementGatewayLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppAvailabilityResults/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppAvailabilityResults","operation":"Read AppAvailabilityResults + data","description":"Read data from the AppAvailabilityResults table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppBrowserTimings/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppBrowserTimings","operation":"Read AppBrowserTimings + data","description":"Read data from the AppBrowserTimings table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppCenterError/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppCenterError","operation":"Read AppCenterError + data","description":"Read data from the AppCenterError table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppDependencies/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppDependencies","operation":"Read AppDependencies + data","description":"Read data from the AppDependencies table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppEvents/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppEvents","operation":"Read AppEvents data","description":"Read + data from the AppEvents table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppExceptions/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppExceptions","operation":"Read AppExceptions + data","description":"Read data from the AppExceptions table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ApplicationInsights/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"ApplicationInsights","operation":"Read ApplicationInsights - data","description":"Read data from the ApplicationInsights table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AzureActivity/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the ApplicationInsights table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppMetrics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppMetrics","operation":"Read AppMetrics data","description":"Read + data from the AppMetrics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppPageViews/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppPageViews","operation":"Read AppPageViews data","description":"Read + data from the AppPageViews table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppPerformanceCounters/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppPerformanceCounters","operation":"Read AppPerformanceCounters + data","description":"Read data from the AppPerformanceCounters table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppPlatformLogsforSpring/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppPlatformLogsforSpring","operation":"Read AppPlatformLogsforSpring + data","description":"Read data from the AppPlatformLogsforSpring table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppPlatformSystemLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppPlatformSystemLogs","operation":"Read AppPlatformSystemLogs + data","description":"Read data from the AppPlatformSystemLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppRequests/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppRequests","operation":"Read AppRequests data","description":"Read + data from the AppRequests table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppServiceAntivirusScanLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppServiceAntivirusScanLogs","operation":"Read + AppServiceAntivirusScanLogs data","description":"Read data from the AppServiceAntivirusScanLogs + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppServiceAppLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppServiceAppLogs","operation":"Read AppServiceAppLogs + data","description":"Read data from the AppServiceAppLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppServiceAuditLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppServiceAuditLogs","operation":"Read AppServiceAuditLogs + data","description":"Read data from the AppServiceAuditLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppServiceConsoleLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppServiceConsoleLogs","operation":"Read AppServiceConsoleLogs + data","description":"Read data from the AppServiceConsoleLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppServiceEnvironmentPlatformLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppServiceEnvironmentPlatformLogs","operation":"Read + AppServiceEnvironmentPlatformLogs data","description":"Read data from the + AppServiceEnvironmentPlatformLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppServiceFileAuditLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppServiceFileAuditLogs","operation":"Read AppServiceFileAuditLogs + data","description":"Read data from the AppServiceFileAuditLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppServiceHTTPLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppServiceHTTPLogs","operation":"Read AppServiceHTTPLogs + data","description":"Read data from the AppServiceHTTPLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppServicePlatformLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppServicePlatformLogs","operation":"Read AppServicePlatformLogs + data","description":"Read data from the AppServicePlatformLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppSystemEvents/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppSystemEvents","operation":"Read AppSystemEvents + data","description":"Read data from the AppSystemEvents table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AppTraces/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AppTraces","operation":"Read AppTraces data","description":"Read + data from the AppTraces table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AuditLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AuditLogs","operation":"Read AuditLogs data","description":"Read + data from the AuditLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AutoscaleEvaluationsLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AutoscaleEvaluationsLog","operation":"Read AutoscaleEvaluationsLog + data","description":"Read data from the AutoscaleEvaluationsLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AutoscaleScaleActionsLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AutoscaleScaleActionsLog","operation":"Read AutoscaleScaleActionsLog + data","description":"Read data from the AutoscaleScaleActionsLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AWSCloudTrail/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AWSCloudTrail","operation":"Read AWSCloudTrail + data","description":"Read data from the AWSCloudTrail table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AzureActivity/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"AzureActivity","operation":"Read AzureActivity - data","description":"Read data from the AzureActivity table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AzureMetrics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the AzureActivity table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AzureAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AzureAssessmentRecommendation","operation":"Read + AzureAssessmentRecommendation data","description":"Read data from the AzureAssessmentRecommendation + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AzureDevOpsAuditing/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AzureDevOpsAuditing","operation":"Read AzureDevOpsAuditing + data","description":"Read data from the AzureDevOpsAuditing table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AzureDiagnostics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"AzureDiagnostics","operation":"Read AzureDiagnostics + data","description":"Read data from the AzureDiagnostics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/AzureMetrics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"AzureMetrics","operation":"Read AzureMetrics data","description":"Read - data from the AzureMetrics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/BoundPort/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the AzureMetrics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/BaiClusterEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"BaiClusterEvent","operation":"Read BaiClusterEvent + data","description":"Read data from the BaiClusterEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/BaiClusterNodeEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"BaiClusterNodeEvent","operation":"Read BaiClusterNodeEvent + data","description":"Read data from the BaiClusterNodeEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/BaiJobEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"BaiJobEvent","operation":"Read BaiJobEvent data","description":"Read + data from the BaiJobEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/BehaviorAnalytics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"BehaviorAnalytics","operation":"Read BehaviorAnalytics + data","description":"Read data from the BehaviorAnalytics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/BlockchainApplicationLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"BlockchainApplicationLog","operation":"Read BlockchainApplicationLog + data","description":"Read data from the BlockchainApplicationLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/BlockchainProxyLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"BlockchainProxyLog","operation":"Read BlockchainProxyLog + data","description":"Read data from the BlockchainProxyLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/BoundPort/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"BoundPort","operation":"Read BoundPort data","description":"Read data from the BoundPort table"},"properties":{}},{"name":"Microsoft.Insights/Logs/CommonSecurityLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"CommonSecurityLog","operation":"Read CommonSecurityLog @@ -1367,11 +1530,43 @@ interactions: Azure Monitor","resource":"ContainerInventory","operation":"Read ContainerInventory data","description":"Read data from the ContainerInventory table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ContainerLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"ContainerLog","operation":"Read ContainerLog data","description":"Read - data from the ContainerLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ContainerServiceLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the ContainerLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ContainerNodeInventory/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ContainerNodeInventory","operation":"Read ContainerNodeInventory + data","description":"Read data from the ContainerNodeInventory table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ContainerRegistryLoginEvents/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ContainerRegistryLoginEvents","operation":"Read + ContainerRegistryLoginEvents data","description":"Read data from the ContainerRegistryLoginEvents + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ContainerRegistryRepositoryEvents/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ContainerRegistryRepositoryEvents","operation":"Read + ContainerRegistryRepositoryEvents data","description":"Read data from the + ContainerRegistryRepositoryEvents table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ContainerServiceLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"ContainerServiceLog","operation":"Read ContainerServiceLog data","description":"Read data from the ContainerServiceLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Tables.Custom/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"CustomLogs","operation":"Read Custom Logs","description":"Reading - data from any custom log"},"properties":{}},{"name":"Microsoft.Insights/Logs/DeviceAppCrash/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from any custom log"},"properties":{}},{"name":"Microsoft.Insights/Logs/CoreAzureBackup/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"CoreAzureBackup","operation":"Read CoreAzureBackup + data","description":"Read data from the CoreAzureBackup table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksAccounts/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksAccounts","operation":"Read DatabricksAccounts + data","description":"Read data from the DatabricksAccounts table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksClusters/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksClusters","operation":"Read DatabricksClusters + data","description":"Read data from the DatabricksClusters table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksDBFS/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksDBFS","operation":"Read DatabricksDBFS + data","description":"Read data from the DatabricksDBFS table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksInstancePools/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksInstancePools","operation":"Read DatabricksInstancePools + data","description":"Read data from the DatabricksInstancePools table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksJobs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksJobs","operation":"Read DatabricksJobs + data","description":"Read data from the DatabricksJobs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksNotebook/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksNotebook","operation":"Read DatabricksNotebook + data","description":"Read data from the DatabricksNotebook table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksSecrets/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksSecrets","operation":"Read DatabricksSecrets + data","description":"Read data from the DatabricksSecrets table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksSQLPermissions/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksSQLPermissions","operation":"Read DatabricksSQLPermissions + data","description":"Read data from the DatabricksSQLPermissions table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksSSH/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksSSH","operation":"Read DatabricksSSH + data","description":"Read data from the DatabricksSSH table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksTables/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksTables","operation":"Read DatabricksTables + data","description":"Read data from the DatabricksTables table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DatabricksWorkspace/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DatabricksWorkspace","operation":"Read DatabricksWorkspace + data","description":"Read data from the DatabricksWorkspace table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DeviceAppCrash/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"DeviceAppCrash","operation":"Read DeviceAppCrash data","description":"Read data from the DeviceAppCrash table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DeviceAppLaunch/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"DeviceAppLaunch","operation":"Read DeviceAppLaunch @@ -1399,7 +1594,9 @@ interactions: Azure Monitor","resource":"DHAppFailure","operation":"Read DHAppFailure data","description":"Read data from the DHAppFailure table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DHAppReliability/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"DHAppReliability","operation":"Read DHAppReliability - data","description":"Read data from the DHAppReliability table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DHDriverReliability/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the DHAppReliability table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DHCPActivity/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"DHCPActivity","operation":"Read DHCPActivity data","description":"Read + data from the DHCPActivity table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DHDriverReliability/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"DHDriverReliability","operation":"Read DHDriverReliability data","description":"Read data from the DHDriverReliability table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DHLogonFailures/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"DHLogonFailures","operation":"Read DHLogonFailures @@ -1415,7 +1612,9 @@ interactions: Azure Monitor","resource":"DnsEvents","operation":"Read DnsEvents data","description":"Read data from the DnsEvents table"},"properties":{}},{"name":"Microsoft.Insights/Logs/DnsInventory/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"DnsInventory","operation":"Read DnsInventory data","description":"Read - data from the DnsInventory table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ETWEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the DnsInventory table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Dynamics365Activity/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"Dynamics365Activity","operation":"Read Dynamics365Activity + data","description":"Read data from the Dynamics365Activity table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ETWEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"ETWEvent","operation":"Read ETWEvent data","description":"Read data from the ETWEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Event/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"Event","operation":"Read Event data","description":"Read @@ -1425,18 +1624,42 @@ interactions: table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ExchangeOnlineAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"ExchangeOnlineAssessmentRecommendation","operation":"Read ExchangeOnlineAssessmentRecommendation data","description":"Read data from - the ExchangeOnlineAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Heartbeat/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + the ExchangeOnlineAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/FailedIngestion/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"FailedIngestion","operation":"Read FailedIngestion + data","description":"Read data from the FailedIngestion table"},"properties":{}},{"name":"Microsoft.Insights/Logs/FunctionAppLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"FunctionAppLogs","operation":"Read FunctionAppLogs + data","description":"Read data from the FunctionAppLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Heartbeat/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"Heartbeat","operation":"Read Heartbeat data","description":"Read - data from the Heartbeat table"},"properties":{}},{"name":"Microsoft.Insights/Logs/IISAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the Heartbeat table"},"properties":{}},{"name":"Microsoft.Insights/Logs/HuntingBookmark/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"HuntingBookmark","operation":"Read HuntingBookmark + data","description":"Read data from the HuntingBookmark table"},"properties":{}},{"name":"Microsoft.Insights/Logs/IISAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"IISAssessmentRecommendation","operation":"Read IISAssessmentRecommendation data","description":"Read data from the IISAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/InboundConnection/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"InboundConnection","operation":"Read InboundConnection - data","description":"Read data from the InboundConnection table"},"properties":{}},{"name":"Microsoft.Insights/Logs/KubeNodeInventory/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the InboundConnection table"},"properties":{}},{"name":"Microsoft.Insights/Logs/InsightsMetrics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"InsightsMetrics","operation":"Read InsightsMetrics + data","description":"Read data from the InsightsMetrics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/IntuneAuditLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"IntuneAuditLogs","operation":"Read IntuneAuditLogs + data","description":"Read data from the IntuneAuditLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/IntuneDeviceComplianceOrg/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"IntuneDeviceComplianceOrg","operation":"Read IntuneDeviceComplianceOrg + data","description":"Read data from the IntuneDeviceComplianceOrg table"},"properties":{}},{"name":"Microsoft.Insights/Logs/IntuneOperationalLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"IntuneOperationalLogs","operation":"Read IntuneOperationalLogs + data","description":"Read data from the IntuneOperationalLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/IoTHubDistributedTracing/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"IoTHubDistributedTracing","operation":"Read IoTHubDistributedTracing + data","description":"Read data from the IoTHubDistributedTracing table"},"properties":{}},{"name":"Microsoft.Insights/Logs/KubeEvents/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"KubeEvents","operation":"Read KubeEvents data","description":"Read + data from the KubeEvents table"},"properties":{}},{"name":"Microsoft.Insights/Logs/KubeHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"KubeHealth","operation":"Read KubeHealth data","description":"Read + data from the KubeHealth table"},"properties":{}},{"name":"Microsoft.Insights/Logs/KubeMonAgentEvents/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"KubeMonAgentEvents","operation":"Read KubeMonAgentEvents + data","description":"Read data from the KubeMonAgentEvents table"},"properties":{}},{"name":"Microsoft.Insights/Logs/KubeNodeInventory/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"KubeNodeInventory","operation":"Read KubeNodeInventory data","description":"Read data from the KubeNodeInventory table"},"properties":{}},{"name":"Microsoft.Insights/Logs/KubePodInventory/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"KubePodInventory","operation":"Read KubePodInventory - data","description":"Read data from the KubePodInventory table"},"properties":{}},{"name":"Microsoft.Insights/Logs/LinuxAuditLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the KubePodInventory table"},"properties":{}},{"name":"Microsoft.Insights/Logs/KubeServices/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"KubeServices","operation":"Read KubeServices data","description":"Read + data from the KubeServices table"},"properties":{}},{"name":"Microsoft.Insights/Logs/LinuxAuditLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"LinuxAuditLog","operation":"Read LinuxAuditLog data","description":"Read data from the LinuxAuditLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAApplication/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAApplication","operation":"Read MAApplication @@ -1458,7 +1681,11 @@ interactions: Azure Monitor","resource":"MADeploymentPlan","operation":"Read MADeploymentPlan data","description":"Read data from the MADeploymentPlan table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MADevice/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MADevice","operation":"Read MADevice data","description":"Read - data from the MADevice table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MADevicePnPHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the MADevice table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MADeviceNotEnrolled/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MADeviceNotEnrolled","operation":"Read MADeviceNotEnrolled + data","description":"Read data from the MADeviceNotEnrolled table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MADeviceNRT/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MADeviceNRT","operation":"Read MADeviceNRT data","description":"Read + data from the MADeviceNRT table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MADevicePnPHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MADevicePnPHealth","operation":"Read MADevicePnPHealth data","description":"Read data from the MADevicePnPHealth table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MADevicePnPHealthAlternativeVersions/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MADevicePnPHealthAlternativeVersions","operation":"Read @@ -1473,9 +1700,14 @@ interactions: Azure Monitor","resource":"MADriverReadiness","operation":"Read MADriverReadiness data","description":"Read data from the MADriverReadiness table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAddin/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeAddin","operation":"Read MAOfficeAddin - data","description":"Read data from the MAOfficeAddin table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAddinHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the MAOfficeAddin table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAddinEntityHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MAOfficeAddinEntityHealth","operation":"Read MAOfficeAddinEntityHealth + data","description":"Read data from the MAOfficeAddinEntityHealth table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAddinHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeAddinHealth","operation":"Read MAOfficeAddinHealth - data","description":"Read data from the MAOfficeAddinHealth table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAddinHealthIssues/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the MAOfficeAddinHealth table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAddinHealthEventNRT/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MAOfficeAddinHealthEventNRT","operation":"Read + MAOfficeAddinHealthEventNRT data","description":"Read data from the MAOfficeAddinHealthEventNRT + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAddinHealthIssues/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeAddinHealthIssues","operation":"Read MAOfficeAddinHealthIssues data","description":"Read data from the MAOfficeAddinHealthIssues table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAddinInstance/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeAddinInstance","operation":"Read MAOfficeAddinInstance @@ -1486,13 +1718,19 @@ interactions: Azure Monitor","resource":"MAOfficeAddinReadiness","operation":"Read MAOfficeAddinReadiness data","description":"Read data from the MAOfficeAddinReadiness table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeApp/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeApp","operation":"Read MAOfficeApp data","description":"Read - data from the MAOfficeApp table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAppHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the MAOfficeApp table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAppCrashesNRT/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MAOfficeAppCrashesNRT","operation":"Read MAOfficeAppCrashesNRT + data","description":"Read data from the MAOfficeAppCrashesNRT table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAppHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeAppHealth","operation":"Read MAOfficeAppHealth data","description":"Read data from the MAOfficeAppHealth table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAppInstance/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeAppInstance","operation":"Read MAOfficeAppInstance - data","description":"Read data from the MAOfficeAppInstance table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAppReadiness/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the MAOfficeAppInstance table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAppInstanceHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MAOfficeAppInstanceHealth","operation":"Read MAOfficeAppInstanceHealth + data","description":"Read data from the MAOfficeAppInstanceHealth table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAppReadiness/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeAppReadiness","operation":"Read MAOfficeAppReadiness - data","description":"Read data from the MAOfficeAppReadiness table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeBuildInfo/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the MAOfficeAppReadiness table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeAppSessionsNRT/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MAOfficeAppSessionsNRT","operation":"Read MAOfficeAppSessionsNRT + data","description":"Read data from the MAOfficeAppSessionsNRT table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeBuildInfo/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeBuildInfo","operation":"Read MAOfficeBuildInfo data","description":"Read data from the MAOfficeBuildInfo table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeCurrencyAssessment/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeCurrencyAssessment","operation":"Read MAOfficeCurrencyAssessment @@ -1501,7 +1739,14 @@ interactions: MAOfficeCurrencyAssessmentDailyCounts data","description":"Read data from the MAOfficeCurrencyAssessmentDailyCounts table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeDeploymentStatus/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeDeploymentStatus","operation":"Read MAOfficeDeploymentStatus - data","description":"Read data from the MAOfficeDeploymentStatus table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeMacroHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the MAOfficeDeploymentStatus table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeDeploymentStatusNRT/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MAOfficeDeploymentStatusNRT","operation":"Read + MAOfficeDeploymentStatusNRT data","description":"Read data from the MAOfficeDeploymentStatusNRT + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeMacroErrorNRT/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MAOfficeMacroErrorNRT","operation":"Read MAOfficeMacroErrorNRT + data","description":"Read data from the MAOfficeMacroErrorNRT table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeMacroGlobalHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MAOfficeMacroGlobalHealth","operation":"Read MAOfficeMacroGlobalHealth + data","description":"Read data from the MAOfficeMacroGlobalHealth table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeMacroHealth/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeMacroHealth","operation":"Read MAOfficeMacroHealth data","description":"Read data from the MAOfficeMacroHealth table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAOfficeMacroHealthIssues/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAOfficeMacroHealthIssues","operation":"Read MAOfficeMacroHealthIssues @@ -1529,9 +1774,34 @@ interactions: MAWindowsCurrencyAssessmentDailyCounts data","description":"Read data from the MAWindowsCurrencyAssessmentDailyCounts table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAWindowsDeploymentStatus/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAWindowsDeploymentStatus","operation":"Read MAWindowsDeploymentStatus - data","description":"Read data from the MAWindowsDeploymentStatus table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAWindowsSysReqInstanceReadiness/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the MAWindowsDeploymentStatus table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAWindowsDeploymentStatusNRT/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MAWindowsDeploymentStatusNRT","operation":"Read + MAWindowsDeploymentStatusNRT data","description":"Read data from the MAWindowsDeploymentStatusNRT + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MAWindowsSysReqInstanceReadiness/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"MAWindowsSysReqInstanceReadiness","operation":"Read MAWindowsSysReqInstanceReadiness data","description":"Read data from the MAWindowsSysReqInstanceReadiness + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/McasShadowItReporting/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"McasShadowItReporting","operation":"Read McasShadowItReporting + data","description":"Read data from the McasShadowItReporting table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MicrosoftAzureBastionAuditLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MicrosoftAzureBastionAuditLogs","operation":"Read + MicrosoftAzureBastionAuditLogs data","description":"Read data from the MicrosoftAzureBastionAuditLogs + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MicrosoftDataShareReceivedSnapshotLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MicrosoftDataShareReceivedSnapshotLog","operation":"Read + MicrosoftDataShareReceivedSnapshotLog data","description":"Read data from + the MicrosoftDataShareReceivedSnapshotLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MicrosoftDataShareSentSnapshotLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MicrosoftDataShareSentSnapshotLog","operation":"Read + MicrosoftDataShareSentSnapshotLog data","description":"Read data from the + MicrosoftDataShareSentSnapshotLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MicrosoftDataShareShareLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MicrosoftDataShareShareLog","operation":"Read MicrosoftDataShareShareLog + data","description":"Read data from the MicrosoftDataShareShareLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MicrosoftDynamicsTelemetryPerformanceLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MicrosoftDynamicsTelemetryPerformanceLogs","operation":"Read + MicrosoftDynamicsTelemetryPerformanceLogs data","description":"Read data from + the MicrosoftDynamicsTelemetryPerformanceLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MicrosoftDynamicsTelemetrySystemMetricsLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MicrosoftDynamicsTelemetrySystemMetricsLogs","operation":"Read + MicrosoftDynamicsTelemetrySystemMetricsLogs data","description":"Read data + from the MicrosoftDynamicsTelemetrySystemMetricsLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/MicrosoftHealthcareApisAuditLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"MicrosoftHealthcareApisAuditLogs","operation":"Read + MicrosoftHealthcareApisAuditLogs data","description":"Read data from the MicrosoftHealthcareApisAuditLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/NetworkMonitoring/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"NetworkMonitoring","operation":"Read NetworkMonitoring data","description":"Read data from the NetworkMonitoring table"},"properties":{}},{"name":"Microsoft.Insights/Logs/OfficeActivity/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft @@ -1564,7 +1834,16 @@ interactions: Azure Monitor","resource":"SecurityDetection","operation":"Read SecurityDetection data","description":"Read data from the SecurityDetection table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SecurityEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"SecurityEvent","operation":"Read SecurityEvent - data","description":"Read data from the SecurityEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ServiceFabricOperationalEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the SecurityEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SecurityIncident/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"SecurityIncident","operation":"Read SecurityIncident + data","description":"Read data from the SecurityIncident table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SecurityIoTRawEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"SecurityIoTRawEvent","operation":"Read SecurityIoTRawEvent + data","description":"Read data from the SecurityIoTRawEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SecurityNestedRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"SecurityNestedRecommendation","operation":"Read + SecurityNestedRecommendation data","description":"Read data from the SecurityNestedRecommendation + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SecurityRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"SecurityRecommendation","operation":"Read SecurityRecommendation + data","description":"Read data from the SecurityRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ServiceFabricOperationalEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"ServiceFabricOperationalEvent","operation":"Read ServiceFabricOperationalEvent data","description":"Read data from the ServiceFabricOperationalEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ServiceFabricReliableActorEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft @@ -1582,18 +1861,43 @@ interactions: SfBOnlineAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SharePointOnlineAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"SharePointOnlineAssessmentRecommendation","operation":"Read SharePointOnlineAssessmentRecommendation data","description":"Read data from - the SharePointOnlineAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SPAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + the SharePointOnlineAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SignalRServiceDiagnosticLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"SignalRServiceDiagnosticLogs","operation":"Read + SignalRServiceDiagnosticLogs data","description":"Read data from the SignalRServiceDiagnosticLogs + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SigninLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"SigninLogs","operation":"Read SigninLogs data","description":"Read + data from the SigninLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SPAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"SPAssessmentRecommendation","operation":"Read SPAssessmentRecommendation data","description":"Read data from the SPAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SQLAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"SQLAssessmentRecommendation","operation":"Read SQLAssessmentRecommendation data","description":"Read data from the SQLAssessmentRecommendation - table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SQLQueryPerformance/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SqlDataClassification/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"SqlDataClassification","operation":"Read SqlDataClassification + data","description":"Read data from the SqlDataClassification table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SQLQueryPerformance/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"SQLQueryPerformance","operation":"Read SQLQueryPerformance - data","description":"Read data from the SQLQueryPerformance table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Syslog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data","description":"Read data from the SQLQueryPerformance table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SqlVulnerabilityAssessmentResult/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"SqlVulnerabilityAssessmentResult","operation":"Read + SqlVulnerabilityAssessmentResult data","description":"Read data from the SqlVulnerabilityAssessmentResult + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/StorageBlobLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"StorageBlobLogs","operation":"Read StorageBlobLogs + data","description":"Read data from the StorageBlobLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/StorageFileLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"StorageFileLogs","operation":"Read StorageFileLogs + data","description":"Read data from the StorageFileLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/StorageQueueLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"StorageQueueLogs","operation":"Read StorageQueueLogs + data","description":"Read data from the StorageQueueLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/StorageTableLogs/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"StorageTableLogs","operation":"Read StorageTableLogs + data","description":"Read data from the StorageTableLogs table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SucceededIngestion/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"SucceededIngestion","operation":"Read SucceededIngestion + data","description":"Read data from the SucceededIngestion table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Syslog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"Syslog","operation":"Read Syslog data","description":"Read data from the Syslog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/SysmonEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"SysmonEvent","operation":"Read SysmonEvent data","description":"Read - data from the SysmonEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/UAApp/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the SysmonEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/ThreatIntelligenceIndicator/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"ThreatIntelligenceIndicator","operation":"Read + ThreatIntelligenceIndicator data","description":"Read data from the ThreatIntelligenceIndicator + table"},"properties":{}},{"name":"Microsoft.Insights/Logs/TSIIngress/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"TSIIngress","operation":"Read TSIIngress data","description":"Read + data from the TSIIngress table"},"properties":{}},{"name":"Microsoft.Insights/Logs/UAApp/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"UAApp","operation":"Read UAApp data","description":"Read data from the UAApp table"},"properties":{}},{"name":"Microsoft.Insights/Logs/UAComputer/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"UAComputer","operation":"Read UAComputer data","description":"Read @@ -1625,7 +1929,19 @@ interactions: Azure Monitor","resource":"UpdateSummary","operation":"Read UpdateSummary data","description":"Read data from the UpdateSummary table"},"properties":{}},{"name":"Microsoft.Insights/Logs/Usage/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"Usage","operation":"Read Usage data","description":"Read - data from the Usage table"},"properties":{}},{"name":"Microsoft.Insights/Logs/W3CIISLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the Usage table"},"properties":{}},{"name":"Microsoft.Insights/Logs/UserAccessAnalytics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"UserAccessAnalytics","operation":"Read UserAccessAnalytics + data","description":"Read data from the UserAccessAnalytics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/UserPeerAnalytics/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"UserPeerAnalytics","operation":"Read UserPeerAnalytics + data","description":"Read data from the UserPeerAnalytics table"},"properties":{}},{"name":"Microsoft.Insights/Logs/VMBoundPort/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"VMBoundPort","operation":"Read VMBoundPort data","description":"Read + data from the VMBoundPort table"},"properties":{}},{"name":"Microsoft.Insights/Logs/VMComputer/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"VMComputer","operation":"Read VMComputer data","description":"Read + data from the VMComputer table"},"properties":{}},{"name":"Microsoft.Insights/Logs/VMConnection/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"VMConnection","operation":"Read VMConnection data","description":"Read + data from the VMConnection table"},"properties":{}},{"name":"Microsoft.Insights/Logs/VMProcess/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"VMProcess","operation":"Read VMProcess data","description":"Read + data from the VMProcess table"},"properties":{}},{"name":"Microsoft.Insights/Logs/W3CIISLog/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"W3CIISLog","operation":"Read W3CIISLog data","description":"Read data from the W3CIISLog table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WaaSDeploymentStatus/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"WaaSDeploymentStatus","operation":"Read WaaSDeploymentStatus @@ -1640,18 +1956,34 @@ interactions: data from the WDAVThreat table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WindowsClientAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"WindowsClientAssessmentRecommendation","operation":"Read WindowsClientAssessmentRecommendation data","description":"Read data from - the WindowsClientAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WindowsFirewall/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + the WindowsClientAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WindowsEvent/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"WindowsEvent","operation":"Read WindowsEvent data","description":"Read + data from the WindowsEvent table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WindowsFirewall/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"WindowsFirewall","operation":"Read WindowsFirewall data","description":"Read data from the WindowsFirewall table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WindowsServerAssessmentRecommendation/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"WindowsServerAssessmentRecommendation","operation":"Read WindowsServerAssessmentRecommendation data","description":"Read data from the WindowsServerAssessmentRecommendation table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WireData/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"WireData","operation":"Read WireData data","description":"Read - data from the WireData table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WUDOAggregatedStatus/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the WireData table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WorkloadMonitoringPerf/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"WorkloadMonitoringPerf","operation":"Read WorkloadMonitoringPerf + data","description":"Read data from the WorkloadMonitoringPerf table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WUDOAggregatedStatus/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"WUDOAggregatedStatus","operation":"Read WUDOAggregatedStatus data","description":"Read data from the WUDOAggregatedStatus table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WUDOStatus/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"WUDOStatus","operation":"Read WUDOStatus data","description":"Read - data from the WUDOStatus table"},"properties":{}},{"name":"Microsoft.Insights/Baseline/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + data from the WUDOStatus table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WVDCheckpoints/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"WVDCheckpoints","operation":"Read WVDCheckpoints + data","description":"Read data from the WVDCheckpoints table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WVDConnections/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"WVDConnections","operation":"Read WVDConnections + data","description":"Read data from the WVDConnections table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WVDErrors/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"WVDErrors","operation":"Read WVDErrors data","description":"Read + data from the WVDErrors table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WVDFeeds/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"WVDFeeds","operation":"Read WVDFeeds data","description":"Read + data from the WVDFeeds table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WVDHostRegistrations/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"WVDHostRegistrations","operation":"Read WVDHostRegistrations + data","description":"Read data from the WVDHostRegistrations table"},"properties":{}},{"name":"Microsoft.Insights/Logs/WVDManagement/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft + Azure Monitor","resource":"WVDManagement","operation":"Read WVDManagement + data","description":"Read data from the WVDManagement table"},"properties":{}},{"name":"Microsoft.Insights/Baseline/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"Metric Baseline","operation":"Read metric baseline","description":"Read a metric baseline (preview)"},"properties":{}},{"name":"Microsoft.Insights/CalculateBaseline/Read","isDataAction":false,"display":{"publisher":"Microsoft","provider":"Microsoft Azure Monitor","resource":"Metric Baseline","operation":"Calculate baseline","description":"Calculate @@ -1724,11 +2056,11 @@ interactions: cache-control: - no-cache content-length: - - '122810' + - '169458' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:12:04 GMT + - Wed, 16 Sep 2020 03:26:45 GMT expires: - '-1' pragma: @@ -1747,8 +2079,8 @@ interactions: code: 200 message: OK - request: - body: 'b''{"location": "global", "properties": {"description": "This is the description - of the rule1", "severity": 3, "enabled": true, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vm_name"], + body: 'b''b\''{"location": "global", "properties": {"description": "This is the + description of the rule1", "severity": 3, "enabled": true, "scopes": ["/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vm_name"], "evaluationFrequency": "PT1M", "windowSize": "PT15M", "targetResourceType": "Microsoft.Compute/virtualMachines", "targetResourceRegion": "southcentralus", "criteria": {"odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", @@ -1757,7 +2089,7 @@ interactions: "timeAggregation": "Average", "dimensions": [], "operator": "GreaterOrLessThan", "alertSensitivity": "Medium", "failingPeriods": {"numberOfEvaluationPeriods": 4.0, "minFailingPeriodsToAlert": 4.0}}]}, "autoMitigate": false, "actions": - []}}''' + []}}\''''' headers: Accept: - application/json @@ -1766,11 +2098,11 @@ interactions: Connection: - keep-alive Content-Length: - - '963' + - '990' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Insights/metricAlerts/metricnamexx?api-version=2018-03-01 response: @@ -1801,11 +2133,11 @@ interactions: cache-control: - no-cache content-length: - - '1620' + - '1674' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:12:30 GMT + - Wed, 16 Sep 2020 03:27:06 GMT expires: - '-1' pragma: @@ -1823,7 +2155,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-resource-requests: - - '298' + - '299' x-powered-by: - ASP.NET status: @@ -1839,7 +2171,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Insights/metricAlerts/metricnamexx?api-version=2018-03-01 response: @@ -1870,11 +2202,11 @@ interactions: cache-control: - no-cache content-length: - - '1620' + - '1674' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:13:00 GMT + - Wed, 16 Sep 2020 03:27:36 GMT expires: - '-1' pragma: @@ -1906,7 +2238,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Insights/metricAlerts/metricnamexx/status?api-version=2018-03-01 response: @@ -1914,26 +2246,19 @@ interactions: string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Insights/metricAlerts/metricnamexx/status/Y3VycmVudFN0YXR1cw==\"\ ,\r\n \"name\": \"Y3VycmVudFN0YXR1cw==\",\r\n \"type\": \"Microsoft.Insights/metricAlerts/status\"\ ,\r\n \"properties\": {\r\n \"dimensions\": {},\r\n \"\ - status\": \"Healthy\",\r\n \"timestamp\": \"2020-05-27T05:13:06.5686612Z\"\ - \r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Insights/metricAlerts/metricnamexx/status/bWljcm9zb2Z0LnJlc291cmNlSWQ9L3N1YnNjcmlwdGlvbnMvOTJmOTVkOGYtM2M2Ny00MTI0LTkxYzctOGNmMDdjZGJmMjQxL3Jlc291cmNlR3JvdXBzL3Rlc3RfY2xpX21nbXRfbW9uaXRvcl90ZXN0X21ldHJpY19hbGVydHM1MzVmMTA4ZS9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL3ZtX25hbWVfX19taWNyb3NvZnQucmVzb3VyY2VUeXBlPU1pY3Jvc29mdC5Db21wdXRlL3ZpcnR1YWxNYWNoaW5lcw==\"\ - ,\r\n \"name\": \"bWljcm9zb2Z0LnJlc291cmNlSWQ9L3N1YnNjcmlwdGlvbnMvOTJmOTVkOGYtM2M2Ny00MTI0LTkxYzctOGNmMDdjZGJmMjQxL3Jlc291cmNlR3JvdXBzL3Rlc3RfY2xpX21nbXRfbW9uaXRvcl90ZXN0X21ldHJpY19hbGVydHM1MzVmMTA4ZS9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvdmlydHVhbE1hY2hpbmVzL3ZtX25hbWVfX19taWNyb3NvZnQucmVzb3VyY2VUeXBlPU1pY3Jvc29mdC5Db21wdXRlL3ZpcnR1YWxNYWNoaW5lcw==\"\ - ,\r\n \"type\": \"Microsoft.Insights/metricAlerts/status\",\r\n \ - \ \"properties\": {\r\n \"dimensions\": {\r\n \"microsoft.resourceId\"\ - : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vm_name\"\ - ,\r\n \"microsoft.resourceType\": \"Microsoft.Compute/virtualMachines\"\ - \r\n },\r\n \"status\": \"Healthy\",\r\n \"timestamp\"\ - : \"2020-05-27T05:13:06.5686612Z\"\r\n }\r\n }\r\n ]\r\n}" + status\": \"Unknown\",\r\n \"timestamp\": \"2020-09-16T03:27:39.1123665Z\"\ + \r\n }\r\n }\r\n ]\r\n}" headers: api-supported-versions: - 1.0, 2.0, 2017-09-01-preview, 2018-03-01 cache-control: - no-cache content-length: - - '1871' + - '517' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:13:06 GMT + - Wed, 16 Sep 2020 03:27:38 GMT expires: - '-1' pragma: @@ -1965,7 +2290,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Insights/metricAlerts/metricnamexx/status/Y3VycmVudFN0YXR1cw%3D%3D?api-version=2018-03-01 response: @@ -1973,7 +2298,7 @@ interactions: string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Insights/metricAlerts/metricnamexx\"\ ,\r\n \"name\": \"Y3VycmVudFN0YXR1cw==\",\r\n \"type\": \"Microsoft.Insights/metricAlerts/status\"\ ,\r\n \"properties\": {\r\n \"dimensions\": {},\r\n \"\ - status\": \"Healthy\",\r\n \"timestamp\": \"2020-05-27T05:13:08.9145178Z\"\ + status\": \"Healthy\",\r\n \"timestamp\": \"2020-09-16T03:27:41.803534Z\"\ \r\n }\r\n }\r\n ]\r\n}" headers: api-supported-versions: @@ -1981,11 +2306,11 @@ interactions: cache-control: - no-cache content-length: - - '462' + - '488' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:13:08 GMT + - Wed, 16 Sep 2020 03:27:41 GMT expires: - '-1' pragma: @@ -2017,7 +2342,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vm_name/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default?api-version=2018-11-27-preview response: @@ -2027,17 +2352,17 @@ interactions: cache-control: - no-cache content-length: - - '579' + - '633' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 05:13:08 GMT + - Wed, 16 Sep 2020 03:27:41 GMT expires: - '-1' pragma: - no-cache server: - - ServiceMap-API-AAPRODSEA/1.1.1220.241 + - ServiceMap-API-AAPRODSEA/1.1.1348.311 - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains @@ -2048,7 +2373,7 @@ interactions: x-content-type-options: - nosniff x-ms-elapsed: - - '30' + - '5' status: code: 200 message: OK @@ -2062,24 +2387,24 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vm_name/providers/microsoft.insights/metrics?api-version=2018-01-01 response: body: - string: '{"cost":0,"timespan":"2020-05-27T04:13:09Z/2020-05-27T05:13:09Z","interval":"PT1M","value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vm_name/providers/Microsoft.Insights/metrics/Percentage + string: '{"cost":0,"timespan":"2020-09-16T02:27:42Z/2020-09-16T03:27:42Z","interval":"PT1M","value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vm_name/providers/Microsoft.Insights/metrics/Percentage CPU","type":"Microsoft.Insights/metrics","name":{"value":"Percentage CPU","localizedValue":"Percentage CPU"},"displayDescription":"The percentage of allocated compute units that - are currently in use by the Virtual Machine(s)","unit":"Percent","timeseries":[{"metadatavalues":[],"data":[{"timeStamp":"2020-05-27T04:13:00Z"},{"timeStamp":"2020-05-27T04:14:00Z"},{"timeStamp":"2020-05-27T04:15:00Z"},{"timeStamp":"2020-05-27T04:16:00Z"},{"timeStamp":"2020-05-27T04:17:00Z"},{"timeStamp":"2020-05-27T04:18:00Z"},{"timeStamp":"2020-05-27T04:19:00Z"},{"timeStamp":"2020-05-27T04:20:00Z"},{"timeStamp":"2020-05-27T04:21:00Z"},{"timeStamp":"2020-05-27T04:22:00Z"},{"timeStamp":"2020-05-27T04:23:00Z"},{"timeStamp":"2020-05-27T04:24:00Z"},{"timeStamp":"2020-05-27T04:25:00Z"},{"timeStamp":"2020-05-27T04:26:00Z"},{"timeStamp":"2020-05-27T04:27:00Z"},{"timeStamp":"2020-05-27T04:28:00Z"},{"timeStamp":"2020-05-27T04:29:00Z"},{"timeStamp":"2020-05-27T04:30:00Z"},{"timeStamp":"2020-05-27T04:31:00Z"},{"timeStamp":"2020-05-27T04:32:00Z"},{"timeStamp":"2020-05-27T04:33:00Z"},{"timeStamp":"2020-05-27T04:34:00Z"},{"timeStamp":"2020-05-27T04:35:00Z"},{"timeStamp":"2020-05-27T04:36:00Z"},{"timeStamp":"2020-05-27T04:37:00Z"},{"timeStamp":"2020-05-27T04:38:00Z"},{"timeStamp":"2020-05-27T04:39:00Z"},{"timeStamp":"2020-05-27T04:40:00Z"},{"timeStamp":"2020-05-27T04:41:00Z"},{"timeStamp":"2020-05-27T04:42:00Z"},{"timeStamp":"2020-05-27T04:43:00Z"},{"timeStamp":"2020-05-27T04:44:00Z"},{"timeStamp":"2020-05-27T04:45:00Z"},{"timeStamp":"2020-05-27T04:46:00Z"},{"timeStamp":"2020-05-27T04:47:00Z"},{"timeStamp":"2020-05-27T04:48:00Z"},{"timeStamp":"2020-05-27T04:49:00Z"},{"timeStamp":"2020-05-27T04:50:00Z"},{"timeStamp":"2020-05-27T04:51:00Z"},{"timeStamp":"2020-05-27T04:52:00Z"},{"timeStamp":"2020-05-27T04:53:00Z"},{"timeStamp":"2020-05-27T04:54:00Z"},{"timeStamp":"2020-05-27T04:55:00Z"},{"timeStamp":"2020-05-27T04:56:00Z"},{"timeStamp":"2020-05-27T04:57:00Z"},{"timeStamp":"2020-05-27T04:58:00Z"},{"timeStamp":"2020-05-27T04:59:00Z"},{"timeStamp":"2020-05-27T05:00:00Z"},{"timeStamp":"2020-05-27T05:01:00Z"},{"timeStamp":"2020-05-27T05:02:00Z"},{"timeStamp":"2020-05-27T05:03:00Z"},{"timeStamp":"2020-05-27T05:04:00Z"},{"timeStamp":"2020-05-27T05:05:00Z"},{"timeStamp":"2020-05-27T05:06:00Z"},{"timeStamp":"2020-05-27T05:07:00Z"},{"timeStamp":"2020-05-27T05:08:00Z"},{"timeStamp":"2020-05-27T05:09:00Z"},{"timeStamp":"2020-05-27T05:10:00Z"},{"timeStamp":"2020-05-27T05:11:00Z"},{"timeStamp":"2020-05-27T05:12:00Z"}]}],"errorCode":"Success"}],"namespace":"Microsoft.Compute/virtualMachines","resourceregion":"eastus"}' + are currently in use by the Virtual Machine(s)","unit":"Percent","timeseries":[{"metadatavalues":[],"data":[{"timeStamp":"2020-09-16T02:27:00Z"},{"timeStamp":"2020-09-16T02:28:00Z"},{"timeStamp":"2020-09-16T02:29:00Z"},{"timeStamp":"2020-09-16T02:30:00Z"},{"timeStamp":"2020-09-16T02:31:00Z"},{"timeStamp":"2020-09-16T02:32:00Z"},{"timeStamp":"2020-09-16T02:33:00Z"},{"timeStamp":"2020-09-16T02:34:00Z"},{"timeStamp":"2020-09-16T02:35:00Z"},{"timeStamp":"2020-09-16T02:36:00Z"},{"timeStamp":"2020-09-16T02:37:00Z"},{"timeStamp":"2020-09-16T02:38:00Z"},{"timeStamp":"2020-09-16T02:39:00Z"},{"timeStamp":"2020-09-16T02:40:00Z"},{"timeStamp":"2020-09-16T02:41:00Z"},{"timeStamp":"2020-09-16T02:42:00Z"},{"timeStamp":"2020-09-16T02:43:00Z"},{"timeStamp":"2020-09-16T02:44:00Z"},{"timeStamp":"2020-09-16T02:45:00Z"},{"timeStamp":"2020-09-16T02:46:00Z"},{"timeStamp":"2020-09-16T02:47:00Z"},{"timeStamp":"2020-09-16T02:48:00Z"},{"timeStamp":"2020-09-16T02:49:00Z"},{"timeStamp":"2020-09-16T02:50:00Z"},{"timeStamp":"2020-09-16T02:51:00Z"},{"timeStamp":"2020-09-16T02:52:00Z"},{"timeStamp":"2020-09-16T02:53:00Z"},{"timeStamp":"2020-09-16T02:54:00Z"},{"timeStamp":"2020-09-16T02:55:00Z"},{"timeStamp":"2020-09-16T02:56:00Z"},{"timeStamp":"2020-09-16T02:57:00Z"},{"timeStamp":"2020-09-16T02:58:00Z"},{"timeStamp":"2020-09-16T02:59:00Z"},{"timeStamp":"2020-09-16T03:00:00Z"},{"timeStamp":"2020-09-16T03:01:00Z"},{"timeStamp":"2020-09-16T03:02:00Z"},{"timeStamp":"2020-09-16T03:03:00Z"},{"timeStamp":"2020-09-16T03:04:00Z"},{"timeStamp":"2020-09-16T03:05:00Z"},{"timeStamp":"2020-09-16T03:06:00Z"},{"timeStamp":"2020-09-16T03:07:00Z"},{"timeStamp":"2020-09-16T03:08:00Z"},{"timeStamp":"2020-09-16T03:09:00Z"},{"timeStamp":"2020-09-16T03:10:00Z"},{"timeStamp":"2020-09-16T03:11:00Z"},{"timeStamp":"2020-09-16T03:12:00Z"},{"timeStamp":"2020-09-16T03:13:00Z"},{"timeStamp":"2020-09-16T03:14:00Z"},{"timeStamp":"2020-09-16T03:15:00Z"},{"timeStamp":"2020-09-16T03:16:00Z"},{"timeStamp":"2020-09-16T03:17:00Z"},{"timeStamp":"2020-09-16T03:18:00Z"},{"timeStamp":"2020-09-16T03:19:00Z"},{"timeStamp":"2020-09-16T03:20:00Z"},{"timeStamp":"2020-09-16T03:21:00Z"},{"timeStamp":"2020-09-16T03:22:00Z"},{"timeStamp":"2020-09-16T03:23:00Z"},{"timeStamp":"2020-09-16T03:24:00Z"},{"timeStamp":"2020-09-16T03:25:00Z"},{"timeStamp":"2020-09-16T03:26:00Z"}]}],"errorCode":"Success"}],"namespace":"Microsoft.Compute/virtualMachines","resourceregion":"eastus"}' headers: cache-control: - no-cache content-length: - - '2922' + - '2949' content-type: - application/json date: - - Wed, 27 May 2020 05:13:09 GMT + - Wed, 16 Sep 2020 03:27:41 GMT server: - Microsoft-IIS/10.0 strict-transport-security: @@ -2109,7 +2434,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Insights/metricAlerts/metricnamexx?api-version=2018-03-01 response: @@ -2123,7 +2448,7 @@ interactions: content-length: - '0' date: - - Wed, 27 May 2020 05:13:34 GMT + - Wed, 16 Sep 2020 03:27:47 GMT expires: - '-1' pragma: @@ -2137,7 +2462,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' x-powered-by: - ASP.NET status: diff --git a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_monitor_diagnostic_settings.yaml b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_monitor_diagnostic_settings.yaml index 9d633c9019188..4da2b9bfe57de 100644 --- a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_monitor_diagnostic_settings.yaml +++ b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_monitor_diagnostic_settings.yaml @@ -30,11 +30,11 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Wed, 27 May 2020 03:24:39 GMT + - Wed, 16 Sep 2020 03:28:08 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/25005adb-c417-402d-aef0-252c8b0249ad?monitor=true&api-version=2019-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/77a26213-d44a-4db7-b657-9207d7466ddd?monitor=true&api-version=2019-04-01 pragma: - no-cache server: @@ -44,7 +44,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' status: code: 202 message: Accepted @@ -61,19 +61,19 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/25005adb-c417-402d-aef0-252c8b0249ad?monitor=true&api-version=2019-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/77a26213-d44a-4db7-b657-9207d7466ddd?monitor=true&api-version=2019-04-01 response: body: - string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx683f167c","name":"storageaccountx683f167c","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-05-27T03:24:39.9335929Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-05-27T03:24:39.9335929Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-05-27T03:24:39.8398209Z","primaryEndpoints":{"blob":"https://storageaccountx683f167c.blob.core.windows.net/","queue":"https://storageaccountx683f167c.queue.core.windows.net/","table":"https://storageaccountx683f167c.table.core.windows.net/","file":"https://storageaccountx683f167c.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx683f167c","name":"storageaccountx683f167c","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-09-16T03:28:07.5611253Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-09-16T03:28:07.5611253Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-09-16T03:28:07.4830105Z","primaryEndpoints":{"blob":"https://storageaccountx683f167c.blob.core.windows.net/","queue":"https://storageaccountx683f167c.queue.core.windows.net/","table":"https://storageaccountx683f167c.table.core.windows.net/","file":"https://storageaccountx683f167c.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' headers: cache-control: - no-cache content-length: - - '1149' + - '1162' content-type: - application/json date: - - Wed, 27 May 2020 03:24:58 GMT + - Wed, 16 Sep 2020 03:28:25 GMT expires: - '-1' pragma: @@ -107,7 +107,7 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python accept-language: - en-US method: PUT @@ -115,25 +115,25 @@ interactions: response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c","name":"namespacex683f167c","type":"Microsoft.EventHub/Namespaces","location":"East - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespacex683f167c","createdAt":"2020-05-27T03:25:11.08Z","updatedAt":"2020-05-27T03:25:11.08Z","serviceBusEndpoint":"https://namespacex683f167c.servicebus.windows.net:443/","status":"Activating"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespacex683f167c","createdAt":"2020-09-16T03:28:32.01Z","updatedAt":"2020-09-16T03:28:32.01Z","serviceBusEndpoint":"https://namespacex683f167c.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '749' + - '762' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:25:13 GMT + - Wed, 16 Sep 2020 03:28:32 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 + - Service-Bus-Resource-Provider/SN1 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/CH3 + - Service-Bus-Resource-Provider/SN1 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -158,31 +158,31 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c","name":"namespacex683f167c","type":"Microsoft.EventHub/Namespaces","location":"East - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespacex683f167c","createdAt":"2020-05-27T03:25:11.08Z","updatedAt":"2020-05-27T03:25:11.08Z","serviceBusEndpoint":"https://namespacex683f167c.servicebus.windows.net:443/","status":"Activating"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespacex683f167c","createdAt":"2020-09-16T03:28:32.01Z","updatedAt":"2020-09-16T03:28:32.01Z","serviceBusEndpoint":"https://namespacex683f167c.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '749' + - '762' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:25:44 GMT + - Wed, 16 Sep 2020 03:29:04 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 + - Service-Bus-Resource-Provider/SN1 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/CH3 + - Service-Bus-Resource-Provider/SN1 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -205,31 +205,31 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c","name":"namespacex683f167c","type":"Microsoft.EventHub/Namespaces","location":"East - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespacex683f167c","createdAt":"2020-05-27T03:25:11.08Z","updatedAt":"2020-05-27T03:25:55.327Z","serviceBusEndpoint":"https://namespacex683f167c.servicebus.windows.net:443/","status":"Active"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespacex683f167c","createdAt":"2020-09-16T03:28:32.01Z","updatedAt":"2020-09-16T03:29:15.43Z","serviceBusEndpoint":"https://namespacex683f167c.servicebus.windows.net:443/","status":"Active"}}' headers: cache-control: - no-cache content-length: - - '748' + - '760' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:26:14 GMT + - Wed, 16 Sep 2020 03:29:35 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/CH3 + - Service-Bus-Resource-Provider/SN1 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/CH3 + - Service-Bus-Resource-Provider/SN1 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -256,24 +256,24 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c/authorizationRules/authorizationrulex683f167c?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c/AuthorizationRules/authorizationrulex683f167c?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c/authorizationRules/authorizationrulex683f167c","name":"authorizationrulex683f167c","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"East + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c/AuthorizationRules/authorizationrulex683f167c","name":"authorizationrulex683f167c","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"East US","properties":{"rights":["Listen","Send","Manage"]}}' headers: cache-control: - no-cache content-length: - - '409' + - '422' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:26:27 GMT + - Wed, 16 Sep 2020 03:29:42 GMT expires: - '-1' pragma: @@ -292,16 +292,17 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1190' status: code: 200 message: OK - request: - body: 'b''{"properties": {"messageRetentionInDays": 4, "partitionCount": 4, "status": - "Active", "captureDescription": {"enabled": true, "encoding": "Avro", "intervalInSeconds": - 120, "sizeLimitInBytes": 10485763, "destination": {"name": "EventHubArchive.AzureBlockBlob", - "properties": {"storageAccountResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx683f167c", - "blobContainer": "container", "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}}}}}''' + body: 'b''b\''{"properties": {"messageRetentionInDays": 4, "partitionCount": 4, + "status": "Active", "captureDescription": {"enabled": true, "encoding": "Avro", + "intervalInSeconds": 120, "sizeLimitInBytes": 10485763, "destination": {"name": + "EventHubArchive.AzureBlockBlob", "properties": {"storageAccountResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx683f167c", + "blobContainer": "container", "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}}}}}\''''' headers: Accept: - application/json @@ -310,12 +311,12 @@ interactions: Connection: - keep-alive Content-Length: - - '644' + - '657' Content-Type: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python accept-language: - en-US method: PUT @@ -323,16 +324,16 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacex683f167c/eventhubs/eventhubx683f167c","name":"eventhubx683f167c","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"East - US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-05-27T03:26:30.127Z","updatedAt":"2020-05-27T03:26:30.727Z","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx683f167c","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' + US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-09-16T03:29:45.13Z","updatedAt":"2020-09-16T03:29:45.647Z","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx683f167c","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' headers: cache-control: - no-cache content-length: - - '1051' + - '1076' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:26:30 GMT + - Wed, 16 Sep 2020 03:29:46 GMT expires: - '-1' pragma: @@ -351,7 +352,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1189' status: code: 200 message: OK @@ -370,7 +371,7 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python accept-language: - en-US method: PUT @@ -383,11 +384,11 @@ interactions: cache-control: - no-cache content-length: - - '447' + - '460' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:26:31 GMT + - Wed, 16 Sep 2020 03:29:47 GMT expires: - '-1' pragma: @@ -406,12 +407,12 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1191' status: code: 200 message: OK - request: - body: '{"tags": {"tag1": "val1"}, "location": "eastus", "properties": {"sku": + body: '{"location": "eastus", "tags": {"tag1": "val1"}, "properties": {"sku": {"name": "PerNode"}, "retentionInDays": 30}}' headers: Accept: @@ -426,25 +427,26 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-loganalytics/0.5.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-loganalytics/0.2.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/Microsoft.OperationalInsights/workspaces/workspacex683f167c?api-version=2020-03-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/Microsoft.OperationalInsights/workspaces/workspacex683f167c?api-version=2015-11-01-preview response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\"\ - : \"f4a029a9-3f6f-4d1e-a5b7-8c83f29359fd\",\r\n \"provisioningState\":\ + : \"577a5b1e-cde7-47ab-9476-0db74f71f8c8\",\r\n \"provisioningState\":\ \ \"Creating\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \ - \ \"maxCapacityReservationLevel\": 1000,\r\n \"lastSkuUpdate\": \"\ - Wed, 27 May 2020 03:26:38 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ + \ \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": \"\ + Wed, 16 Sep 2020 03:29:51 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ \n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\":\ \ 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n \ \ },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n\ - \ \"quotaNextResetTime\": \"Wed, 27 May 2020 08:00:00 GMT\",\r\n \ + \ \"quotaNextResetTime\": \"Thu, 17 Sep 2020 02:00:00 GMT\",\r\n \ \ \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\"\ - : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\ - \n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacex683f167c\"\ + : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \ + \ \"createdDate\": \"Wed, 16 Sep 2020 03:29:51 GMT\",\r\n \"modifiedDate\"\ + : \"Wed, 16 Sep 2020 03:29:51 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacex683f167c\"\ ,\r\n \"name\": \"workspacex683f167c\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"tag1\": \"val1\"\ \r\n }\r\n}" @@ -452,11 +454,11 @@ interactions: cache-control: - no-cache content-length: - - '1092' + - '1212' content-type: - application/json date: - - Wed, 27 May 2020 03:26:39 GMT + - Wed, 16 Sep 2020 03:29:53 GMT pragma: - no-cache server: @@ -467,7 +469,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' x-powered-by: - ASP.NET - ASP.NET @@ -485,23 +487,24 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-loganalytics/0.5.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-loganalytics/0.2.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/Microsoft.OperationalInsights/workspaces/workspacex683f167c?api-version=2020-03-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/Microsoft.OperationalInsights/workspaces/workspacex683f167c?api-version=2015-11-01-preview response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\"\ - : \"f4a029a9-3f6f-4d1e-a5b7-8c83f29359fd\",\r\n \"provisioningState\":\ + : \"577a5b1e-cde7-47ab-9476-0db74f71f8c8\",\r\n \"provisioningState\":\ \ \"Succeeded\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \ - \ \"maxCapacityReservationLevel\": 1000,\r\n \"lastSkuUpdate\": \"\ - Wed, 27 May 2020 03:26:38 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ + \ \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": \"\ + Wed, 16 Sep 2020 03:29:51 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ \n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\":\ \ 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n \ \ },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n\ - \ \"quotaNextResetTime\": \"Wed, 27 May 2020 08:00:00 GMT\",\r\n \ + \ \"quotaNextResetTime\": \"Thu, 17 Sep 2020 02:00:00 GMT\",\r\n \ \ \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\"\ - : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\ - \n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacex683f167c\"\ + : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \ + \ \"createdDate\": \"Wed, 16 Sep 2020 03:29:51 GMT\",\r\n \"modifiedDate\"\ + : \"Wed, 16 Sep 2020 03:29:52 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacex683f167c\"\ ,\r\n \"name\": \"workspacex683f167c\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"tag1\": \"val1\"\ \r\n }\r\n}" @@ -509,11 +512,11 @@ interactions: cache-control: - no-cache content-length: - - '1093' + - '1213' content-type: - application/json date: - - Wed, 27 May 2020 03:27:10 GMT + - Wed, 16 Sep 2020 03:30:24 GMT pragma: - no-cache server: @@ -550,23 +553,23 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-logic/4.0.0rc2 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-logic/3.0.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflow683f167c?api-version=2018-07-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflow683f167c?api-version=2016-06-01 response: body: - string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2020-05-27T03:27:17.2391801Z","changedTime":"2020-05-27T03:27:17.2238168Z","state":"Enabled","version":"08586110568482643347","accessEndpoint":"https://prod-65.eastus.logic.azure.com:443/workflows/7367d5808c02445d8e069897876109ce","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{},"triggers":{},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.92.98.111"},{"address":"40.121.91.41"},{"address":"40.114.82.191"},{"address":"23.101.139.153"},{"address":"23.100.29.190"},{"address":"23.101.136.201"},{"address":"104.45.153.81"},{"address":"23.101.132.208"}],"accessEndpointIpAddresses":[{"address":"137.135.106.54"},{"address":"40.117.99.79"},{"address":"40.117.100.228"},{"address":"137.116.126.165"}]},"connector":{"outgoingIpAddresses":[{"address":"40.71.11.80/28"},{"address":"40.71.249.205"},{"address":"191.237.41.52"},{"address":"40.114.40.132"},{"address":"40.71.249.139"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflow683f167c","name":"workflow683f167c","type":"Microsoft.Logic/workflows","location":"eastus"}' + string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2020-09-16T03:30:32.3122188Z","changedTime":"2020-09-16T03:30:32.3033861Z","state":"Enabled","version":"08586013798531987380","accessEndpoint":"https://prod-16.eastus.logic.azure.com:443/workflows/d08101e94e244680ae76b681ec2f9b11","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{},"triggers":{},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.92.98.111"},{"address":"40.121.91.41"},{"address":"40.114.82.191"},{"address":"23.101.139.153"},{"address":"23.100.29.190"},{"address":"23.101.136.201"},{"address":"104.45.153.81"},{"address":"23.101.132.208"}],"accessEndpointIpAddresses":[{"address":"137.135.106.54"},{"address":"40.117.99.79"},{"address":"40.117.100.228"},{"address":"137.116.126.165"}]},"connector":{"outgoingIpAddresses":[{"address":"40.71.11.80/28"},{"address":"40.71.249.205"},{"address":"40.114.40.132"},{"address":"40.71.249.139"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflow683f167c","name":"workflow683f167c","type":"Microsoft.Logic/workflows","location":"eastus"}' headers: cache-control: - no-cache content-length: - - '1410' + - '1395' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:27:18 GMT + - Wed, 16 Sep 2020 03:30:34 GMT expires: - '-1' pragma: @@ -576,16 +579,16 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1196' status: code: 201 message: Created - request: - body: 'b''{"properties": {"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx683f167c", + body: 'b''b\''{"properties": {"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountx683f167c", "eventHubAuthorizationRuleId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.eventhub/namespaces/namespacex683f167c/authorizationrules/authorizationrulex683f167c", "eventHubName": "eventhubx683f167c", "metrics": [], "logs": [{"category": "WorkflowRuntime", "enabled": true, "retentionPolicy": {"enabled": false, "days": 0}}], "workspaceId": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacex683f167c"}}''' + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacex683f167c"}}\''''' headers: Accept: - application/json @@ -594,11 +597,11 @@ interactions: Connection: - keep-alive Content-Length: - - '886' + - '925' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflow683f167c/providers/microsoft.insights/diagnosticSettings/insightx683f167c?api-version=2017-05-01-preview response: @@ -608,11 +611,11 @@ interactions: cache-control: - no-cache content-length: - - '1274' + - '1326' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:27:27 GMT + - Wed, 16 Sep 2020 03:30:40 GMT expires: - '-1' pragma: @@ -642,7 +645,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflow683f167c/providers/microsoft.insights/diagnosticSettingsCategories?api-version=2017-05-01-preview response: @@ -652,11 +655,11 @@ interactions: cache-control: - no-cache content-length: - - '886' + - '912' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:27:27 GMT + - Wed, 16 Sep 2020 03:30:40 GMT expires: - '-1' pragma: @@ -684,7 +687,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflow683f167c/providers/microsoft.insights/diagnosticSettings?api-version=2017-05-01-preview response: @@ -694,11 +697,11 @@ interactions: cache-control: - no-cache content-length: - - '1286' + - '1338' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:27:28 GMT + - Wed, 16 Sep 2020 03:30:41 GMT expires: - '-1' pragma: @@ -726,7 +729,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflow683f167c/providers/microsoft.insights/diagnosticSettings/insightx683f167c?api-version=2017-05-01-preview response: @@ -736,11 +739,11 @@ interactions: cache-control: - no-cache content-length: - - '1360' + - '1412' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:27:28 GMT + - Wed, 16 Sep 2020 03:30:41 GMT expires: - '-1' pragma: @@ -768,7 +771,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflow683f167c/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime?api-version=2017-05-01-preview response: @@ -778,11 +781,11 @@ interactions: cache-control: - no-cache content-length: - - '440' + - '453' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 03:27:29 GMT + - Wed, 16 Sep 2020 03:30:42 GMT expires: - '-1' pragma: @@ -804,7 +807,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -812,7 +815,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflow683f167c/providers/microsoft.insights/diagnosticSettings/insightx683f167c?api-version=2017-05-01-preview response: @@ -824,7 +827,7 @@ interactions: content-length: - '0' date: - - Wed, 27 May 2020 03:27:31 GMT + - Wed, 16 Sep 2020 03:30:44 GMT expires: - '-1' pragma: @@ -836,7 +839,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-deletes: - - '14999' + - '14997' status: code: 200 message: OK diff --git a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_scheduled_query_rules.yaml b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_scheduled_query_rules.yaml index 3fbeda66e5d94..c04236b96fea1 100644 --- a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_scheduled_query_rules.yaml +++ b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor.test_scheduled_query_rules.yaml @@ -23,17 +23,76 @@ interactions: response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\"\ - : \"e962cfda-35b0-4887-8500-77755ce6efde\",\r\n \"provisioningState\":\ + : \"2be28b83-a92e-4a8d-81b5-19750f96aab7\",\r\n \"provisioningState\":\ + \ \"Creating\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \ + \ \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": \"\ + Wed, 16 Sep 2020 03:31:11 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ + \n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\":\ + \ 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n \ + \ },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n\ + \ \"quotaNextResetTime\": \"Thu, 17 Sep 2020 02:00:00 GMT\",\r\n \ + \ \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\"\ + : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \ + \ \"createdDate\": \"Wed, 16 Sep 2020 03:31:11 GMT\",\r\n \"modifiedDate\"\ + : \"Wed, 16 Sep 2020 03:31:11 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexe69613f0\"\ + ,\r\n \"name\": \"workspacexe69613f0\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\"\ + ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"tag1\": \"val1\"\ + \r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1212' + content-type: + - application/json + date: + - Wed, 16 Sep 2020 03:31:13 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 + msrest_azure/0.6.2 azure-mgmt-loganalytics/0.2.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/Microsoft.OperationalInsights/workspaces/workspacexe69613f0?api-version=2015-11-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\"\ + : \"2be28b83-a92e-4a8d-81b5-19750f96aab7\",\r\n \"provisioningState\":\ \ \"Succeeded\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \ - \ \"maxCapacityReservationLevel\": 1000,\r\n \"lastSkuUpdate\": \"\ - Tue, 19 May 2020 15:07:32 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ + \ \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": \"\ + Wed, 16 Sep 2020 03:31:11 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ \n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\":\ \ 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n \ \ },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n\ - \ \"quotaNextResetTime\": \"Wed, 20 May 2020 10:00:00 GMT\",\r\n \ + \ \"quotaNextResetTime\": \"Thu, 17 Sep 2020 02:00:00 GMT\",\r\n \ \ \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\"\ - : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\ - \n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexe69613f0\"\ + : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \ + \ \"createdDate\": \"Wed, 16 Sep 2020 03:31:11 GMT\",\r\n \"modifiedDate\"\ + : \"Wed, 16 Sep 2020 03:31:12 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexe69613f0\"\ ,\r\n \"name\": \"workspacexe69613f0\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"tag1\": \"val1\"\ \r\n }\r\n}" @@ -41,11 +100,11 @@ interactions: cache-control: - no-cache content-length: - - '1087' + - '1213' content-type: - application/json date: - - Tue, 19 May 2020 16:39:06 GMT + - Wed, 16 Sep 2020 03:31:44 GMT pragma: - no-cache server: @@ -59,8 +118,6 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' x-powered-by: - ASP.NET - ASP.NET @@ -68,15 +125,15 @@ interactions: code: 200 message: OK - request: - body: 'b''{"location": "eastus", "properties": {"description": "log alert description", - "enabled": "true", "source": {"query": "Heartbeat | summarize AggregatedValue - = count() by bin(TimeGenerated, 5m)", "dataSourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexe69613f0", + body: 'b''b\''{"location": "eastus", "properties": {"description": "log alert + description", "enabled": "true", "source": {"query": "Heartbeat | summarize + AggregatedValue = count() by bin(TimeGenerated, 5m)", "dataSourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexe69613f0", "queryType": "ResultCount"}, "schedule": {"frequencyInMinutes": 15, "timeWindowInMinutes": 15}, "action": {"odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", "severity": "1", "aznsAction": {"actionGroup": [], "emailSubject": "Email Header", "customWebhookPayload": "{}"}, "trigger": {"thresholdOperator": "GreaterThan", "threshold": 3.0, "metricTrigger": {"thresholdOperator": "GreaterThan", "threshold": - 5.0, "metricTriggerType": "Consecutive", "metricColumn": "Computer"}}}}}''' + 5.0, "metricTriggerType": "Consecutive", "metricColumn": "Computer"}}}}}\''''' headers: Accept: - application/json @@ -85,11 +142,11 @@ interactions: Connection: - keep-alive Content-Length: - - '996' + - '1015' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.insights/scheduledQueryRules/scheduledqueryrulee69613f0?api-version=2018-04-16 response: @@ -97,10 +154,10 @@ interactions: string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/scheduledqueryrules/scheduledqueryrulee69613f0\"\ ,\r\n \"name\": \"scheduledqueryrulee69613f0\",\r\n \"type\": \"microsoft.insights/scheduledqueryrules\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": null,\r\n \"kind\": null,\r\ - \n \"etag\": \"\\\"3300e952-0000-0100-0000-5ec40bb40000\\\"\",\r\n \"properties\"\ + \n \"etag\": \"\\\"09005b4b-0000-0100-0000-5f6187290000\\\"\",\r\n \"properties\"\ : {\r\n \"description\": \"log alert description\",\r\n \"displayName\"\ : \"scheduledqueryrulee69613f0\",\r\n \"enabled\": \"true\",\r\n \"\ - lastUpdatedTime\": \"2020-05-19T16:39:16.0488284Z\",\r\n \"provisioningState\"\ + lastUpdatedTime\": \"2020-09-16T03:31:53.2169016Z\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"source\": {\r\n \"query\": \"Heartbeat | summarize\ \ AggregatedValue = count() by bin(TimeGenerated, 5m)\",\r\n \"dataSourceId\"\ : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexe69613f0\"\ @@ -119,11 +176,11 @@ interactions: cache-control: - no-cache content-length: - - '1782' + - '1820' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:39:16 GMT + - Wed, 16 Sep 2020 03:31:55 GMT expires: - '-1' pragma: @@ -137,7 +194,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' x-powered-by: - ASP.NET status: @@ -153,7 +210,7 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.insights/scheduledQueryRules/scheduledqueryrulee69613f0?api-version=2018-04-16 response: @@ -161,10 +218,10 @@ interactions: string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/scheduledqueryrules/scheduledqueryrulee69613f0\"\ ,\r\n \"name\": \"scheduledqueryrulee69613f0\",\r\n \"type\": \"microsoft.insights/scheduledqueryrules\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": null,\r\n \"kind\": null,\r\ - \n \"etag\": \"\\\"3300e952-0000-0100-0000-5ec40bb40000\\\"\",\r\n \"properties\"\ + \n \"etag\": \"\\\"09005b4b-0000-0100-0000-5f6187290000\\\"\",\r\n \"properties\"\ : {\r\n \"description\": \"log alert description\",\r\n \"displayName\"\ : \"scheduledqueryrulee69613f0\",\r\n \"enabled\": \"true\",\r\n \"\ - lastUpdatedTime\": \"2020-05-19T16:39:16.0488284Z\",\r\n \"provisioningState\"\ + lastUpdatedTime\": \"2020-09-16T03:31:53.2169016Z\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"source\": {\r\n \"query\": \"Heartbeat | summarize\ \ AggregatedValue = count() by bin(TimeGenerated, 5m)\",\r\n \"dataSourceId\"\ : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexe69613f0\"\ @@ -183,11 +240,11 @@ interactions: cache-control: - no-cache content-length: - - '1782' + - '1820' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:39:17 GMT + - Wed, 16 Sep 2020 03:31:55 GMT expires: - '-1' pragma: @@ -223,7 +280,7 @@ interactions: Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PATCH uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.insights/scheduledQueryRules/scheduledqueryrulee69613f0?api-version=2018-04-16 response: @@ -231,10 +288,10 @@ interactions: string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.insights/scheduledqueryrules/scheduledqueryrulee69613f0\"\ ,\r\n \"name\": \"scheduledqueryrulee69613f0\",\r\n \"type\": \"microsoft.insights/scheduledqueryrules\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": null,\r\n \"kind\": null,\r\ - \n \"etag\": \"\\\"3300ea52-0000-0100-0000-5ec40bb60000\\\"\",\r\n \"properties\"\ + \n \"etag\": \"\\\"09005e4b-0000-0100-0000-5f61872c0000\\\"\",\r\n \"properties\"\ : {\r\n \"description\": \"log alert description\",\r\n \"displayName\"\ : \"scheduledqueryrulee69613f0\",\r\n \"enabled\": \"true\",\r\n \"\ - lastUpdatedTime\": \"2020-05-19T16:39:18.6964034Z\",\r\n \"provisioningState\"\ + lastUpdatedTime\": \"2020-09-16T03:31:56.639853Z\",\r\n \"provisioningState\"\ : \"Succeeded\",\r\n \"source\": {\r\n \"query\": \"Heartbeat | summarize\ \ AggregatedValue = count() by bin(TimeGenerated, 5m)\",\r\n \"dataSourceId\"\ : \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexe69613f0\"\ @@ -253,11 +310,11 @@ interactions: cache-control: - no-cache content-length: - - '1782' + - '1819' content-type: - application/json; charset=utf-8 date: - - Tue, 19 May 2020 16:39:18 GMT + - Wed, 16 Sep 2020 03:31:57 GMT expires: - '-1' pragma: @@ -275,7 +332,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' x-powered-by: - ASP.NET status: @@ -285,7 +342,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: @@ -293,7 +350,7 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.insights/scheduledQueryRules/scheduledqueryrulee69613f0?api-version=2018-04-16 response: @@ -305,7 +362,7 @@ interactions: content-length: - '0' date: - - Tue, 19 May 2020 16:39:20 GMT + - Wed, 16 Sep 2020 03:32:03 GMT expires: - '-1' pragma: diff --git a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor_async.test_monitor_diagnostic_settings.yaml b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor_async.test_monitor_diagnostic_settings.yaml index 5a5276cc34bf9..af5bc1eb258b5 100644 --- a/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor_async.test_monitor_diagnostic_settings.yaml +++ b/sdk/monitor/azure-mgmt-monitor/tests/recordings/test_cli_mgmt_monitor_async.test_monitor_diagnostic_settings.yaml @@ -30,11 +30,11 @@ interactions: content-type: - text/plain; charset=utf-8 date: - - Wed, 27 May 2020 06:46:59 GMT + - Wed, 16 Sep 2020 03:32:22 GMT expires: - '-1' location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/1b44cf4a-bd0c-48a5-a4ac-92a9178d6dc6?monitor=true&api-version=2019-04-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/c7d2644c-2d52-41d4-9d7d-0ac14a8f542f?monitor=true&api-version=2019-04-01 pragma: - no-cache server: @@ -44,7 +44,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1195' status: code: 202 message: Accepted @@ -61,19 +61,19 @@ interactions: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 msrest_azure/0.6.2 azure-mgmt-storage/5.0.0 Azure-SDK-For-Python method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/1b44cf4a-bd0c-48a5-a4ac-92a9178d6dc6?monitor=true&api-version=2019-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/locations/eastus/asyncoperations/c7d2644c-2d52-41d4-9d7d-0ac14a8f542f?monitor=true&api-version=2019-04-01 response: body: - string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountxf7e318f9","name":"storageaccountxf7e318f9","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-05-27T06:46:59.1054036Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-05-27T06:46:59.1054036Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-05-27T06:46:59.0272945Z","primaryEndpoints":{"blob":"https://storageaccountxf7e318f9.blob.core.windows.net/","queue":"https://storageaccountxf7e318f9.queue.core.windows.net/","table":"https://storageaccountxf7e318f9.table.core.windows.net/","file":"https://storageaccountxf7e318f9.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' + string: '{"sku":{"name":"Standard_LRS","tier":"Standard"},"kind":"Storage","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountxf7e318f9","name":"storageaccountxf7e318f9","type":"Microsoft.Storage/storageAccounts","location":"eastus","tags":{},"properties":{"networkAcls":{"bypass":"AzureServices","virtualNetworkRules":[],"ipRules":[],"defaultAction":"Allow"},"supportsHttpsTrafficOnly":true,"encryption":{"services":{"file":{"enabled":true,"lastEnabledTime":"2020-09-16T03:32:22.0927868Z"},"blob":{"enabled":true,"lastEnabledTime":"2020-09-16T03:32:22.0927868Z"}},"keySource":"Microsoft.Storage"},"provisioningState":"Succeeded","creationTime":"2020-09-16T03:32:21.9990807Z","primaryEndpoints":{"blob":"https://storageaccountxf7e318f9.blob.core.windows.net/","queue":"https://storageaccountxf7e318f9.queue.core.windows.net/","table":"https://storageaccountxf7e318f9.table.core.windows.net/","file":"https://storageaccountxf7e318f9.file.core.windows.net/"},"primaryLocation":"eastus","statusOfPrimary":"available"}}' headers: cache-control: - no-cache content-length: - - '1155' + - '1162' content-type: - application/json date: - - Wed, 27 May 2020 06:47:17 GMT + - Wed, 16 Sep 2020 03:32:40 GMT expires: - '-1' pragma: @@ -107,7 +107,7 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python accept-language: - en-US method: PUT @@ -115,25 +115,25 @@ interactions: response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9","name":"namespacexf7e318f9","type":"Microsoft.EventHub/Namespaces","location":"East - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespacexf7e318f9","createdAt":"2020-05-27T06:47:25.247Z","updatedAt":"2020-05-27T06:47:25.247Z","serviceBusEndpoint":"https://namespacexf7e318f9.servicebus.windows.net:443/","status":"Activating"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespacexf7e318f9","createdAt":"2020-09-16T03:32:46.977Z","updatedAt":"2020-09-16T03:32:46.977Z","serviceBusEndpoint":"https://namespacexf7e318f9.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '757' + - '764' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 06:47:25 GMT + - Wed, 16 Sep 2020 03:32:48 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -143,7 +143,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-resource-requests: - - '49' + - '47' status: code: 200 message: OK @@ -158,31 +158,31 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9","name":"namespacexf7e318f9","type":"Microsoft.EventHub/Namespaces","location":"East - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespacexf7e318f9","createdAt":"2020-05-27T06:47:25.247Z","updatedAt":"2020-05-27T06:47:25.247Z","serviceBusEndpoint":"https://namespacexf7e318f9.servicebus.windows.net:443/","status":"Activating"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:namespacexf7e318f9","createdAt":"2020-09-16T03:32:46.977Z","updatedAt":"2020-09-16T03:32:46.977Z","serviceBusEndpoint":"https://namespacexf7e318f9.servicebus.windows.net:443/","status":"Activating"}}' headers: cache-control: - no-cache content-length: - - '757' + - '764' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 06:47:56 GMT + - Wed, 16 Sep 2020 03:33:19 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -205,31 +205,31 @@ interactions: - keep-alive User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9?api-version=2017-04-01 response: body: string: '{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9","name":"namespacexf7e318f9","type":"Microsoft.EventHub/Namespaces","location":"East - US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespacexf7e318f9","createdAt":"2020-05-27T06:47:25.247Z","updatedAt":"2020-05-27T06:48:13.263Z","serviceBusEndpoint":"https://namespacexf7e318f9.servicebus.windows.net:443/","status":"Active"}}' + US","tags":{"tag1":"value1","tag2":"value2"},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"kafkaEnabled":true,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:namespacexf7e318f9","createdAt":"2020-09-16T03:32:46.977Z","updatedAt":"2020-09-16T03:33:36.487Z","serviceBusEndpoint":"https://namespacexf7e318f9.servicebus.windows.net:443/","status":"Active"}}' headers: cache-control: - no-cache content-length: - - '755' + - '762' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 06:48:27 GMT + - Wed, 16 Sep 2020 03:33:50 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -256,33 +256,33 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9/authorizationRules/authorizationrulexf7e318f9?api-version=2017-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9/AuthorizationRules/authorizationrulexf7e318f9?api-version=2017-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9/authorizationRules/authorizationrulexf7e318f9","name":"authorizationrulexf7e318f9","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"East + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9/AuthorizationRules/authorizationrulexf7e318f9","name":"authorizationrulexf7e318f9","type":"Microsoft.EventHub/Namespaces/AuthorizationRules","location":"East US","properties":{"rights":["Listen","Send","Manage"]}}' headers: cache-control: - no-cache content-length: - - '415' + - '422' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 06:48:34 GMT + - Wed, 16 Sep 2020 03:33:58 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -292,16 +292,17 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' status: code: 200 message: OK - request: - body: 'b''{"properties": {"messageRetentionInDays": 4, "partitionCount": 4, "status": - "Active", "captureDescription": {"enabled": true, "encoding": "Avro", "intervalInSeconds": - 120, "sizeLimitInBytes": 10485763, "destination": {"name": "EventHubArchive.AzureBlockBlob", - "properties": {"storageAccountResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountxf7e318f9", - "blobContainer": "container", "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}}}}}''' + body: 'b''b\''{"properties": {"messageRetentionInDays": 4, "partitionCount": 4, + "status": "Active", "captureDescription": {"enabled": true, "encoding": "Avro", + "intervalInSeconds": 120, "sizeLimitInBytes": 10485763, "destination": {"name": + "EventHubArchive.AzureBlockBlob", "properties": {"storageAccountResourceId": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountxf7e318f9", + "blobContainer": "container", "archiveNameFormat": "{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}}}}}\''''' headers: Accept: - application/json @@ -310,12 +311,12 @@ interactions: Connection: - keep-alive Content-Length: - - '650' + - '657' Content-Type: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python accept-language: - en-US method: PUT @@ -323,25 +324,25 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.EventHub/namespaces/namespacexf7e318f9/eventhubs/eventhubxf7e318f9","name":"eventhubxf7e318f9","type":"Microsoft.EventHub/Namespaces/EventHubs","location":"East - US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-05-27T06:48:38.027Z","updatedAt":"2020-05-27T06:48:38.72Z","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountxf7e318f9","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' + US","properties":{"messageRetentionInDays":4,"partitionCount":4,"status":"Active","createdAt":"2020-09-16T03:34:11.863Z","updatedAt":"2020-09-16T03:34:12.86Z","partitionIds":["0","1","2","3"],"captureDescription":{"enabled":true,"encoding":"Avro","destination":{"name":"EventHubArchive.AzureBlockBlob","properties":{"storageAccountResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountxf7e318f9","blobContainer":"container","archiveNameFormat":"{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"}},"intervalInSeconds":120,"sizeLimitInBytes":10485763}}}' headers: cache-control: - no-cache content-length: - - '1062' + - '1076' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 06:48:38 GMT + - Wed, 16 Sep 2020 03:34:13 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -370,7 +371,7 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-eventhub/3.1.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-eventhub/2.6.0 Azure-SDK-For-Python accept-language: - en-US method: PUT @@ -383,20 +384,20 @@ interactions: cache-control: - no-cache content-length: - - '453' + - '460' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 06:48:39 GMT + - Wed, 16 Sep 2020 03:34:15 GMT expires: - '-1' pragma: - no-cache server: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 - Microsoft-HTTPAPI/2.0 server-sb: - - Service-Bus-Resource-Provider/SN1 + - Service-Bus-Resource-Provider/CH3 strict-transport-security: - max-age=31536000; includeSubDomains transfer-encoding: @@ -406,12 +407,12 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1195' status: code: 200 message: OK - request: - body: '{"tags": {"tag1": "val1"}, "location": "eastus", "properties": {"sku": + body: '{"location": "eastus", "tags": {"tag1": "val1"}, "properties": {"sku": {"name": "PerNode"}, "retentionInDays": 30}}' headers: Accept: @@ -426,25 +427,84 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-loganalytics/0.5.0 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-loganalytics/0.2.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/Microsoft.OperationalInsights/workspaces/workspacexf7e318f9?api-version=2020-03-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/Microsoft.OperationalInsights/workspaces/workspacexf7e318f9?api-version=2015-11-01-preview + response: + body: + string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\"\ + : \"e7e831de-c457-40ae-a801-0340b76252f1\",\r\n \"provisioningState\":\ + \ \"Creating\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \ + \ \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": \"\ + Wed, 16 Sep 2020 03:34:22 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ + \n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\":\ + \ 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n \ + \ },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n\ + \ \"quotaNextResetTime\": \"Wed, 16 Sep 2020 16:00:00 GMT\",\r\n \ + \ \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\"\ + : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \ + \ \"createdDate\": \"Wed, 16 Sep 2020 03:34:22 GMT\",\r\n \"modifiedDate\"\ + : \"Wed, 16 Sep 2020 03:34:22 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexf7e318f9\"\ + ,\r\n \"name\": \"workspacexf7e318f9\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\"\ + ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"tag1\": \"val1\"\ + \r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1212' + content-type: + - application/json + date: + - Wed, 16 Sep 2020 03:34:25 GMT + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + x-powered-by: + - ASP.NET + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 + msrest_azure/0.6.2 azure-mgmt-loganalytics/0.2.0 Azure-SDK-For-Python + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/Microsoft.OperationalInsights/workspaces/workspacexf7e318f9?api-version=2015-11-01-preview response: body: string: "{\r\n \"properties\": {\r\n \"source\": \"Azure\",\r\n \"customerId\"\ - : \"71da7a8a-2930-4a12-a7a1-54e9c2e1b81e\",\r\n \"provisioningState\":\ + : \"e7e831de-c457-40ae-a801-0340b76252f1\",\r\n \"provisioningState\":\ \ \"Succeeded\",\r\n \"sku\": {\r\n \"name\": \"pergb2018\",\r\n \ - \ \"maxCapacityReservationLevel\": 1000,\r\n \"lastSkuUpdate\": \"\ - Wed, 27 May 2020 05:37:16 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ + \ \"maxCapacityReservationLevel\": 3000,\r\n \"lastSkuUpdate\": \"\ + Wed, 16 Sep 2020 03:34:22 GMT\"\r\n },\r\n \"retentionInDays\": 30,\r\ \n \"features\": {\r\n \"legacy\": 0,\r\n \"searchVersion\":\ \ 1,\r\n \"enableLogAccessUsingOnlyResourcePermissions\": true\r\n \ \ },\r\n \"workspaceCapping\": {\r\n \"dailyQuotaGb\": -1.0,\r\n\ - \ \"quotaNextResetTime\": \"Wed, 27 May 2020 10:00:00 GMT\",\r\n \ + \ \"quotaNextResetTime\": \"Wed, 16 Sep 2020 16:00:00 GMT\",\r\n \ \ \"dataIngestionStatus\": \"RespectQuota\"\r\n },\r\n \"publicNetworkAccessForIngestion\"\ - : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\"\r\n },\r\ - \n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexf7e318f9\"\ + : \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \ + \ \"createdDate\": \"Wed, 16 Sep 2020 03:34:22 GMT\",\r\n \"modifiedDate\"\ + : \"Wed, 16 Sep 2020 03:34:23 GMT\"\r\n },\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexf7e318f9\"\ ,\r\n \"name\": \"workspacexf7e318f9\",\r\n \"type\": \"Microsoft.OperationalInsights/workspaces\"\ ,\r\n \"location\": \"eastus\",\r\n \"tags\": {\r\n \"tag1\": \"val1\"\ \r\n }\r\n}" @@ -452,11 +512,11 @@ interactions: cache-control: - no-cache content-length: - - '1099' + - '1213' content-type: - application/json date: - - Wed, 27 May 2020 06:48:51 GMT + - Wed, 16 Sep 2020 03:34:55 GMT pragma: - no-cache server: @@ -470,8 +530,6 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1196' x-powered-by: - ASP.NET - ASP.NET @@ -495,23 +553,23 @@ interactions: - application/json; charset=utf-8 User-Agent: - python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) msrest/0.6.10 - msrest_azure/0.6.2 azure-mgmt-logic/4.0.0rc2 Azure-SDK-For-Python + msrest_azure/0.6.2 azure-mgmt-logic/3.0.0 Azure-SDK-For-Python accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflowf7e318f9?api-version=2018-07-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflowf7e318f9?api-version=2016-06-01 response: body: - string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2020-05-27T06:48:57.8880591Z","changedTime":"2020-05-27T06:48:57.8848779Z","state":"Enabled","version":"08586110447476180552","accessEndpoint":"https://prod-26.eastus.logic.azure.com:443/workflows/7ad6e93020c746f997017a206ec14299","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{},"triggers":{},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.92.98.111"},{"address":"40.121.91.41"},{"address":"40.114.82.191"},{"address":"23.101.139.153"},{"address":"23.100.29.190"},{"address":"23.101.136.201"},{"address":"104.45.153.81"},{"address":"23.101.132.208"}],"accessEndpointIpAddresses":[{"address":"137.135.106.54"},{"address":"40.117.99.79"},{"address":"40.117.100.228"},{"address":"137.116.126.165"}]},"connector":{"outgoingIpAddresses":[{"address":"40.71.11.80/28"},{"address":"40.71.249.205"},{"address":"191.237.41.52"},{"address":"40.114.40.132"},{"address":"40.71.249.139"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflowf7e318f9","name":"workflowf7e318f9","type":"Microsoft.Logic/workflows","location":"eastus"}' + string: '{"properties":{"provisioningState":"Succeeded","createdTime":"2020-09-16T03:35:00.8522178Z","changedTime":"2020-09-16T03:35:00.845895Z","state":"Enabled","version":"08586013795847441261","accessEndpoint":"https://prod-94.eastus.logic.azure.com:443/workflows/358c66b445744e4f8207436f2a024d9c","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{},"triggers":{},"actions":{},"outputs":{}},"parameters":{},"endpointsConfiguration":{"workflow":{"outgoingIpAddresses":[{"address":"13.92.98.111"},{"address":"40.121.91.41"},{"address":"40.114.82.191"},{"address":"23.101.139.153"},{"address":"23.100.29.190"},{"address":"23.101.136.201"},{"address":"104.45.153.81"},{"address":"23.101.132.208"}],"accessEndpointIpAddresses":[{"address":"137.135.106.54"},{"address":"40.117.99.79"},{"address":"40.117.100.228"},{"address":"137.116.126.165"}]},"connector":{"outgoingIpAddresses":[{"address":"40.71.11.80/28"},{"address":"40.71.249.205"},{"address":"40.114.40.132"},{"address":"40.71.249.139"}]}}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflowf7e318f9","name":"workflowf7e318f9","type":"Microsoft.Logic/workflows","location":"eastus"}' headers: cache-control: - no-cache content-length: - - '1416' + - '1394' content-type: - application/json; charset=utf-8 date: - - Wed, 27 May 2020 06:48:58 GMT + - Wed, 16 Sep 2020 03:35:01 GMT expires: - '-1' pragma: @@ -521,25 +579,25 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1196' status: code: 201 message: Created - request: - body: 'b''{"properties": {"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountxf7e318f9", + body: 'b''b\''{"properties": {"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Storage/storageAccounts/storageaccountxf7e318f9", "eventHubAuthorizationRuleId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/microsoft.eventhub/namespaces/namespacexf7e318f9/authorizationrules/authorizationrulexf7e318f9", "eventHubName": "eventhubxf7e318f9", "metrics": [], "logs": [{"category": "WorkflowRuntime", "enabled": true, "retentionPolicy": {"enabled": false, "days": 0}}], "workspaceId": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexf7e318f9"}}''' + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.operationalinsights/workspaces/workspacexf7e318f9"}}\''''' headers: Accept: - application/json Content-Length: - - '904' + - '925' Content-Type: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings/insightxf7e318f9?api-version=2017-05-01-preview response: @@ -549,7 +607,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Wed, 27 May 2020 06:49:07 GMT + date: Wed, 16 Sep 2020 03:35:10 GMT expires: '-1' pragma: no-cache server: Microsoft-IIS/10.0 @@ -561,14 +619,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/rgname/providers/Microsoft.Logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings/insightxf7e318f9?api-version=2017-05-01-preview + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/pddr3wg3pl4rkkpm72j4ktc36kvz76yhaqpylpakpnoe4zmekffxzdvaq2cpddpf67uj6yfqaqh/providers/Microsoft.Logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings/insightxf7e318f9?api-version=2017-05-01-preview - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettingsCategories?api-version=2017-05-01-preview response: @@ -578,7 +636,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Wed, 27 May 2020 06:49:08 GMT + date: Wed, 16 Sep 2020 03:35:11 GMT expires: '-1' pragma: no-cache server: Microsoft-IIS/10.0 @@ -589,14 +647,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettingsCategories?api-version=2017-05-01-preview + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/pddr3wg3pl4rkkpm72j4ktc36kvz76yhaqpylpakpnoe4zmekffxzdvaq2cpddpf67uj6yfqaqh/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettingsCategories?api-version=2017-05-01-preview - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings?api-version=2017-05-01-preview response: @@ -606,7 +664,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Wed, 27 May 2020 06:49:08 GMT + date: Wed, 16 Sep 2020 03:35:11 GMT expires: '-1' pragma: no-cache server: Microsoft-IIS/10.0 @@ -617,14 +675,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings?api-version=2017-05-01-preview + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/pddr3wg3pl4rkkpm72j4ktc36kvz76yhaqpylpakpnoe4zmekffxzdvaq2cpddpf67uj6yfqaqh/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings?api-version=2017-05-01-preview - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings/insightxf7e318f9?api-version=2017-05-01-preview response: @@ -634,7 +692,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Wed, 27 May 2020 06:49:09 GMT + date: Wed, 16 Sep 2020 03:35:12 GMT expires: '-1' pragma: no-cache server: Microsoft-IIS/10.0 @@ -645,14 +703,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings/insightxf7e318f9?api-version=2017-05-01-preview + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/pddr3wg3pl4rkkpm72j4ktc36kvz76yhaqpylpakpnoe4zmekffxzdvaq2cpddpf67uj6yfqaqh/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings/insightxf7e318f9?api-version=2017-05-01-preview - request: body: null headers: Accept: - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime?api-version=2017-05-01-preview response: @@ -662,7 +720,7 @@ interactions: cache-control: no-cache content-encoding: gzip content-type: application/json; charset=utf-8 - date: Wed, 27 May 2020 06:49:09 GMT + date: Wed, 16 Sep 2020 03:35:12 GMT expires: '-1' pragma: no-cache server: Microsoft-IIS/10.0 @@ -673,12 +731,14 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime?api-version=2017-05-01-preview + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/pddr3wg3pl4rkkpm72j4ktc36kvz76yhaqpylpakpnoe4zmekffxzdvaq2cpddpf67uj6yfqaqh/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettingsCategories/WorkflowRuntime?api-version=2017-05-01-preview - request: body: null headers: + Accept: + - application/json User-Agent: - - azsdk-python-azure-mgmt-eventhub/0.1.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) + - azsdk-python-azure-mgmt-eventhub/1.0.0 Python/3.6.9 (Linux-4.9.184-linuxkit-x86_64-with-Ubuntu-18.04-bionic) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings/insightxf7e318f9?api-version=2017-05-01-preview response: @@ -687,7 +747,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Wed, 27 May 2020 06:49:11 GMT + date: Wed, 16 Sep 2020 03:35:14 GMT expires: '-1' pragma: no-cache server: Microsoft-IIS/10.0 @@ -697,5 +757,5 @@ interactions: status: code: 200 message: OK - url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/rgname/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings/insightxf7e318f9?api-version=2017-05-01-preview + url: https://management.azure.com/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourcegroups/pddr3wg3pl4rkkpm72j4ktc36kvz76yhaqpylpakpnoe4zmekffxzdvaq2cpddpf67uj6yfqaqh/providers/microsoft.logic/workflows/workflowf7e318f9/providers/microsoft.insights/diagnosticSettings/insightxf7e318f9?api-version=2017-05-01-preview version: 1