From 0f89a4627c7b92d5d80b6c4b17d04e9f1d712a96 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 26 Jan 2021 02:20:11 +0000 Subject: [PATCH] CodeGen from PR 12578 in Azure/azure-rest-api-specs fixed pascal casing (#12578) --- .../azure/mgmt/monitor/__init__.py | 4 +- .../azure/mgmt/monitor/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 17 +- .../azure/mgmt/monitor/aio/__init__.py | 4 +- .../azure/mgmt/monitor/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 17 +- .../mgmt/monitor/v2015_04_01/__init__.py | 4 +- .../monitor/v2015_04_01/_configuration.py | 8 +- .../mgmt/monitor/v2015_04_01/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../mgmt/monitor/v2015_04_01/aio/__init__.py | 4 +- .../monitor/v2015_04_01/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../operations/_activity_logs_operations.py | 2 +- .../_autoscale_settings_operations.py | 12 +- .../monitor/v2015_04_01/models/__init__.py | 2 +- .../monitor/v2015_04_01/models/_models_py3.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../operations/_activity_logs_operations.py | 2 +- .../_autoscale_settings_operations.py | 12 +- .../mgmt/monitor/v2015_07_01/__init__.py | 4 +- .../monitor/v2015_07_01/_configuration.py | 6 +- .../mgmt/monitor/v2015_07_01/_metadata.json | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../mgmt/monitor/v2015_07_01/aio/__init__.py | 4 +- .../monitor/v2015_07_01/aio/_configuration.py | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../mgmt/monitor/v2016_03_01/__init__.py | 4 +- .../monitor/v2016_03_01/_configuration.py | 8 +- .../mgmt/monitor/v2016_03_01/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../mgmt/monitor/v2016_03_01/aio/__init__.py | 4 +- .../monitor/v2016_03_01/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../_alert_rule_incidents_operations.py | 4 +- .../aio/operations/_alert_rules_operations.py | 38 ++- .../operations/_log_profiles_operations.py | 10 +- .../monitor/v2016_03_01/models/__init__.py | 2 +- .../monitor/v2016_03_01/models/_models_py3.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../_alert_rule_incidents_operations.py | 4 +- .../operations/_alert_rules_operations.py | 38 ++- .../operations/_log_profiles_operations.py | 10 +- .../mgmt/monitor/v2016_09_01/__init__.py | 4 +- .../monitor/v2016_09_01/_configuration.py | 6 +- .../mgmt/monitor/v2016_09_01/_metadata.json | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../mgmt/monitor/v2016_09_01/aio/__init__.py | 4 +- .../monitor/v2016_09_01/aio/_configuration.py | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../monitor/v2016_09_01/models/__init__.py | 2 +- .../monitor/v2016_09_01/models/_models_py3.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../monitor/v2017_03_01_preview/__init__.py | 4 +- .../v2017_03_01_preview/_configuration.py | 8 +- .../v2017_03_01_preview/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../v2017_03_01_preview/aio/__init__.py | 4 +- .../v2017_03_01_preview/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../_activity_log_alerts_operations.py | 12 +- .../_activity_log_alerts_operations.py | 12 +- .../mgmt/monitor/v2017_04_01/__init__.py | 4 +- .../monitor/v2017_04_01/_configuration.py | 8 +- .../mgmt/monitor/v2017_04_01/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../mgmt/monitor/v2017_04_01/aio/__init__.py | 4 +- .../monitor/v2017_04_01/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../operations/_action_groups_operations.py | 14 +- .../_activity_log_alerts_operations.py | 12 +- .../monitor/v2017_04_01/models/__init__.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../operations/_action_groups_operations.py | 14 +- .../_activity_log_alerts_operations.py | 12 +- .../monitor/v2017_05_01_preview/__init__.py | 4 +- .../v2017_05_01_preview/_configuration.py | 12 +- .../v2017_05_01_preview/_metadata.json | 20 +- ...anagement_client.py => _monitor_client.py} | 12 +- .../v2017_05_01_preview/aio/__init__.py | 4 +- .../v2017_05_01_preview/aio/_configuration.py | 12 +- ...anagement_client.py => _monitor_client.py} | 12 +- ...cription_diagnostic_settings_operations.py | 20 +- .../v2017_05_01_preview/models/__init__.py | 2 +- .../v2017_05_01_preview/models/_models_py3.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 ...cription_diagnostic_settings_operations.py | 20 +- .../monitor/v2017_11_01_preview/__init__.py | 4 +- .../v2017_11_01_preview/_configuration.py | 6 +- .../v2017_11_01_preview/_metadata.json | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../v2017_11_01_preview/aio/__init__.py | 4 +- .../v2017_11_01_preview/aio/_configuration.py | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../operations/_metric_baseline_operations.py | 4 +- .../v2017_11_01_preview/models/__init__.py | 2 +- .../v2017_11_01_preview/models/_models.py | 4 + .../v2017_11_01_preview/models/_models_py3.py | 7 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../operations/_metric_baseline_operations.py | 4 +- .../monitor/v2017_12_01_preview/__init__.py | 4 +- .../v2017_12_01_preview/_configuration.py | 6 +- .../v2017_12_01_preview/_metadata.json | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../v2017_12_01_preview/aio/__init__.py | 4 +- .../v2017_12_01_preview/aio/_configuration.py | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../mgmt/monitor/v2018_01_01/__init__.py | 4 +- .../monitor/v2018_01_01/_configuration.py | 6 +- .../mgmt/monitor/v2018_01_01/_metadata.json | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../mgmt/monitor/v2018_01_01/aio/__init__.py | 4 +- .../monitor/v2018_01_01/aio/_configuration.py | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../monitor/v2018_01_01/models/__init__.py | 2 +- .../monitor/v2018_01_01/models/_models_py3.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../mgmt/monitor/v2018_03_01/__init__.py | 4 +- .../monitor/v2018_03_01/_configuration.py | 8 +- .../mgmt/monitor/v2018_03_01/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../mgmt/monitor/v2018_03_01/aio/__init__.py | 4 +- .../monitor/v2018_03_01/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../operations/_action_groups_operations.py | 14 +- .../operations/_metric_alerts_operations.py | 17 +- .../_metric_alerts_status_operations.py | 4 +- .../monitor/v2018_03_01/models/__init__.py | 6 +- .../monitor/v2018_03_01/models/_models.py | 37 ++- .../monitor/v2018_03_01/models/_models_py3.py | 45 ++- ...ient_enums.py => _monitor_client_enums.py} | 2 +- .../operations/_action_groups_operations.py | 14 +- .../operations/_metric_alerts_operations.py | 17 +- .../_metric_alerts_status_operations.py | 4 +- .../mgmt/monitor/v2018_04_16/__init__.py | 4 +- .../monitor/v2018_04_16/_configuration.py | 8 +- .../mgmt/monitor/v2018_04_16/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../mgmt/monitor/v2018_04_16/aio/__init__.py | 4 +- .../monitor/v2018_04_16/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../_scheduled_query_rules_operations.py | 12 +- .../monitor/v2018_04_16/models/__init__.py | 2 +- .../monitor/v2018_04_16/models/_models_py3.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../_scheduled_query_rules_operations.py | 12 +- .../monitor/v2018_06_01_preview/__init__.py | 4 +- .../v2018_06_01_preview/_configuration.py | 8 +- .../v2018_06_01_preview/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../v2018_06_01_preview/aio/__init__.py | 4 +- .../v2018_06_01_preview/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- ...nostics_settings_association_operations.py | 4 +- .../_guest_diagnostics_settings_operations.py | 12 +- .../v2018_06_01_preview/models/__init__.py | 2 +- .../v2018_06_01_preview/models/_models_py3.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 ...nostics_settings_association_operations.py | 4 +- .../_guest_diagnostics_settings_operations.py | 12 +- .../mgmt/monitor/v2018_09_01/__init__.py | 4 +- .../monitor/v2018_09_01/_configuration.py | 8 +- .../mgmt/monitor/v2018_09_01/_metadata.json | 13 +- ...anagement_client.py => _monitor_client.py} | 16 +- .../mgmt/monitor/v2018_09_01/aio/__init__.py | 4 +- .../monitor/v2018_09_01/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 16 +- .../v2018_09_01/aio/operations/__init__.py | 2 + .../operations/_action_groups_operations.py | 14 +- .../aio/operations/_baseline_operations.py | 2 +- .../aio/operations/_baselines_operations.py | 163 ++++++++++ .../operations/_metric_baseline_operations.py | 4 +- .../monitor/v2018_09_01/models/__init__.py | 25 +- .../monitor/v2018_09_01/models/_models.py | 264 ++++++++++++++++ .../monitor/v2018_09_01/models/_models_py3.py | 298 +++++++++++++++++- ...ient_enums.py => _monitor_client_enums.py} | 8 + .../v2018_09_01/operations/__init__.py | 2 + .../operations/_action_groups_operations.py | 14 +- .../operations/_baseline_operations.py | 2 +- .../operations/_baselines_operations.py | 168 ++++++++++ .../operations/_metric_baseline_operations.py | 4 +- .../monitor/v2018_11_27_preview/__init__.py | 4 +- .../v2018_11_27_preview/_configuration.py | 6 +- .../v2018_11_27_preview/_metadata.json | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../v2018_11_27_preview/aio/__init__.py | 4 +- .../v2018_11_27_preview/aio/_configuration.py | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../v2018_11_27_preview/models/__init__.py | 2 +- .../v2018_11_27_preview/models/_models_py3.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../mgmt/monitor/v2019_03_01/__init__.py | 4 +- .../monitor/v2019_03_01/_configuration.py | 8 +- .../mgmt/monitor/v2019_03_01/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../mgmt/monitor/v2019_03_01/aio/__init__.py | 4 +- .../monitor/v2019_03_01/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../operations/_action_groups_operations.py | 14 +- .../aio/operations/_baselines_operations.py | 2 +- .../monitor/v2019_03_01/models/__init__.py | 2 +- .../monitor/v2019_03_01/models/_models.py | 8 +- .../monitor/v2019_03_01/models/_models_py3.py | 12 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../operations/_action_groups_operations.py | 14 +- .../operations/_baselines_operations.py | 2 +- .../mgmt/monitor/v2019_06_01/__init__.py | 4 +- .../monitor/v2019_06_01/_configuration.py | 8 +- .../mgmt/monitor/v2019_06_01/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../mgmt/monitor/v2019_06_01/aio/__init__.py | 4 +- .../monitor/v2019_06_01/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../operations/_action_groups_operations.py | 14 +- .../monitor/v2019_06_01/models/__init__.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../operations/_action_groups_operations.py | 14 +- .../mgmt/monitor/v2019_10_17/__init__.py | 4 +- .../monitor/v2019_10_17/_configuration.py | 8 +- .../mgmt/monitor/v2019_10_17/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../mgmt/monitor/v2019_10_17/aio/__init__.py | 4 +- .../monitor/v2019_10_17/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- ...private_endpoint_connections_operations.py | 12 +- .../_private_link_resources_operations.py | 4 +- ..._link_scope_operation_status_operations.py | 2 +- ...rivate_link_scoped_resources_operations.py | 12 +- .../_private_link_scopes_operations.py | 14 +- ...private_endpoint_connections_operations.py | 12 +- .../_private_link_resources_operations.py | 4 +- ..._link_scope_operation_status_operations.py | 2 +- ...rivate_link_scoped_resources_operations.py | 12 +- .../_private_link_scopes_operations.py | 14 +- .../monitor/v2019_11_01_preview/__init__.py | 4 +- .../v2019_11_01_preview/_configuration.py | 6 +- .../v2019_11_01_preview/_metadata.json | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../v2019_11_01_preview/aio/__init__.py | 4 +- .../v2019_11_01_preview/aio/_configuration.py | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../v2019_11_01_preview/models/__init__.py | 8 +- .../v2019_11_01_preview/models/_models.py | 66 ++-- .../v2019_11_01_preview/models/_models_py3.py | 68 ++-- ...ient_enums.py => _monitor_client_enums.py} | 0 .../monitor/v2020_01_01_preview/__init__.py | 4 +- .../v2020_01_01_preview/_configuration.py | 6 +- .../v2020_01_01_preview/_metadata.json | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../v2020_01_01_preview/aio/__init__.py | 4 +- .../v2020_01_01_preview/aio/_configuration.py | 6 +- ...anagement_client.py => _monitor_client.py} | 9 +- .../monitor/v2020_05_01_preview/__init__.py | 4 +- .../v2020_05_01_preview/_configuration.py | 8 +- .../v2020_05_01_preview/_metadata.json | 10 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../v2020_05_01_preview/aio/__init__.py | 4 +- .../v2020_05_01_preview/aio/_configuration.py | 8 +- ...anagement_client.py => _monitor_client.py} | 11 +- .../_scheduled_query_rules_operations.py | 12 +- .../v2020_05_01_preview/models/__init__.py | 2 +- .../v2020_05_01_preview/models/_models_py3.py | 2 +- ...ient_enums.py => _monitor_client_enums.py} | 0 .../_scheduled_query_rules_operations.py | 12 +- 264 files changed, 1981 insertions(+), 1021 deletions(-) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/{_monitor_management_client.py => _monitor_client.py} (98%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/{_monitor_management_client.py => _monitor_client.py} (98%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/{_monitor_management_client.py => _monitor_client.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/{_monitor_management_client.py => _monitor_client.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/{_monitor_management_client.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/{_monitor_management_client.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/{_monitor_management_client.py => _monitor_client.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/{_monitor_management_client.py => _monitor_client.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/{_monitor_management_client.py => _monitor_client.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/{_monitor_management_client.py => _monitor_client.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/{_monitor_management_client.py => _monitor_client.py} (86%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/{_monitor_management_client.py => _monitor_client.py} (85%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/{_monitor_management_client.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/{_monitor_management_client.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/{_monitor_management_client.py => _monitor_client.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/{_monitor_management_client.py => _monitor_client.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/{_monitor_management_client.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/{_monitor_management_client.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/{_monitor_management_client.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/{_monitor_management_client.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/{_monitor_management_client.py => _monitor_client.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/{_monitor_management_client.py => _monitor_client.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/{_monitor_management_client.py => _monitor_client.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/{_monitor_management_client.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (97%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/{_monitor_management_client.py => _monitor_client.py} (86%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/{_monitor_management_client.py => _monitor_client.py} (85%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/{_monitor_management_client.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/{_monitor_management_client.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/{_monitor_management_client.py => _monitor_client.py} (83%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/{_monitor_management_client.py => _monitor_client.py} (82%) create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baselines_operations.py rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (90%) create mode 100644 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baselines_operations.py rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/{_monitor_management_client.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/{_monitor_management_client.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/{_monitor_management_client.py => _monitor_client.py} (87%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/{_monitor_management_client.py => _monitor_client.py} (86%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/{_monitor_management_client.py => _monitor_client.py} (86%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/{_monitor_management_client.py => _monitor_client.py} (85%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/{_monitor_management_client.py => _monitor_client.py} (92%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/{_monitor_management_client.py => _monitor_client.py} (91%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/{_monitor_management_client.py => _monitor_client.py} (90%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/{_monitor_management_client.py => _monitor_client.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/{_monitor_management_client.py => _monitor_client.py} (89%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/{_monitor_management_client.py => _monitor_client.py} (88%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/{_monitor_management_client.py => _monitor_client.py} (86%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/{_monitor_management_client.py => _monitor_client.py} (85%) rename sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/{_monitor_management_client_enums.py => _monitor_client_enums.py} (100%) 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 ccbeb512b0c20..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 c8e55e109fc60..2bc4e47f80c84 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py @@ -17,15 +17,15 @@ from ._version import VERSION -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py similarity index 98% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py index f92fe821ee92d..50f7e085029e0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_client.py @@ -14,7 +14,7 @@ from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -23,7 +23,7 @@ def __init__(self, *args, **kwargs): """ pass -class MonitorManagementClient(MultiApiClientMixin, _SDKClient): +class MonitorClient(MultiApiClientMixin, _SDKClient): """Monitor Management Client. This ready contains multiple API versions, to help you deal with all of the Azure clouds @@ -36,7 +36,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str api_version: API version to use if no profile is provided, or if missing in profile. @@ -47,7 +47,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient): """ DEFAULT_API_VERSION = '2019-10-17-preview' - _PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient" + _PROFILE_TAG = "azure.mgmt.monitor.MonitorClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, @@ -92,9 +92,9 @@ def __init__( ): if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(MonitorManagementClient, self).__init__( + super(MonitorClient, self).__init__( api_version=api_version, profile=profile ) @@ -304,10 +304,13 @@ def baseline(self): def baselines(self): """Instance depends on the API version: + * 2018-09-01: :class:`BaselinesOperations` * 2019-03-01: :class:`BaselinesOperations` """ api_version = self._get_api_version('baselines') - if api_version == '2019-03-01': + if api_version == '2018-09-01': + from .v2018_09_01.operations import BaselinesOperations as OperationClass + elif api_version == '2019-03-01': from .v2019_03_01.operations import BaselinesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'baselines'".format(api_version)) 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py index 89560205ad290..a68fd941da58a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_configuration.py @@ -17,15 +17,15 @@ from .._version import VERSION -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -39,7 +39,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py similarity index 98% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_client.py index fbdc799766592..c1045b0fbd1e8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/aio/_monitor_management_client.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 import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration class _SDKClient(object): def __init__(self, *args, **kwargs): @@ -23,7 +23,7 @@ def __init__(self, *args, **kwargs): """ pass -class MonitorManagementClient(MultiApiClientMixin, _SDKClient): +class MonitorClient(MultiApiClientMixin, _SDKClient): """Monitor Management Client. This ready contains multiple API versions, to help you deal with all of the Azure clouds @@ -36,7 +36,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient): :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str api_version: API version to use if no profile is provided, or if missing in profile. @@ -47,7 +47,7 @@ class MonitorManagementClient(MultiApiClientMixin, _SDKClient): """ DEFAULT_API_VERSION = '2019-10-17-preview' - _PROFILE_TAG = "azure.mgmt.monitor.MonitorManagementClient" + _PROFILE_TAG = "azure.mgmt.monitor.MonitorClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { None: DEFAULT_API_VERSION, @@ -92,9 +92,9 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(MonitorManagementClient, self).__init__( + super(MonitorClient, self).__init__( api_version=api_version, profile=profile ) @@ -304,10 +304,13 @@ def baseline(self): def baselines(self): """Instance depends on the API version: + * 2018-09-01: :class:`BaselinesOperations` * 2019-03-01: :class:`BaselinesOperations` """ api_version = self._get_api_version('baselines') - if api_version == '2019-03-01': + if api_version == '2018-09-01': + from ..v2018_09_01.aio.operations import BaselinesOperations as OperationClass + elif api_version == '2019-03-01': from ..v2019_03_01.aio.operations import BaselinesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'baselines'".format(api_version)) 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 db78f6dd9e947..bf4698ba79a3b 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 51c32ff3bddd5..d46b2edbf195e 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 @@ -2,14 +2,14 @@ "chosen_version": "2015-04-01", "total_api_version_list": ["2015-04-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py index cf573933ec237..563fad485082e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/_monitor_client.py @@ -17,7 +17,7 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActivityLogsOperations from .operations import AutoscaleSettingsOperations from .operations import EventCategoriesOperations @@ -26,7 +26,7 @@ from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar activity_logs: ActivityLogsOperations operations @@ -41,7 +41,7 @@ class MonitorManagementClient(object): :vartype tenant_activity_logs: $(python-base-namespace).v2015_04_01.operations.TenantActivityLogsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -56,12 +56,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.activity_logs = ActivityLogsOperations( @@ -80,7 +79,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py index c2ce834c0f6b3..3eaf57800886d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py index d38f6a5af172e..bc3c4f4c833cf 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/_monitor_client.py @@ -15,7 +15,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActivityLogsOperations from .operations import AutoscaleSettingsOperations from .operations import EventCategoriesOperations @@ -24,7 +24,7 @@ from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar activity_logs: ActivityLogsOperations operations @@ -39,7 +39,7 @@ class MonitorManagementClient(object): :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -53,12 +53,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.activity_logs = ActivityLogsOperations( @@ -75,7 +74,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py index 7891b73a9d1e9..6bd1f93be7424 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_activity_logs_operations.py @@ -94,7 +94,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py index 8b6c08b0d51a9..ea56e5280661a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/aio/operations/_autoscale_settings_operations.py @@ -73,7 +73,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -146,7 +146,7 @@ async def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -213,7 +213,7 @@ async def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -269,7 +269,7 @@ async def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -331,7 +331,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), } @@ -394,7 +394,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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 18b7c609c1423..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 @@ -61,7 +61,7 @@ from ._models import TimeWindow # type: ignore from ._models import WebhookNotification # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( ComparisonOperationType, EventLevel, MetricStatisticType, 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 8e4b6ec10913f..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 @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class AutoscaleNotification(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_monitor_client_enums.py 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 96a18678e7540..e03482cbb90b8 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 @@ -99,7 +99,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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 0d0d541a15c54..a313979a04956 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 @@ -78,7 +78,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -152,7 +152,7 @@ def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -220,7 +220,7 @@ def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -277,7 +277,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -340,7 +340,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'autoscaleSettingName': self._serialize.url("autoscale_setting_name", autoscale_setting_name, 'str'), } @@ -404,7 +404,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 9199b0909a686..4f0397e71c6c2 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 @@ -20,8 +20,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -38,7 +38,7 @@ def __init__( # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2015-07-01" 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 04615e710b290..bf81eebe53ac9 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 @@ -2,14 +2,14 @@ "chosen_version": "2015-07-01", "total_api_version_list": ["2015-07-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py index dfd0c5dbf56ab..6c1e840624425 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/_monitor_client.py @@ -17,12 +17,12 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ServiceDiagnosticSettingsOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar service_diagnostic_settings: ServiceDiagnosticSettingsOperations operations @@ -41,12 +41,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.service_diagnostic_settings = ServiceDiagnosticSettingsOperations( @@ -57,7 +56,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py index 514386e5d2736..c960e2b756140 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_configuration.py @@ -18,8 +18,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -35,7 +35,7 @@ def __init__( ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2015-07-01" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_management_client.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_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client.py index ba78ca1a42c1b..6d9cad39ce90c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_07_01/aio/_monitor_client.py @@ -15,12 +15,12 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ServiceDiagnosticSettingsOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar service_diagnostic_settings: ServiceDiagnosticSettingsOperations operations @@ -38,12 +38,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.service_diagnostic_settings = ServiceDiagnosticSettingsOperations( @@ -52,7 +51,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 b10736e5a2a44..f4891a9af5f63 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 fd3cdba4ddce7..c59aaa7a1174c 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 @@ -2,14 +2,14 @@ "chosen_version": "2016-03-01", "total_api_version_list": ["2016-03-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py index 8513c920c077f..5a41cf46428c6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/_monitor_client.py @@ -17,7 +17,7 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import AlertRuleIncidentsOperations from .operations import AlertRulesOperations from .operations import LogProfilesOperations @@ -25,7 +25,7 @@ from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar alert_rule_incidents: AlertRuleIncidentsOperations operations @@ -38,7 +38,7 @@ class MonitorManagementClient(object): :vartype metric_definitions: $(python-base-namespace).v2016_03_01.operations.MetricDefinitionsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -53,12 +53,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.alert_rule_incidents = AlertRuleIncidentsOperations( @@ -75,7 +74,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py index 6756d6d2267b9..b40e218cff256 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py index e5406701f0bea..980330bd826fc 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/_monitor_client.py @@ -15,7 +15,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import AlertRuleIncidentsOperations from .operations import AlertRulesOperations from .operations import LogProfilesOperations @@ -23,7 +23,7 @@ from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar alert_rule_incidents: AlertRuleIncidentsOperations operations @@ -36,7 +36,7 @@ class MonitorManagementClient(object): :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -50,12 +50,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.alert_rule_incidents = AlertRuleIncidentsOperations( @@ -70,7 +69,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py index 55c06f896b2b7..e023fd1718e10 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rule_incidents_operations.py @@ -75,7 +75,7 @@ async def get( 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), 'incidentName': self._serialize.url("incident_name", incident_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -140,7 +140,7 @@ def prepare_request(next_link=None): path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py index eaae66796a3ac..4217952ba17cb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_alert_rules_operations.py @@ -75,7 +75,7 @@ async def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -110,7 +110,7 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} # type: ignore + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}'} # type: ignore async def delete( self, @@ -135,13 +135,14 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -151,6 +152,7 @@ async def delete( # 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) @@ -158,12 +160,13 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + 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}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} # type: ignore + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}'} # type: ignore async def get( self, @@ -195,7 +198,7 @@ async def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -213,7 +216,8 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertRuleResource', pipeline_response) @@ -221,7 +225,7 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}'} # type: ignore async def update( self, @@ -256,7 +260,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -293,7 +297,7 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}'} # type: ignore def list_by_resource_group( self, @@ -327,7 +331,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -355,15 +359,16 @@ async def get_next(next_link=None): 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, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules'} # type: ignore + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules'} # type: ignore def list_by_subscription( self, @@ -393,7 +398,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -421,12 +426,13 @@ async def get_next(next_link=None): 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, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules'} # type: ignore + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py index 786981108d812..500370642e6b1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/aio/operations/_log_profiles_operations.py @@ -66,7 +66,7 @@ async def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -116,7 +116,7 @@ async def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -175,7 +175,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -236,7 +236,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -298,7 +298,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/__init__.py index e000ddda20342..149859a248132 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/__init__.py @@ -63,7 +63,7 @@ from ._models import RuleWebhookAction # type: ignore from ._models import ThresholdRuleCondition # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( AggregationType, ConditionOperator, TimeAggregationOperator, 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 8be2f2a651a5c..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 @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class Resource(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_03_01/models/_monitor_client_enums.py 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 054934826b31b..7f21013f401e5 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 @@ -80,7 +80,7 @@ def get( 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), 'incidentName': self._serialize.url("incident_name", incident_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -146,7 +146,7 @@ def prepare_request(next_link=None): path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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 4193d89ea5255..179c8d3f247ee 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 @@ -80,7 +80,7 @@ def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -115,7 +115,7 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} # type: ignore + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}'} # type: ignore def delete( self, @@ -141,13 +141,14 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) api_version = "2016-03-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -157,6 +158,7 @@ def delete( # 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) @@ -164,12 +166,13 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + 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}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} # type: ignore + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}'} # type: ignore def get( self, @@ -202,7 +205,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -220,7 +223,8 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertRuleResource', pipeline_response) @@ -228,7 +232,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}'} # type: ignore def update( self, @@ -264,7 +268,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -301,7 +305,7 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}'} # type: ignore def list_by_resource_group( self, @@ -336,7 +340,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -364,15 +368,16 @@ def get_next(next_link=None): 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, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules'} # type: ignore + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules'} # type: ignore def list_by_subscription( self, @@ -403,7 +408,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -431,12 +436,13 @@ def get_next(next_link=None): 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, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules'} # type: ignore + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules'} # type: ignore 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 742c69dc8f225..d630eb29ee31e 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 @@ -71,7 +71,7 @@ def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -122,7 +122,7 @@ def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -182,7 +182,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -244,7 +244,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'logProfileName': self._serialize.url("log_profile_name", log_profile_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -307,7 +307,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 f4e9ecb35978a..c3607ad334d17 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 @@ -20,8 +20,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -38,7 +38,7 @@ def __init__( # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2016-09-01" 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 d595643b716e4..a9ebbe9478d41 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 @@ -2,14 +2,14 @@ "chosen_version": "2016-09-01", "total_api_version_list": ["2016-09-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py index 18c80e72a6616..3b7995ae4a4cb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/_monitor_client.py @@ -17,13 +17,13 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import MetricsOperations from .operations import ServiceDiagnosticSettingsOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar metrics: MetricsOperations operations @@ -44,12 +44,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.metrics = MetricsOperations( @@ -62,7 +61,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py index 2a28aa7093818..e4edee68690cc 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_configuration.py @@ -18,8 +18,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -35,7 +35,7 @@ def __init__( ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2016-09-01" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py index 1c424ce98abcf..9cfa6badc4d04 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/aio/_monitor_client.py @@ -15,13 +15,13 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import MetricsOperations from .operations import ServiceDiagnosticSettingsOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar metrics: MetricsOperations operations @@ -41,12 +41,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.metrics = MetricsOperations( @@ -57,7 +56,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/__init__.py index ef62a11f121aa..11dadcbbb65ae 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/__init__.py @@ -31,7 +31,7 @@ from ._models import ServiceDiagnosticSettingsResource # type: ignore from ._models import ServiceDiagnosticSettingsResourcePatch # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( Unit, ) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_models_py3.py index 34242d1457575..30e6c213a6083 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_models_py3.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class ErrorResponse(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2016_09_01/models/_monitor_client_enums.py 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 a79d97c174112..fcb3564874c65 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 f34c78eab87d4..2faba829c9fa4 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 @@ -2,14 +2,14 @@ "chosen_version": "2017-03-01-preview", "total_api_version_list": ["2017-03-01-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py similarity index 86% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py index ddf7efa85be1d..b182de1b3f5c0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/_monitor_client.py @@ -17,19 +17,19 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActivityLogAlertsOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar activity_log_alerts: ActivityLogAlertsOperations operations :vartype activity_log_alerts: $(python-base-namespace).v2017_03_01_preview.operations.ActivityLogAlertsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -44,12 +44,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.activity_log_alerts = ActivityLogAlertsOperations( @@ -60,7 +59,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py index 916df862bb107..14f365399402a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py similarity index 85% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py index 1f97fff0df70e..251777fb9a7ca 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/_monitor_client.py @@ -15,19 +15,19 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActivityLogAlertsOperations from .. import models -class MonitorManagementClient(object): +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.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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -41,12 +41,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.activity_log_alerts = ActivityLogAlertsOperations( @@ -55,7 +54,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py index 292f6ebc7657d..eb7657627b2e9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_03_01_preview/aio/operations/_activity_log_alerts_operations.py @@ -73,7 +73,7 @@ async def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -140,7 +140,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -199,7 +199,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -260,7 +260,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -323,7 +323,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -393,7 +393,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) 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 94da74734c8c4..57de9f7a81b99 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 @@ -78,7 +78,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -146,7 +146,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -206,7 +206,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -268,7 +268,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -332,7 +332,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -403,7 +403,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 46edaf2a13012..bc4592a69bab2 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 1dd24a1ad48dc..fa3a79740cb07 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 @@ -2,14 +2,14 @@ "chosen_version": "2017-04-01", "total_api_version_list": ["2017-04-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py index ae156e7cffec3..977cd6d6089a0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/_monitor_client.py @@ -17,13 +17,13 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from .operations import ActivityLogAlertsOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations @@ -32,7 +32,7 @@ class MonitorManagementClient(object): :vartype activity_log_alerts: $(python-base-namespace).v2017_04_01.operations.ActivityLogAlertsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -47,12 +47,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -65,7 +64,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py index 57fdcb118a0d0..1447112a163df 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py index e2c0fd2efe6ba..e7bc0061da7e6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/_monitor_client.py @@ -15,13 +15,13 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from .operations import ActivityLogAlertsOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations @@ -30,7 +30,7 @@ class MonitorManagementClient(object): :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -44,12 +44,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -60,7 +59,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py index 353ce2bc22232..6f1f0cd91e9ee 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_action_groups_operations.py @@ -75,7 +75,7 @@ async def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -142,7 +142,7 @@ async def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -201,7 +201,7 @@ async def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -259,7 +259,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -322,7 +322,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -393,7 +393,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -467,7 +467,7 @@ async def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py index 9b26a1bb6b0b7..b3e1bb02a22f7 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/aio/operations/_activity_log_alerts_operations.py @@ -73,7 +73,7 @@ async def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -140,7 +140,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -199,7 +199,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -260,7 +260,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -323,7 +323,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -393,7 +393,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/__init__.py index ae82597fb0278..db94c22bc0ec0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/__init__.py @@ -47,7 +47,7 @@ from ._models import SmsReceiver # type: ignore from ._models import WebhookReceiver # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( ReceiverStatus, ) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_04_01/models/_monitor_client_enums.py 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 689b1d5d14217..512e9b73fcd45 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 @@ -80,7 +80,7 @@ def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -148,7 +148,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -208,7 +208,7 @@ def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -267,7 +267,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -331,7 +331,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -403,7 +403,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -478,7 +478,7 @@ def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) 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 5854c48a1409d..9fba898f42793 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 @@ -78,7 +78,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -146,7 +146,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -206,7 +206,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -268,7 +268,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'activityLogAlertName': self._serialize.url("activity_log_alert_name", activity_log_alert_name, 'str'), } @@ -332,7 +332,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -403,7 +403,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 022f5a44fa55d..42be0e5ff4406 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 @@ -20,27 +20,33 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 + :param subscription_id: The ID of the target subscription. + :type subscription_id: str """ def __init__( self, credential, # type: "TokenCredential" + subscription_id, # type: str **kwargs # type: Any ): # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential + self.subscription_id = subscription_id self.api_version = "2017-05-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) 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 30b3ab224ba84..bb504726c78d3 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 @@ -2,14 +2,14 @@ "chosen_version": "2017-05-01-preview", "total_api_version_list": ["2017-05-01-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -18,6 +18,12 @@ "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true } }, "async": { @@ -26,11 +32,17 @@ "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true } }, "constant": { }, - "call": "credential" + "call": "credential, subscription_id" }, "config": { "credential": true, diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py index 32bfe4c988873..bd4737e84fe55 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/_monitor_client.py @@ -17,7 +17,7 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import DiagnosticSettingsCategoryOperations from .operations import DiagnosticSettingsOperations from .operations import MetricDefinitionsOperations @@ -26,7 +26,7 @@ from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar diagnostic_settings_category: DiagnosticSettingsCategoryOperations operations @@ -41,24 +41,26 @@ class MonitorManagementClient(object): :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 subscription_id: The ID of the target subscription. + :type subscription_id: str :param str base_url: Service URL """ def __init__( self, credential, # type: "TokenCredential" + subscription_id, # type: str base_url=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.diagnostic_settings_category = DiagnosticSettingsCategoryOperations( @@ -77,7 +79,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py index 2db414bb10961..586e70bef5959 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_configuration.py @@ -18,26 +18,32 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 + :param subscription_id: The ID of the target subscription. + :type subscription_id: str """ def __init__( self, credential: "AsyncTokenCredential", + subscription_id: str, **kwargs: Any ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential + self.subscription_id = subscription_id self.api_version = "2017-05-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-monitor/{}'.format(VERSION)) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py index 61dc9b9b1aac7..a5aac63fcbe93 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/aio/_monitor_client.py @@ -15,7 +15,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import DiagnosticSettingsCategoryOperations from .operations import DiagnosticSettingsOperations from .operations import MetricDefinitionsOperations @@ -24,7 +24,7 @@ from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar diagnostic_settings_category: DiagnosticSettingsCategoryOperations operations @@ -39,23 +39,25 @@ class MonitorManagementClient(object): :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 subscription_id: The ID of the target subscription. + :type subscription_id: str :param str base_url: Service URL """ def __init__( self, credential: "AsyncTokenCredential", + subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.diagnostic_settings_category = DiagnosticSettingsCategoryOperations( @@ -72,7 +74,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self 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 index 8d38157011b2a..7a4503afc0843 100644 --- 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 @@ -42,14 +42,11 @@ def __init__(self, client, config, serializer, deserializer) -> None: 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 @@ -68,7 +65,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'name': self._serialize.url("name", name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -100,15 +97,12 @@ async def get( 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. @@ -130,7 +124,7 @@ async def create_or_update( # 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), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'name': self._serialize.url("name", name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -166,14 +160,11 @@ async def create_or_update( 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 @@ -192,7 +183,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'name': self._serialize.url("name", name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -221,13 +212,10 @@ async def delete( 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 @@ -244,7 +232,7 @@ async def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) 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 087885d528368..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 @@ -53,7 +53,7 @@ from ._models import SubscriptionProxyOnlyResource # type: ignore from ._models import TimeSeriesElement # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( AggregationType, CategoryType, ResultType, 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 1ab88ae839f49..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 @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class ProxyOnlyResource(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/models/_monitor_client_enums.py 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 index b8f0928e298b4..eb8d627fb6c7d 100644 --- 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 @@ -46,15 +46,12 @@ def __init__(self, client, config, serializer, deserializer): 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 @@ -73,7 +70,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'name': self._serialize.url("name", name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -105,7 +102,6 @@ def get( def create_or_update( self, - subscription_id, # type: str name, # type: str parameters, # type: "_models.SubscriptionDiagnosticSettingsResource" **kwargs # type: Any @@ -113,8 +109,6 @@ def create_or_update( # 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. @@ -136,7 +130,7 @@ def create_or_update( # 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), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'name': self._serialize.url("name", name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -172,15 +166,12 @@ def create_or_update( 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 @@ -199,7 +190,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'name': self._serialize.url("name", name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -228,14 +219,11 @@ def delete( 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 @@ -252,7 +240,7 @@ def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("subscription_id", subscription_id, 'str', skip_quote=True), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 294afff25011d..d0fb26233a4a8 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 @@ -20,8 +20,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -38,7 +38,7 @@ def __init__( # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2017-11-01-preview" 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 2ab7a7ecdf97e..032220920274e 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 @@ -2,14 +2,14 @@ "chosen_version": "2017-11-01-preview", "total_api_version_list": ["2017-11-01-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py index a2ab9af3b53c9..3c48248a52c13 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/_monitor_client.py @@ -17,12 +17,12 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import MetricBaselineOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar metric_baseline: MetricBaselineOperations operations @@ -41,12 +41,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.metric_baseline = MetricBaselineOperations( @@ -57,7 +56,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py index 6d9125dcdd75b..28b010a60fb59 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_configuration.py @@ -18,8 +18,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -35,7 +35,7 @@ def __init__( ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2017-11-01-preview" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_management_client.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_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client.py index 0c7128dc2c6d1..a34fecffc2872 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/_monitor_client.py @@ -15,12 +15,12 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import MetricBaselineOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar metric_baseline: MetricBaselineOperations operations @@ -38,12 +38,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.metric_baseline = MetricBaselineOperations( @@ -52,7 +51,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py index d4b82f738fea6..dcf2a8ffe0cce 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/aio/operations/_metric_baseline_operations.py @@ -127,7 +127,7 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/baseline/{metricName}'} # type: ignore + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/baseline/{metricName}'} # type: ignore async def calculate_baseline( self, @@ -193,4 +193,4 @@ async def calculate_baseline( return cls(pipeline_response, deserialized, {}) return deserialized - calculate_baseline.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/calculatebaseline'} # type: ignore + calculate_baseline.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/calculatebaseline'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/__init__.py index 6bd9d401e19d5..76219a2696ea7 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/__init__.py @@ -23,7 +23,7 @@ from ._models import LocalizableString # type: ignore from ._models import TimeSeriesInformation # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( ResultType, Sensitivity, ) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_models.py index ce966a8a01032..0b2aab63413b4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_models.py @@ -22,6 +22,8 @@ class Baseline(msrest.serialization.Model): :type low_thresholds: list[float] :param high_thresholds: Required. The high thresholds of the baseline. :type high_thresholds: list[float] + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[~datetime.datetime] """ _validation = { @@ -34,6 +36,7 @@ class Baseline(msrest.serialization.Model): 'sensitivity': {'key': 'sensitivity', 'type': 'str'}, 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, } def __init__( @@ -44,6 +47,7 @@ def __init__( self.sensitivity = kwargs['sensitivity'] self.low_thresholds = kwargs['low_thresholds'] self.high_thresholds = kwargs['high_thresholds'] + self.timestamps = kwargs.get('timestamps', None) class BaselineMetadataValue(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_models_py3.py index 595b15225092c..3f49d6e6bec29 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_models_py3.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class Baseline(msrest.serialization.Model): @@ -27,6 +27,8 @@ class Baseline(msrest.serialization.Model): :type low_thresholds: list[float] :param high_thresholds: Required. The high thresholds of the baseline. :type high_thresholds: list[float] + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[~datetime.datetime] """ _validation = { @@ -39,6 +41,7 @@ class Baseline(msrest.serialization.Model): 'sensitivity': {'key': 'sensitivity', 'type': 'str'}, 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, } def __init__( @@ -47,12 +50,14 @@ def __init__( sensitivity: Union[str, "Sensitivity"], low_thresholds: List[float], high_thresholds: List[float], + timestamps: Optional[List[datetime.datetime]] = None, **kwargs ): super(Baseline, self).__init__(**kwargs) self.sensitivity = sensitivity self.low_thresholds = low_thresholds self.high_thresholds = high_thresholds + self.timestamps = timestamps class BaselineMetadataValue(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_11_01_preview/models/_monitor_client_enums.py 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 1974d16f13c47..51ca70ad8cf35 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 @@ -132,7 +132,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/baseline/{metricName}'} # type: ignore + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/baseline/{metricName}'} # type: ignore def calculate_baseline( self, @@ -199,4 +199,4 @@ def calculate_baseline( return cls(pipeline_response, deserialized, {}) return deserialized - calculate_baseline.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/calculatebaseline'} # type: ignore + calculate_baseline.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/calculatebaseline'} # type: ignore 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 51f3be0f9102e..f791805e52f26 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 @@ -20,8 +20,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -38,7 +38,7 @@ def __init__( # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2017-12-01-preview" 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 f4feaa1b41d5f..90b18ede7f520 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 @@ -2,14 +2,14 @@ "chosen_version": "2017-12-01-preview", "total_api_version_list": ["2017-12-01-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py index 52d74ca8855f1..7dc3c6fcb82ec 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/_monitor_client.py @@ -17,12 +17,12 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import MetricNamespacesOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar metric_namespaces: MetricNamespacesOperations operations @@ -41,12 +41,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.metric_namespaces = MetricNamespacesOperations( @@ -57,7 +56,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py index b1944665bb4c2..00dc29134a32f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_configuration.py @@ -18,8 +18,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -35,7 +35,7 @@ def __init__( ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2017-12-01-preview" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_management_client.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_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client.py index 6aa7637f579ca..7371583d4223d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_12_01_preview/aio/_monitor_client.py @@ -15,12 +15,12 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import MetricNamespacesOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar metric_namespaces: MetricNamespacesOperations operations @@ -38,12 +38,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.metric_namespaces = MetricNamespacesOperations( @@ -52,7 +51,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 e27bbe464ee65..449982bc94c71 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 @@ -20,8 +20,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -38,7 +38,7 @@ def __init__( # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2018-01-01" 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 f2ee9c91c5daa..b4d69509a4328 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 @@ -2,14 +2,14 @@ "chosen_version": "2018-01-01", "total_api_version_list": ["2018-01-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py index 4426433aa4e4f..d49d26f76ec57 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/_monitor_client.py @@ -17,13 +17,13 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import MetricDefinitionsOperations from .operations import MetricsOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar metric_definitions: MetricDefinitionsOperations operations @@ -44,12 +44,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.metric_definitions = MetricDefinitionsOperations( @@ -62,7 +61,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py index bcfe5f45da24b..3357ffb00a13a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_configuration.py @@ -18,8 +18,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -35,7 +35,7 @@ def __init__( ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2018-01-01" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py index d35ab95edecf6..41b74d643867f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/aio/_monitor_client.py @@ -15,13 +15,13 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import MetricDefinitionsOperations from .operations import MetricsOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar metric_definitions: MetricDefinitionsOperations operations @@ -41,12 +41,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.metric_definitions = MetricDefinitionsOperations( @@ -57,7 +56,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/__init__.py index 5602c66d77af6..bf45cc3364e86 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/__init__.py @@ -29,7 +29,7 @@ from ._models import Response # type: ignore from ._models import TimeSeriesElement # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( AggregationType, ResultType, Unit, diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models_py3.py index 5b49d941a646d..ed8a10be7993d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_models_py3.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class ErrorResponse(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_01_01/models/_monitor_client_enums.py 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 c8591f1762c2e..718b0b39e1483 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 c4e4884f37a9d..e09c455355280 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 @@ -2,14 +2,14 @@ "chosen_version": "2018-03-01", "total_api_version_list": ["2018-03-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py index fd71e69c92ba8..354331be0fd19 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/_monitor_client.py @@ -17,14 +17,14 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from .operations import MetricAlertsOperations from .operations import MetricAlertsStatusOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations @@ -35,7 +35,7 @@ class MonitorManagementClient(object): :vartype metric_alerts_status: $(python-base-namespace).v2018_03_01.operations.MetricAlertsStatusOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -50,12 +50,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -70,7 +69,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py index 01b940070f935..1eaafa2d0ef38 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py index 85660a0938d79..c57af291d385b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/_monitor_client.py @@ -15,14 +15,14 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from .operations import MetricAlertsOperations from .operations import MetricAlertsStatusOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations @@ -33,7 +33,7 @@ class MonitorManagementClient(object): :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -47,12 +47,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -65,7 +64,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py index b5887d78df964..20fff72692cba 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_action_groups_operations.py @@ -75,7 +75,7 @@ async def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -142,7 +142,7 @@ async def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -201,7 +201,7 @@ async def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -259,7 +259,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -322,7 +322,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -393,7 +393,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -467,7 +467,7 @@ async def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py index f05312f25a402..bcb7ec9eb3cbd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_operations.py @@ -69,7 +69,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -139,7 +139,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -207,7 +207,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -270,7 +270,7 @@ async def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -337,7 +337,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -395,11 +395,12 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -411,6 +412,7 @@ async def delete( # 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) @@ -418,7 +420,8 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py index 8700d6231456b..5d54d2126dd11 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/aio/operations/_metric_alerts_status_operations.py @@ -68,7 +68,7 @@ async def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -130,7 +130,7 @@ async def list_by_name( # Construct URL url = self.list_by_name.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), 'statusName': self._serialize.url("status_name", status_name, 'str'), diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/__init__.py index 5c062c3233c5b..88e96542db434 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/__init__.py @@ -71,8 +71,8 @@ from ._models import WebhookReceiver # type: ignore from ._models import WebtestLocationAvailabilityCriteria # type: ignore -from ._monitor_management_client_enums import ( - AggregationType, +from ._monitor_client_enums import ( + AggregationTypeEnum, CriterionType, DynamicThresholdOperator, DynamicThresholdSensitivity, @@ -113,7 +113,7 @@ 'VoiceReceiver', 'WebhookReceiver', 'WebtestLocationAvailabilityCriteria', - 'AggregationType', + 'AggregationTypeEnum', 'CriterionType', 'DynamicThresholdOperator', 'DynamicThresholdSensitivity', 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 71bcd9cc55e57..7c599b4e16977 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 @@ -339,7 +339,7 @@ class MultiMetricCriteria(msrest.serialization.Model): :type metric_namespace: str :param time_aggregation: Required. the criteria time aggregation types. Possible values include: "Average", "Count", "Minimum", "Maximum", "Total". - :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType + :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationTypeEnum :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 @@ -403,7 +403,7 @@ class DynamicMetricCriteria(MultiMetricCriteria): :type metric_namespace: str :param time_aggregation: Required. the criteria time aggregation types. Possible values include: "Average", "Count", "Minimum", "Maximum", "Total". - :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType + :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationTypeEnum :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 @@ -673,7 +673,8 @@ class MetricAlertAction(msrest.serialization.Model): :param action_group_id: the id of the action group to use. :type action_group_id: str - :param web_hook_properties: The properties of a webhook object. + :param web_hook_properties: This field allows specifying custom properties, which would be + appended to the alert payload sent as input to the webhook. :type web_hook_properties: dict[str, str] """ @@ -786,14 +787,14 @@ class MetricAlertResource(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: Required. the description of the metric alert that will be included in the - alert email. + :param description: the description of the metric alert that will be included in the alert + email. :type description: str :param severity: Required. Alert severity {0, 1, 2, 3, 4}. :type severity: int :param enabled: Required. the flag that indicates whether the metric alert is enabled. :type enabled: bool - :param scopes: the list of resource id's that this metric alert is scoped to. + :param scopes: Required. the list of resource id's that this metric alert is scoped to. :type scopes: list[str] :param evaluation_frequency: Required. how often the metric alert is evaluated represented in ISO 8601 duration format. @@ -802,10 +803,12 @@ class MetricAlertResource(Resource): monitor alert activity based on the threshold. :type window_size: ~datetime.timedelta :param target_resource_type: the resource type of the target resource(s) on which the alert is - created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + created/updated. Mandatory if the scope contains a subscription, resource group, or more than + one resource. :type target_resource_type: str :param target_resource_region: the region of the target resource(s) on which the alert is - created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + created/updated. Mandatory if the scope contains a subscription, resource group, or more than + one resource. :type target_resource_region: str :param criteria: Required. defines the specific alert criteria information. :type criteria: ~$(python-base-namespace).v2018_03_01.models.MetricAlertCriteria @@ -817,6 +820,8 @@ class MetricAlertResource(Resource): :type actions: list[~$(python-base-namespace).v2018_03_01.models.MetricAlertAction] :ivar last_updated_time: Last time the rule was updated in ISO8601 format. :vartype last_updated_time: ~datetime.datetime + :ivar is_migrated: the value indicating whether this alert rule is migrated. + :vartype is_migrated: str """ _validation = { @@ -824,13 +829,14 @@ class MetricAlertResource(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'description': {'required': True}, 'severity': {'required': True}, 'enabled': {'required': True}, + 'scopes': {'required': True}, 'evaluation_frequency': {'required': True}, 'window_size': {'required': True}, 'criteria': {'required': True}, 'last_updated_time': {'readonly': True}, + 'is_migrated': {'readonly': True}, } _attribute_map = { @@ -851,6 +857,7 @@ class MetricAlertResource(Resource): 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, 'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'}, 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'is_migrated': {'key': 'properties.isMigrated', 'type': 'str'}, } def __init__( @@ -858,10 +865,10 @@ def __init__( **kwargs ): super(MetricAlertResource, self).__init__(**kwargs) - self.description = kwargs['description'] + self.description = kwargs.get('description', None) self.severity = kwargs['severity'] self.enabled = kwargs['enabled'] - self.scopes = kwargs.get('scopes', None) + self.scopes = kwargs['scopes'] self.evaluation_frequency = kwargs['evaluation_frequency'] self.window_size = kwargs['window_size'] self.target_resource_type = kwargs.get('target_resource_type', None) @@ -870,6 +877,7 @@ def __init__( self.auto_mitigate = kwargs.get('auto_mitigate', None) self.actions = kwargs.get('actions', None) self.last_updated_time = None + self.is_migrated = None class MetricAlertResourceCollection(msrest.serialization.Model): @@ -929,10 +937,13 @@ class MetricAlertResourcePatch(msrest.serialization.Model): :type actions: list[~$(python-base-namespace).v2018_03_01.models.MetricAlertAction] :ivar last_updated_time: Last time the rule was updated in ISO8601 format. :vartype last_updated_time: ~datetime.datetime + :ivar is_migrated: the value indicating whether this alert rule is migrated. + :vartype is_migrated: str """ _validation = { 'last_updated_time': {'readonly': True}, + 'is_migrated': {'readonly': True}, } _attribute_map = { @@ -949,6 +960,7 @@ class MetricAlertResourcePatch(msrest.serialization.Model): 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, 'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'}, 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'is_migrated': {'key': 'properties.isMigrated', 'type': 'str'}, } def __init__( @@ -969,6 +981,7 @@ def __init__( self.auto_mitigate = kwargs.get('auto_mitigate', None) self.actions = kwargs.get('actions', None) self.last_updated_time = None + self.is_migrated = None class MetricAlertSingleResourceMultipleMetricCriteria(MetricAlertCriteria): @@ -1104,7 +1117,7 @@ class MetricCriteria(MultiMetricCriteria): :type metric_namespace: str :param time_aggregation: Required. the criteria time aggregation types. Possible values include: "Average", "Count", "Minimum", "Maximum", "Total". - :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType + :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationTypeEnum :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 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 ae64742a6783a..1d7b63e41a64e 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 @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class ActionGroupList(msrest.serialization.Model): @@ -382,7 +382,7 @@ class MultiMetricCriteria(msrest.serialization.Model): :type metric_namespace: str :param time_aggregation: Required. the criteria time aggregation types. Possible values include: "Average", "Count", "Minimum", "Maximum", "Total". - :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType + :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationTypeEnum :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 @@ -417,7 +417,7 @@ def __init__( *, name: str, metric_name: str, - time_aggregation: Union[str, "AggregationType"], + time_aggregation: Union[str, "AggregationTypeEnum"], additional_properties: Optional[Dict[str, object]] = None, metric_namespace: Optional[str] = None, dimensions: Optional[List["MetricDimension"]] = None, @@ -454,7 +454,7 @@ class DynamicMetricCriteria(MultiMetricCriteria): :type metric_namespace: str :param time_aggregation: Required. the criteria time aggregation types. Possible values include: "Average", "Count", "Minimum", "Maximum", "Total". - :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType + :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationTypeEnum :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 @@ -507,7 +507,7 @@ def __init__( *, name: str, metric_name: str, - time_aggregation: Union[str, "AggregationType"], + time_aggregation: Union[str, "AggregationTypeEnum"], operator: Union[str, "DynamicThresholdOperator"], alert_sensitivity: Union[str, "DynamicThresholdSensitivity"], failing_periods: "DynamicThresholdFailingPeriods", @@ -757,7 +757,8 @@ class MetricAlertAction(msrest.serialization.Model): :param action_group_id: the id of the action group to use. :type action_group_id: str - :param web_hook_properties: The properties of a webhook object. + :param web_hook_properties: This field allows specifying custom properties, which would be + appended to the alert payload sent as input to the webhook. :type web_hook_properties: dict[str, str] """ @@ -878,14 +879,14 @@ class MetricAlertResource(Resource): :type location: str :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param description: Required. the description of the metric alert that will be included in the - alert email. + :param description: the description of the metric alert that will be included in the alert + email. :type description: str :param severity: Required. Alert severity {0, 1, 2, 3, 4}. :type severity: int :param enabled: Required. the flag that indicates whether the metric alert is enabled. :type enabled: bool - :param scopes: the list of resource id's that this metric alert is scoped to. + :param scopes: Required. the list of resource id's that this metric alert is scoped to. :type scopes: list[str] :param evaluation_frequency: Required. how often the metric alert is evaluated represented in ISO 8601 duration format. @@ -894,10 +895,12 @@ class MetricAlertResource(Resource): monitor alert activity based on the threshold. :type window_size: ~datetime.timedelta :param target_resource_type: the resource type of the target resource(s) on which the alert is - created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + created/updated. Mandatory if the scope contains a subscription, resource group, or more than + one resource. :type target_resource_type: str :param target_resource_region: the region of the target resource(s) on which the alert is - created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. + created/updated. Mandatory if the scope contains a subscription, resource group, or more than + one resource. :type target_resource_region: str :param criteria: Required. defines the specific alert criteria information. :type criteria: ~$(python-base-namespace).v2018_03_01.models.MetricAlertCriteria @@ -909,6 +912,8 @@ class MetricAlertResource(Resource): :type actions: list[~$(python-base-namespace).v2018_03_01.models.MetricAlertAction] :ivar last_updated_time: Last time the rule was updated in ISO8601 format. :vartype last_updated_time: ~datetime.datetime + :ivar is_migrated: the value indicating whether this alert rule is migrated. + :vartype is_migrated: str """ _validation = { @@ -916,13 +921,14 @@ class MetricAlertResource(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'description': {'required': True}, 'severity': {'required': True}, 'enabled': {'required': True}, + 'scopes': {'required': True}, 'evaluation_frequency': {'required': True}, 'window_size': {'required': True}, 'criteria': {'required': True}, 'last_updated_time': {'readonly': True}, + 'is_migrated': {'readonly': True}, } _attribute_map = { @@ -943,20 +949,21 @@ class MetricAlertResource(Resource): 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, 'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'}, 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'is_migrated': {'key': 'properties.isMigrated', 'type': 'str'}, } def __init__( self, *, location: str, - description: str, severity: int, enabled: bool, + scopes: List[str], evaluation_frequency: datetime.timedelta, window_size: datetime.timedelta, criteria: "MetricAlertCriteria", tags: Optional[Dict[str, str]] = None, - scopes: Optional[List[str]] = None, + description: Optional[str] = None, target_resource_type: Optional[str] = None, target_resource_region: Optional[str] = None, auto_mitigate: Optional[bool] = None, @@ -976,6 +983,7 @@ def __init__( self.auto_mitigate = auto_mitigate self.actions = actions self.last_updated_time = None + self.is_migrated = None class MetricAlertResourceCollection(msrest.serialization.Model): @@ -1037,10 +1045,13 @@ class MetricAlertResourcePatch(msrest.serialization.Model): :type actions: list[~$(python-base-namespace).v2018_03_01.models.MetricAlertAction] :ivar last_updated_time: Last time the rule was updated in ISO8601 format. :vartype last_updated_time: ~datetime.datetime + :ivar is_migrated: the value indicating whether this alert rule is migrated. + :vartype is_migrated: str """ _validation = { 'last_updated_time': {'readonly': True}, + 'is_migrated': {'readonly': True}, } _attribute_map = { @@ -1057,6 +1068,7 @@ class MetricAlertResourcePatch(msrest.serialization.Model): 'auto_mitigate': {'key': 'properties.autoMitigate', 'type': 'bool'}, 'actions': {'key': 'properties.actions', 'type': '[MetricAlertAction]'}, 'last_updated_time': {'key': 'properties.lastUpdatedTime', 'type': 'iso-8601'}, + 'is_migrated': {'key': 'properties.isMigrated', 'type': 'str'}, } def __init__( @@ -1090,6 +1102,7 @@ def __init__( self.auto_mitigate = auto_mitigate self.actions = actions self.last_updated_time = None + self.is_migrated = None class MetricAlertSingleResourceMultipleMetricCriteria(MetricAlertCriteria): @@ -1239,7 +1252,7 @@ class MetricCriteria(MultiMetricCriteria): :type metric_namespace: str :param time_aggregation: Required. the criteria time aggregation types. Possible values include: "Average", "Count", "Minimum", "Maximum", "Total". - :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationType + :type time_aggregation: str or ~$(python-base-namespace).v2018_03_01.models.AggregationTypeEnum :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 @@ -1279,7 +1292,7 @@ def __init__( *, name: str, metric_name: str, - time_aggregation: Union[str, "AggregationType"], + time_aggregation: Union[str, "AggregationTypeEnum"], operator: Union[str, "Operator"], threshold: float, additional_properties: Optional[Dict[str, object]] = None, diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_client_enums.py similarity index 97% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_client_enums.py index 974c2895a8cb3..8e62d4320379b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_management_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_03_01/models/_monitor_client_enums.py @@ -26,7 +26,7 @@ def __getattr__(cls, name): raise AttributeError(name) -class AggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class AggregationTypeEnum(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """the criteria time aggregation types. """ 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 3bf283074e85f..2136919981569 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 @@ -80,7 +80,7 @@ def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -148,7 +148,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -208,7 +208,7 @@ def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -267,7 +267,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -331,7 +331,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -403,7 +403,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -478,7 +478,7 @@ def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) 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 497d473da137a..4fa5737e2e213 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 @@ -74,7 +74,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -145,7 +145,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -214,7 +214,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -278,7 +278,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -346,7 +346,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -405,11 +405,12 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) api_version = "2018-03-01" + accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -421,6 +422,7 @@ def delete( # 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) @@ -428,7 +430,8 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) 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 82aa2f529a36c..2741282189ff3 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 @@ -73,7 +73,7 @@ def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -136,7 +136,7 @@ def list_by_name( # Construct URL url = self.list_by_name.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), 'statusName': self._serialize.url("status_name", status_name, 'str'), 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 93b3c96a4a307..57c1f46a36c58 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 391f8c05034da..09db871cd6ac0 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 @@ -2,14 +2,14 @@ "chosen_version": "2018-04-16", "total_api_version_list": ["2018-04-16"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py similarity index 86% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py index 775dcebb84e46..a792f5f4a951a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/_monitor_client.py @@ -17,19 +17,19 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ScheduledQueryRulesOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar scheduled_query_rules: ScheduledQueryRulesOperations operations :vartype scheduled_query_rules: $(python-base-namespace).v2018_04_16.operations.ScheduledQueryRulesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -44,12 +44,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.scheduled_query_rules = ScheduledQueryRulesOperations( @@ -60,7 +59,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py index 621208fc53b3f..e84103f20bf38 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py similarity index 85% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py index 72801e36fa29a..b6702dcf88bfb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/_monitor_client.py @@ -15,19 +15,19 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ScheduledQueryRulesOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar scheduled_query_rules: ScheduledQueryRulesOperations operations :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -41,12 +41,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.scheduled_query_rules = ScheduledQueryRulesOperations( @@ -55,7 +54,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py index 655f208582878..f71ebee3eeb6f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/aio/operations/_scheduled_query_rules_operations.py @@ -73,7 +73,7 @@ async def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -142,7 +142,7 @@ async def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -203,7 +203,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -268,7 +268,7 @@ async def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -326,7 +326,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -403,7 +403,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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 2d034d8b31165..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 @@ -39,7 +39,7 @@ from ._models import Source # type: ignore from ._models import TriggerCondition # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( AlertSeverity, ConditionalOperator, Enabled, 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 97978ed148539..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 @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class Action(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_04_16/models/_monitor_client_enums.py 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 63d29f5e963f9..2798b4ace5f31 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 @@ -78,7 +78,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -148,7 +148,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -210,7 +210,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -276,7 +276,7 @@ def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -335,7 +335,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -413,7 +413,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 3dfeecfa782b7..5d0e9fab4ebe7 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 61819c227554e..3fb8560e260d9 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 @@ -2,14 +2,14 @@ "chosen_version": "2018-06-01-preview", "total_api_version_list": ["2018-06-01-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py index dd2026fed6b0d..16554184d341d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/_monitor_client.py @@ -17,13 +17,13 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import GuestDiagnosticsSettingsAssociationOperations from .operations import GuestDiagnosticsSettingsOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar guest_diagnostics_settings_association: GuestDiagnosticsSettingsAssociationOperations operations @@ -32,7 +32,7 @@ class MonitorManagementClient(object): :vartype guest_diagnostics_settings: $(python-base-namespace).v2018_06_01_preview.operations.GuestDiagnosticsSettingsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -47,12 +47,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.guest_diagnostics_settings_association = GuestDiagnosticsSettingsAssociationOperations( @@ -65,7 +64,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py index 0a08001c004ef..969801767a013 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py index fe83fe02be0cd..bd0486fad72fc 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/_monitor_client.py @@ -15,13 +15,13 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import GuestDiagnosticsSettingsAssociationOperations from .operations import GuestDiagnosticsSettingsOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar guest_diagnostics_settings_association: GuestDiagnosticsSettingsAssociationOperations operations @@ -30,7 +30,7 @@ class MonitorManagementClient(object): :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -44,12 +44,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.guest_diagnostics_settings_association = GuestDiagnosticsSettingsAssociationOperations( @@ -60,7 +59,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py index 176032de5bc6f..6050896e0fac2 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_association_operations.py @@ -324,7 +324,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -395,7 +395,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py index a9b8d306d9e59..0f36472724cf8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/aio/operations/_guest_diagnostics_settings_operations.py @@ -75,7 +75,7 @@ async def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'diagnosticSettingsName': self._serialize.url("diagnostic_settings_name", diagnostic_settings_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -142,7 +142,7 @@ async def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'diagnosticSettingsName': self._serialize.url("diagnostic_settings_name", diagnostic_settings_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -205,7 +205,7 @@ async def update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'diagnosticSettingsName': self._serialize.url("diagnostic_settings_name", diagnostic_settings_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -272,7 +272,7 @@ async def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'diagnosticSettingsName': self._serialize.url("diagnostic_settings_name", diagnostic_settings_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -326,7 +326,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -397,7 +397,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/__init__.py index 1dab1d930479d..447d789e73d01 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/__init__.py @@ -39,7 +39,7 @@ from ._models import Resource # type: ignore from ._models import SinkConfiguration # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( DataSourceKind, GuestDiagnosticSettingsOsType, SinkConfigurationKind, diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_models_py3.py index 15c655c3ba32f..25e58f8f957dd 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_models_py3.py @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class DataSource(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_06_01_preview/models/_monitor_client_enums.py 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 2c977cb690f05..d312dee8235e2 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 @@ -333,7 +333,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -405,7 +405,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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 1e45f3485e868..8fd1f62c36cab 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 @@ -80,7 +80,7 @@ def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'diagnosticSettingsName': self._serialize.url("diagnostic_settings_name", diagnostic_settings_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -148,7 +148,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'diagnosticSettingsName': self._serialize.url("diagnostic_settings_name", diagnostic_settings_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -212,7 +212,7 @@ def update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'diagnosticSettingsName': self._serialize.url("diagnostic_settings_name", diagnostic_settings_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -280,7 +280,7 @@ def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'diagnosticSettingsName': self._serialize.url("diagnostic_settings_name", diagnostic_settings_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -335,7 +335,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -407,7 +407,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 ed38a6efebf48..7713d61e810de 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 16f8f621713d7..05aa3b6b3093e 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 @@ -2,14 +2,14 @@ "chosen_version": "2018-09-01", "total_api_version_list": ["2018-09-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -54,7 +54,8 @@ "operation_groups": { "action_groups": "ActionGroupsOperations", "metric_baseline": "MetricBaselineOperations", - "baseline": "BaselineOperations" + "baseline": "BaselineOperations", + "baselines": "BaselinesOperations" }, "operation_mixins": { }, diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py similarity index 83% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py index cd65097c83547..5e4c4090386f9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/_monitor_client.py @@ -17,14 +17,15 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from .operations import MetricBaselineOperations from .operations import BaselineOperations +from .operations import BaselinesOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations @@ -33,9 +34,11 @@ class MonitorManagementClient(object): :vartype metric_baseline: $(python-base-namespace).v2018_09_01.operations.MetricBaselineOperations :ivar baseline: BaselineOperations operations :vartype baseline: $(python-base-namespace).v2018_09_01.operations.BaselineOperations + :ivar baselines: BaselinesOperations operations + :vartype baselines: $(python-base-namespace).v2018_09_01.operations.BaselinesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -50,12 +53,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -64,13 +66,15 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.baseline = BaselineOperations( self._client, self._config, self._serialize, self._deserialize) + self.baselines = BaselinesOperations( + self._client, self._config, self._serialize, self._deserialize) def close(self): # type: () -> None self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py index 003ad367aa619..2999ac5f0c4f9 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py similarity index 82% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py index b4c6c5e5f83a2..f690281710f9c 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/_monitor_client.py @@ -15,14 +15,15 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from .operations import MetricBaselineOperations from .operations import BaselineOperations +from .operations import BaselinesOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations @@ -31,9 +32,11 @@ class MonitorManagementClient(object): :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.BaselineOperations + :ivar baselines: BaselinesOperations operations + :vartype baselines: $(python-base-namespace).v2018_09_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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -47,12 +50,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -61,11 +63,13 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.baseline = BaselineOperations( self._client, self._config, self._serialize, self._deserialize) + self.baselines = BaselinesOperations( + self._client, self._config, self._serialize, self._deserialize) async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/__init__.py index 636f48f0362a0..1b1612af9bd2f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/__init__.py @@ -9,9 +9,11 @@ from ._action_groups_operations import ActionGroupsOperations from ._metric_baseline_operations import MetricBaselineOperations from ._baseline_operations import BaselineOperations +from ._baselines_operations import BaselinesOperations __all__ = [ 'ActionGroupsOperations', 'MetricBaselineOperations', 'BaselineOperations', + 'BaselinesOperations', ] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py index 784c2646f6e52..0a47034cd1b91 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_action_groups_operations.py @@ -75,7 +75,7 @@ async def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -142,7 +142,7 @@ async def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -201,7 +201,7 @@ async def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -259,7 +259,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -322,7 +322,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -393,7 +393,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -467,7 +467,7 @@ async def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py index 2e13edf2f29d0..7f16e9be2a851 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baseline_operations.py @@ -139,4 +139,4 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/baseline'} # type: ignore + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/baseline'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baselines_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baselines_operations.py new file mode 100644 index 0000000000000..6fcec58fd8967 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_baselines_operations.py @@ -0,0 +1,163 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +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 as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class BaselinesOperations: + """BaselinesOperations 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).v2018_09_01.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 + + def list( + self, + resource_uri: str, + metricnames: Optional[str] = None, + metricnamespace: Optional[str] = None, + timespan: Optional[str] = None, + interval: Optional[datetime.timedelta] = None, + aggregation: Optional[str] = None, + sensitivities: Optional[str] = None, + filter: Optional[str] = None, + result_type: Optional[Union[str, "_models.ResultType"]] = None, + **kwargs + ) -> AsyncIterable["_models.MetricBaselinesResponse"]: + """**Lists the metric baseline values for a resource**. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param metricnames: The names of the metrics (comma separated) to retrieve. + :type metricnames: str + :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'. + :type timespan: str + :param interval: The interval (i.e. timegrain) of the query. + :type interval: ~datetime.timedelta + :param aggregation: The list of aggregation types (comma separated) to retrieve. + :type aggregation: str + :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 ‘*\ ’**. + :type filter: str + :param result_type: Allows retrieving only metadata of the baseline. On data request all + information is retrieved. + :type result_type: str or ~$(python-base-namespace).v2018_09_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) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~$(python-base-namespace).v2018_09_01.models.MetricBaselinesResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricBaselinesResponse"] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if metricnames is not None: + query_parameters['metricnames'] = self._serialize.query("metricnames", metricnames, 'str') + if metricnamespace is not None: + query_parameters['metricnamespace'] = self._serialize.query("metricnamespace", metricnamespace, 'str') + if timespan is not None: + query_parameters['timespan'] = self._serialize.query("timespan", timespan, 'str') + if interval is not None: + query_parameters['interval'] = self._serialize.query("interval", interval, 'duration') + if aggregation is not None: + query_parameters['aggregation'] = self._serialize.query("aggregation", aggregation, 'str') + if sensitivities is not None: + query_parameters['sensitivities'] = self._serialize.query("sensitivities", sensitivities, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if result_type is not 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] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MetricBaselinesResponse', 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': '/{resourceUri}/providers/Microsoft.Insights/metricBaselines'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py index cf63e10acad95..8f208124673b8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/aio/operations/_metric_baseline_operations.py @@ -138,7 +138,7 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/baseline/{metricName}'} # type: ignore + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/baseline/{metricName}'} # type: ignore async def calculate_baseline( self, @@ -204,4 +204,4 @@ async def calculate_baseline( return cls(pipeline_response, deserialized, {}) return deserialized - calculate_baseline.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/calculatebaseline'} # type: ignore + calculate_baseline.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/calculatebaseline'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/__init__.py index fcd33d0536b55..0393f38f211df 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/__init__.py @@ -15,17 +15,24 @@ from ._models_py3 import AzureAppPushReceiver from ._models_py3 import AzureFunctionReceiver from ._models_py3 import Baseline + from ._models_py3 import BaselineMetadata from ._models_py3 import BaselineMetadataValue from ._models_py3 import BaselineResponse from ._models_py3 import CalculateBaselineResponse + from ._models_py3 import CalculateBaselineResponseStatistics from ._models_py3 import EmailReceiver from ._models_py3 import EnableRequest from ._models_py3 import ErrorResponse from ._models_py3 import ItsmReceiver from ._models_py3 import LocalizableString from ._models_py3 import LogicAppReceiver + from ._models_py3 import MetricBaselinesResponse + from ._models_py3 import MetricSingleDimension from ._models_py3 import Resource + from ._models_py3 import SingleBaseline + from ._models_py3 import SingleMetricBaseline from ._models_py3 import SmsReceiver + from ._models_py3 import TimeSeriesBaseline from ._models_py3 import TimeSeriesInformation from ._models_py3 import VoiceReceiver from ._models_py3 import WebhookReceiver @@ -38,22 +45,30 @@ from ._models import AzureAppPushReceiver # type: ignore from ._models import AzureFunctionReceiver # type: ignore from ._models import Baseline # type: ignore + from ._models import BaselineMetadata # type: ignore from ._models import BaselineMetadataValue # type: ignore from ._models import BaselineResponse # type: ignore from ._models import CalculateBaselineResponse # type: ignore + from ._models import CalculateBaselineResponseStatistics # type: ignore from ._models import EmailReceiver # type: ignore from ._models import EnableRequest # type: ignore from ._models import ErrorResponse # type: ignore from ._models import ItsmReceiver # type: ignore from ._models import LocalizableString # type: ignore from ._models import LogicAppReceiver # type: ignore + from ._models import MetricBaselinesResponse # type: ignore + from ._models import MetricSingleDimension # type: ignore from ._models import Resource # type: ignore + from ._models import SingleBaseline # type: ignore + from ._models import SingleMetricBaseline # type: ignore from ._models import SmsReceiver # type: ignore + from ._models import TimeSeriesBaseline # type: ignore from ._models import TimeSeriesInformation # type: ignore from ._models import VoiceReceiver # type: ignore from ._models import WebhookReceiver # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( + BaselineSensitivity, ReceiverStatus, ResultType, Sensitivity, @@ -68,20 +83,28 @@ 'AzureAppPushReceiver', 'AzureFunctionReceiver', 'Baseline', + 'BaselineMetadata', 'BaselineMetadataValue', 'BaselineResponse', 'CalculateBaselineResponse', + 'CalculateBaselineResponseStatistics', 'EmailReceiver', 'EnableRequest', 'ErrorResponse', 'ItsmReceiver', 'LocalizableString', 'LogicAppReceiver', + 'MetricBaselinesResponse', + 'MetricSingleDimension', 'Resource', + 'SingleBaseline', + 'SingleMetricBaseline', 'SmsReceiver', + 'TimeSeriesBaseline', 'TimeSeriesInformation', 'VoiceReceiver', 'WebhookReceiver', + 'BaselineSensitivity', 'ReceiverStatus', 'ResultType', 'Sensitivity', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_models.py index 8ffeb77fca187..ba81b85da5194 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_models.py @@ -365,6 +365,8 @@ class Baseline(msrest.serialization.Model): :type low_thresholds: list[float] :param high_thresholds: Required. The high thresholds of the baseline. :type high_thresholds: list[float] + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[~datetime.datetime] """ _validation = { @@ -377,6 +379,7 @@ class Baseline(msrest.serialization.Model): 'sensitivity': {'key': 'sensitivity', 'type': 'str'}, 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, } def __init__( @@ -387,6 +390,37 @@ def __init__( self.sensitivity = kwargs['sensitivity'] self.low_thresholds = kwargs['low_thresholds'] self.high_thresholds = kwargs['high_thresholds'] + self.timestamps = kwargs.get('timestamps', None) + + +class BaselineMetadata(msrest.serialization.Model): + """Represents a baseline metadata value. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the baseline metadata. + :type name: str + :param value: Required. Value of the baseline metadata. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(BaselineMetadata, self).__init__(**kwargs) + self.name = kwargs['name'] + self.value = kwargs['value'] class BaselineMetadataValue(msrest.serialization.Model): @@ -478,6 +512,8 @@ def __init__( class CalculateBaselineResponse(msrest.serialization.Model): """The response to a calculate baseline call. + 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 type: Required. The resource type of the baseline resource. @@ -486,17 +522,25 @@ class CalculateBaselineResponse(msrest.serialization.Model): :type timestamps: list[~datetime.datetime] :param baseline: Required. The baseline values for each sensitivity. :type baseline: list[~$(python-base-namespace).v2018_09_01.models.Baseline] + :param statistics: The statistics. + :type statistics: ~$(python-base- + namespace).v2018_09_01.models.CalculateBaselineResponseStatistics + :ivar internal_operation_id: internal operation id. + :vartype internal_operation_id: str """ _validation = { 'type': {'required': True}, 'baseline': {'required': True}, + 'internal_operation_id': {'readonly': True}, } _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, 'baseline': {'key': 'baseline', 'type': '[Baseline]'}, + 'statistics': {'key': 'statistics', 'type': 'CalculateBaselineResponseStatistics'}, + 'internal_operation_id': {'key': 'internalOperationId', 'type': 'str'}, } def __init__( @@ -507,6 +551,35 @@ def __init__( self.type = kwargs['type'] self.timestamps = kwargs.get('timestamps', None) self.baseline = kwargs['baseline'] + self.statistics = kwargs.get('statistics', None) + self.internal_operation_id = None + + +class CalculateBaselineResponseStatistics(msrest.serialization.Model): + """The statistics. + + :param is_eligible: is series eligible for dynamic threshold analysis. + :type is_eligible: bool + :param status: The list of extended status for calculating the baseline. + :type status: list[str] + :param seasonality_period: The seasonality period for calculating the baseline. + :type seasonality_period: int + """ + + _attribute_map = { + 'is_eligible': {'key': 'isEligible', 'type': 'bool'}, + 'status': {'key': 'status', 'type': '[str]'}, + 'seasonality_period': {'key': 'seasonalityPeriod', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(CalculateBaselineResponseStatistics, self).__init__(**kwargs) + self.is_eligible = kwargs.get('is_eligible', None) + self.status = kwargs.get('status', None) + self.seasonality_period = kwargs.get('seasonality_period', None) class EmailReceiver(msrest.serialization.Model): @@ -710,6 +783,154 @@ def __init__( self.callback_url = kwargs['callback_url'] +class MetricBaselinesResponse(msrest.serialization.Model): + """A list of metric baselines. + + All required parameters must be populated in order to send to Azure. + + :param timespan: Required. The timespan for which the data was retrieved. Its value consists of + two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned + back from what was originally requested. + :type timespan: str + :param interval: Required. The interval (window size) for which the metric data was returned + in. This may be adjusted in the future and returned back from what was originally requested. + This is not present if a metadata request was made. + :type interval: ~datetime.timedelta + :param namespace: The namespace of the metrics been queried. + :type namespace: str + :param value: The baseline for each time series that was queried. + :type value: list[~$(python-base-namespace).v2018_09_01.models.SingleMetricBaseline] + """ + + _validation = { + 'timespan': {'required': True}, + 'interval': {'required': True}, + } + + _attribute_map = { + 'timespan': {'key': 'timespan', 'type': 'str'}, + 'interval': {'key': 'interval', 'type': 'duration'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[SingleMetricBaseline]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricBaselinesResponse, self).__init__(**kwargs) + self.timespan = kwargs['timespan'] + self.interval = kwargs['interval'] + self.namespace = kwargs.get('namespace', None) + self.value = kwargs.get('value', None) + + +class MetricSingleDimension(msrest.serialization.Model): + """The metric dimension name and value. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the dimension. + :type name: str + :param value: Required. Value of the dimension. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSingleDimension, self).__init__(**kwargs) + self.name = kwargs['name'] + self.value = kwargs['value'] + + +class SingleBaseline(msrest.serialization.Model): + """The baseline values for a single sensitivity value. + + All required parameters must be populated in order to send to Azure. + + :param sensitivity: Required. the sensitivity of the baseline. Possible values include: "Low", + "Medium", "High". + :type sensitivity: str or ~$(python-base-namespace).v2018_09_01.models.BaselineSensitivity + :param low_thresholds: Required. The low thresholds of the baseline. + :type low_thresholds: list[float] + :param high_thresholds: Required. The high thresholds of the baseline. + :type high_thresholds: list[float] + """ + + _validation = { + 'sensitivity': {'required': True}, + 'low_thresholds': {'required': True}, + 'high_thresholds': {'required': True}, + } + + _attribute_map = { + 'sensitivity': {'key': 'sensitivity', 'type': 'str'}, + 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, + 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + } + + def __init__( + self, + **kwargs + ): + super(SingleBaseline, self).__init__(**kwargs) + self.sensitivity = kwargs['sensitivity'] + self.low_thresholds = kwargs['low_thresholds'] + self.high_thresholds = kwargs['high_thresholds'] + + +class SingleMetricBaseline(msrest.serialization.Model): + """The baseline results of a single metric. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The metric baseline Id. + :type id: str + :param type: Required. The resource type of the metric baseline resource. + :type type: str + :param metric_name: Required. The name of the metric for which the baselines were retrieved. + :type metric_name: str + :param baselines: Required. The baseline for each time series that was queried. + :type baselines: list[~$(python-base-namespace).v2018_09_01.models.TimeSeriesBaseline] + """ + + _validation = { + 'id': {'required': True}, + 'type': {'required': True}, + 'metric_name': {'required': True}, + 'baselines': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'baselines': {'key': 'baselines', 'type': '[TimeSeriesBaseline]'}, + } + + def __init__( + self, + **kwargs + ): + super(SingleMetricBaseline, self).__init__(**kwargs) + self.id = kwargs['id'] + self.type = kwargs['type'] + self.metric_name = kwargs['metric_name'] + self.baselines = kwargs['baselines'] + + class SmsReceiver(msrest.serialization.Model): """An SMS receiver. @@ -754,6 +975,49 @@ def __init__( self.status = None +class TimeSeriesBaseline(msrest.serialization.Model): + """The baseline values for a single time series. + + All required parameters must be populated in order to send to Azure. + + :param aggregation: Required. The aggregation type of the metric. + :type aggregation: str + :param dimensions: The dimensions of this time series. + :type dimensions: list[~$(python-base-namespace).v2018_09_01.models.MetricSingleDimension] + :param timestamps: Required. The list of timestamps of the baselines. + :type timestamps: list[~datetime.datetime] + :param data: Required. The baseline values for each sensitivity. + :type data: list[~$(python-base-namespace).v2018_09_01.models.SingleBaseline] + :param metadata_values: The baseline metadata values. + :type metadata_values: list[~$(python-base-namespace).v2018_09_01.models.BaselineMetadata] + """ + + _validation = { + 'aggregation': {'required': True}, + 'timestamps': {'required': True}, + 'data': {'required': True}, + } + + _attribute_map = { + 'aggregation': {'key': 'aggregation', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricSingleDimension]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, + 'data': {'key': 'data', 'type': '[SingleBaseline]'}, + 'metadata_values': {'key': 'metadataValues', 'type': '[BaselineMetadata]'}, + } + + def __init__( + self, + **kwargs + ): + super(TimeSeriesBaseline, self).__init__(**kwargs) + self.aggregation = kwargs['aggregation'] + self.dimensions = kwargs.get('dimensions', None) + self.timestamps = kwargs['timestamps'] + self.data = kwargs['data'] + self.metadata_values = kwargs.get('metadata_values', None) + + class TimeSeriesInformation(msrest.serialization.Model): """The time series info needed for calculating the baseline. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_models_py3.py index fcd6b542c2ca8..977eab34fec91 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_models_py3.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class ActionGroupList(msrest.serialization.Model): @@ -412,6 +412,8 @@ class Baseline(msrest.serialization.Model): :type low_thresholds: list[float] :param high_thresholds: Required. The high thresholds of the baseline. :type high_thresholds: list[float] + :param timestamps: the array of timestamps of the baselines. + :type timestamps: list[~datetime.datetime] """ _validation = { @@ -424,6 +426,7 @@ class Baseline(msrest.serialization.Model): 'sensitivity': {'key': 'sensitivity', 'type': 'str'}, 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, } def __init__( @@ -432,12 +435,47 @@ def __init__( sensitivity: Union[str, "Sensitivity"], low_thresholds: List[float], high_thresholds: List[float], + timestamps: Optional[List[datetime.datetime]] = None, **kwargs ): super(Baseline, self).__init__(**kwargs) self.sensitivity = sensitivity self.low_thresholds = low_thresholds self.high_thresholds = high_thresholds + self.timestamps = timestamps + + +class BaselineMetadata(msrest.serialization.Model): + """Represents a baseline metadata value. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the baseline metadata. + :type name: str + :param value: Required. Value of the baseline metadata. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + value: str, + **kwargs + ): + super(BaselineMetadata, self).__init__(**kwargs) + self.name = name + self.value = value class BaselineMetadataValue(msrest.serialization.Model): @@ -539,6 +577,8 @@ def __init__( class CalculateBaselineResponse(msrest.serialization.Model): """The response to a calculate baseline call. + 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 type: Required. The resource type of the baseline resource. @@ -547,17 +587,25 @@ class CalculateBaselineResponse(msrest.serialization.Model): :type timestamps: list[~datetime.datetime] :param baseline: Required. The baseline values for each sensitivity. :type baseline: list[~$(python-base-namespace).v2018_09_01.models.Baseline] + :param statistics: The statistics. + :type statistics: ~$(python-base- + namespace).v2018_09_01.models.CalculateBaselineResponseStatistics + :ivar internal_operation_id: internal operation id. + :vartype internal_operation_id: str """ _validation = { 'type': {'required': True}, 'baseline': {'required': True}, + 'internal_operation_id': {'readonly': True}, } _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, 'baseline': {'key': 'baseline', 'type': '[Baseline]'}, + 'statistics': {'key': 'statistics', 'type': 'CalculateBaselineResponseStatistics'}, + 'internal_operation_id': {'key': 'internalOperationId', 'type': 'str'}, } def __init__( @@ -566,12 +614,46 @@ def __init__( type: str, baseline: List["Baseline"], timestamps: Optional[List[datetime.datetime]] = None, + statistics: Optional["CalculateBaselineResponseStatistics"] = None, **kwargs ): super(CalculateBaselineResponse, self).__init__(**kwargs) self.type = type self.timestamps = timestamps self.baseline = baseline + self.statistics = statistics + self.internal_operation_id = None + + +class CalculateBaselineResponseStatistics(msrest.serialization.Model): + """The statistics. + + :param is_eligible: is series eligible for dynamic threshold analysis. + :type is_eligible: bool + :param status: The list of extended status for calculating the baseline. + :type status: list[str] + :param seasonality_period: The seasonality period for calculating the baseline. + :type seasonality_period: int + """ + + _attribute_map = { + 'is_eligible': {'key': 'isEligible', 'type': 'bool'}, + 'status': {'key': 'status', 'type': '[str]'}, + 'seasonality_period': {'key': 'seasonalityPeriod', 'type': 'int'}, + } + + def __init__( + self, + *, + is_eligible: Optional[bool] = None, + status: Optional[List[str]] = None, + seasonality_period: Optional[int] = None, + **kwargs + ): + super(CalculateBaselineResponseStatistics, self).__init__(**kwargs) + self.is_eligible = is_eligible + self.status = status + self.seasonality_period = seasonality_period class EmailReceiver(msrest.serialization.Model): @@ -796,6 +878,171 @@ def __init__( self.callback_url = callback_url +class MetricBaselinesResponse(msrest.serialization.Model): + """A list of metric baselines. + + All required parameters must be populated in order to send to Azure. + + :param timespan: Required. The timespan for which the data was retrieved. Its value consists of + two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned + back from what was originally requested. + :type timespan: str + :param interval: Required. The interval (window size) for which the metric data was returned + in. This may be adjusted in the future and returned back from what was originally requested. + This is not present if a metadata request was made. + :type interval: ~datetime.timedelta + :param namespace: The namespace of the metrics been queried. + :type namespace: str + :param value: The baseline for each time series that was queried. + :type value: list[~$(python-base-namespace).v2018_09_01.models.SingleMetricBaseline] + """ + + _validation = { + 'timespan': {'required': True}, + 'interval': {'required': True}, + } + + _attribute_map = { + 'timespan': {'key': 'timespan', 'type': 'str'}, + 'interval': {'key': 'interval', 'type': 'duration'}, + 'namespace': {'key': 'namespace', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[SingleMetricBaseline]'}, + } + + def __init__( + self, + *, + timespan: str, + interval: datetime.timedelta, + namespace: Optional[str] = None, + value: Optional[List["SingleMetricBaseline"]] = None, + **kwargs + ): + super(MetricBaselinesResponse, self).__init__(**kwargs) + self.timespan = timespan + self.interval = interval + self.namespace = namespace + self.value = value + + +class MetricSingleDimension(msrest.serialization.Model): + """The metric dimension name and value. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the dimension. + :type name: str + :param value: Required. Value of the dimension. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + value: str, + **kwargs + ): + super(MetricSingleDimension, self).__init__(**kwargs) + self.name = name + self.value = value + + +class SingleBaseline(msrest.serialization.Model): + """The baseline values for a single sensitivity value. + + All required parameters must be populated in order to send to Azure. + + :param sensitivity: Required. the sensitivity of the baseline. Possible values include: "Low", + "Medium", "High". + :type sensitivity: str or ~$(python-base-namespace).v2018_09_01.models.BaselineSensitivity + :param low_thresholds: Required. The low thresholds of the baseline. + :type low_thresholds: list[float] + :param high_thresholds: Required. The high thresholds of the baseline. + :type high_thresholds: list[float] + """ + + _validation = { + 'sensitivity': {'required': True}, + 'low_thresholds': {'required': True}, + 'high_thresholds': {'required': True}, + } + + _attribute_map = { + 'sensitivity': {'key': 'sensitivity', 'type': 'str'}, + 'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'}, + 'high_thresholds': {'key': 'highThresholds', 'type': '[float]'}, + } + + def __init__( + self, + *, + sensitivity: Union[str, "BaselineSensitivity"], + low_thresholds: List[float], + high_thresholds: List[float], + **kwargs + ): + super(SingleBaseline, self).__init__(**kwargs) + self.sensitivity = sensitivity + self.low_thresholds = low_thresholds + self.high_thresholds = high_thresholds + + +class SingleMetricBaseline(msrest.serialization.Model): + """The baseline results of a single metric. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. The metric baseline Id. + :type id: str + :param type: Required. The resource type of the metric baseline resource. + :type type: str + :param metric_name: Required. The name of the metric for which the baselines were retrieved. + :type metric_name: str + :param baselines: Required. The baseline for each time series that was queried. + :type baselines: list[~$(python-base-namespace).v2018_09_01.models.TimeSeriesBaseline] + """ + + _validation = { + 'id': {'required': True}, + 'type': {'required': True}, + 'metric_name': {'required': True}, + 'baselines': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'baselines': {'key': 'baselines', 'type': '[TimeSeriesBaseline]'}, + } + + def __init__( + self, + *, + id: str, + type: str, + metric_name: str, + baselines: List["TimeSeriesBaseline"], + **kwargs + ): + super(SingleMetricBaseline, self).__init__(**kwargs) + self.id = id + self.type = type + self.metric_name = metric_name + self.baselines = baselines + + class SmsReceiver(msrest.serialization.Model): """An SMS receiver. @@ -844,6 +1091,55 @@ def __init__( self.status = None +class TimeSeriesBaseline(msrest.serialization.Model): + """The baseline values for a single time series. + + All required parameters must be populated in order to send to Azure. + + :param aggregation: Required. The aggregation type of the metric. + :type aggregation: str + :param dimensions: The dimensions of this time series. + :type dimensions: list[~$(python-base-namespace).v2018_09_01.models.MetricSingleDimension] + :param timestamps: Required. The list of timestamps of the baselines. + :type timestamps: list[~datetime.datetime] + :param data: Required. The baseline values for each sensitivity. + :type data: list[~$(python-base-namespace).v2018_09_01.models.SingleBaseline] + :param metadata_values: The baseline metadata values. + :type metadata_values: list[~$(python-base-namespace).v2018_09_01.models.BaselineMetadata] + """ + + _validation = { + 'aggregation': {'required': True}, + 'timestamps': {'required': True}, + 'data': {'required': True}, + } + + _attribute_map = { + 'aggregation': {'key': 'aggregation', 'type': 'str'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricSingleDimension]'}, + 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, + 'data': {'key': 'data', 'type': '[SingleBaseline]'}, + 'metadata_values': {'key': 'metadataValues', 'type': '[BaselineMetadata]'}, + } + + def __init__( + self, + *, + aggregation: str, + timestamps: List[datetime.datetime], + data: List["SingleBaseline"], + dimensions: Optional[List["MetricSingleDimension"]] = None, + metadata_values: Optional[List["BaselineMetadata"]] = None, + **kwargs + ): + super(TimeSeriesBaseline, self).__init__(**kwargs) + self.aggregation = aggregation + self.dimensions = dimensions + self.timestamps = timestamps + self.data = data + self.metadata_values = metadata_values + + class TimeSeriesInformation(msrest.serialization.Model): """The time series info needed for calculating the baseline. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_client_enums.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_client_enums.py index 26ccadca63031..1ae5830ea34fb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_management_client_enums.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/models/_monitor_client_enums.py @@ -26,6 +26,14 @@ def __getattr__(cls, name): raise AttributeError(name) +class BaselineSensitivity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """the sensitivity of the baseline. + """ + + LOW = "Low" + MEDIUM = "Medium" + HIGH = "High" + class ReceiverStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates the status of the receiver. Receivers that are not Enabled will not receive any communications. diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/__init__.py index 636f48f0362a0..1b1612af9bd2f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/__init__.py @@ -9,9 +9,11 @@ from ._action_groups_operations import ActionGroupsOperations from ._metric_baseline_operations import MetricBaselineOperations from ._baseline_operations import BaselineOperations +from ._baselines_operations import BaselinesOperations __all__ = [ 'ActionGroupsOperations', 'MetricBaselineOperations', 'BaselineOperations', + 'BaselinesOperations', ] 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 46614344a75b1..e2d74663633c9 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 @@ -80,7 +80,7 @@ def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -148,7 +148,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -208,7 +208,7 @@ def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -267,7 +267,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -331,7 +331,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -403,7 +403,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -478,7 +478,7 @@ def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) 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 2afba907f9419..5ff644b7d4eda 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 @@ -144,4 +144,4 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/baseline'} # type: ignore + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/baseline'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baselines_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baselines_operations.py new file mode 100644 index 0000000000000..a6ce41f00d9a8 --- /dev/null +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_09_01/operations/_baselines_operations.py @@ -0,0 +1,168 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import datetime +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 as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class BaselinesOperations(object): + """BaselinesOperations 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).v2018_09_01.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 list( + self, + resource_uri, # type: str + metricnames=None, # type: Optional[str] + metricnamespace=None, # type: Optional[str] + timespan=None, # type: Optional[str] + interval=None, # type: Optional[datetime.timedelta] + aggregation=None, # type: Optional[str] + sensitivities=None, # type: Optional[str] + filter=None, # type: Optional[str] + result_type=None, # type: Optional[Union[str, "_models.ResultType"]] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MetricBaselinesResponse"] + """**Lists the metric baseline values for a resource**. + + :param resource_uri: The identifier of the resource. + :type resource_uri: str + :param metricnames: The names of the metrics (comma separated) to retrieve. + :type metricnames: str + :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'. + :type timespan: str + :param interval: The interval (i.e. timegrain) of the query. + :type interval: ~datetime.timedelta + :param aggregation: The list of aggregation types (comma separated) to retrieve. + :type aggregation: str + :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 ‘*\ ’**. + :type filter: str + :param result_type: Allows retrieving only metadata of the baseline. On data request all + information is retrieved. + :type result_type: str or ~$(python-base-namespace).v2018_09_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) + :rtype: ~azure.core.paging.ItemPaged[~$(python-base-namespace).v2018_09_01.models.MetricBaselinesResponse] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MetricBaselinesResponse"] + 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.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if metricnames is not None: + query_parameters['metricnames'] = self._serialize.query("metricnames", metricnames, 'str') + if metricnamespace is not None: + query_parameters['metricnamespace'] = self._serialize.query("metricnamespace", metricnamespace, 'str') + if timespan is not None: + query_parameters['timespan'] = self._serialize.query("timespan", timespan, 'str') + if interval is not None: + query_parameters['interval'] = self._serialize.query("interval", interval, 'duration') + if aggregation is not None: + query_parameters['aggregation'] = self._serialize.query("aggregation", aggregation, 'str') + if sensitivities is not None: + query_parameters['sensitivities'] = self._serialize.query("sensitivities", sensitivities, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if result_type is not 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] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MetricBaselinesResponse', 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': '/{resourceUri}/providers/Microsoft.Insights/metricBaselines'} # type: ignore 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 e312106466af7..1a4acd854d5f1 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 @@ -143,7 +143,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/baseline/{metricName}'} # type: ignore + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/baseline/{metricName}'} # type: ignore def calculate_baseline( self, @@ -210,4 +210,4 @@ def calculate_baseline( return cls(pipeline_response, deserialized, {}) return deserialized - calculate_baseline.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/calculatebaseline'} # type: ignore + calculate_baseline.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/calculatebaseline'} # type: ignore 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 0982355d24b66..5633dfdd4b07a 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 @@ -20,8 +20,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -38,7 +38,7 @@ def __init__( # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2018-11-27-preview" 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 ae013cb651cfc..e8bd03081bb22 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 @@ -2,14 +2,14 @@ "chosen_version": "2018-11-27-preview", "total_api_version_list": ["2018-11-27-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py index 6005223afa1bd..fe69a0cda202f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/_monitor_client.py @@ -17,12 +17,12 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import VMInsightsOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar vm_insights: VMInsightsOperations operations @@ -41,12 +41,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.vm_insights = VMInsightsOperations( @@ -57,7 +56,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py index 47ad42a1a50cc..5a81e34b4d7af 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_configuration.py @@ -18,8 +18,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -35,7 +35,7 @@ def __init__( ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2018-11-27-preview" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py index 14ccf5f02108d..3709f21b2721e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/aio/_monitor_client.py @@ -15,12 +15,12 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import VMInsightsOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar vm_insights: VMInsightsOperations operations @@ -38,12 +38,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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.vm_insights = VMInsightsOperations( @@ -52,7 +51,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/__init__.py index 94c27fef8dc0a..1a15faf3924b8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/__init__.py @@ -21,7 +21,7 @@ from ._models import VMInsightsOnboardingStatus # type: ignore from ._models import WorkspaceInfo # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( DataStatus, OnboardingStatus, ) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_models_py3.py index 85a106bf95eb8..49abd7377a2e8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_models_py3.py @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class DataContainer(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2018_11_27_preview/models/_monitor_client_enums.py 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 19db68b6105a9..ce0570b5023a9 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 0cda759be0784..6ae28c52d4000 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 @@ -2,14 +2,14 @@ "chosen_version": "2019-03-01", "total_api_version_list": ["2019-03-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py similarity index 87% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py index 64272557194e3..845317cadcab6 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/_monitor_client.py @@ -17,13 +17,13 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from .operations import BaselinesOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations @@ -32,7 +32,7 @@ class MonitorManagementClient(object): :vartype baselines: $(python-base-namespace).v2019_03_01.operations.BaselinesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -47,12 +47,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -65,7 +64,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py index 39a3184e2abaa..8c5535947922d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py similarity index 86% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py index 07f26ba351e4c..7143739948754 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/_monitor_client.py @@ -15,13 +15,13 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from .operations import BaselinesOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations @@ -30,7 +30,7 @@ class MonitorManagementClient(object): :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -44,12 +44,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -60,7 +59,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py index 97335a1b91b4a..494e0f68b863b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_action_groups_operations.py @@ -75,7 +75,7 @@ async def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -142,7 +142,7 @@ async def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -201,7 +201,7 @@ async def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -259,7 +259,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -322,7 +322,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -393,7 +393,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -467,7 +467,7 @@ async def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py index a3b9afcfcf6d0..b4422cb6294f4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/aio/operations/_baselines_operations.py @@ -160,4 +160,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/metricBaselines'} # type: ignore + list.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/metricBaselines'} # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/__init__.py index eda2bcda5d852..e2a26e46012c3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/__init__.py @@ -53,7 +53,7 @@ from ._models import VoiceReceiver # type: ignore from ._models import WebhookReceiver # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( BaselineSensitivity, ReceiverStatus, ResultType, diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_models.py index 5b874c6d560f8..56d6aedcbc4ec 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_models.py @@ -780,8 +780,8 @@ class TimeSeriesBaseline(msrest.serialization.Model): :type timestamps: list[~datetime.datetime] :param data: Required. The baseline values for each sensitivity. :type data: list[~$(python-base-namespace).v2019_03_01.models.SingleBaseline] - :param metadata: The baseline metadata values. - :type metadata: list[~$(python-base-namespace).v2019_03_01.models.BaselineMetadata] + :param metadata_values: The baseline metadata values. + :type metadata_values: list[~$(python-base-namespace).v2019_03_01.models.BaselineMetadata] """ _validation = { @@ -795,7 +795,7 @@ class TimeSeriesBaseline(msrest.serialization.Model): 'dimensions': {'key': 'dimensions', 'type': '[MetricSingleDimension]'}, 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, 'data': {'key': 'data', 'type': '[SingleBaseline]'}, - 'metadata': {'key': 'metadata', 'type': '[BaselineMetadata]'}, + 'metadata_values': {'key': 'metadataValues', 'type': '[BaselineMetadata]'}, } def __init__( @@ -807,7 +807,7 @@ def __init__( self.dimensions = kwargs.get('dimensions', None) self.timestamps = kwargs['timestamps'] self.data = kwargs['data'] - self.metadata = kwargs.get('metadata', None) + self.metadata_values = kwargs.get('metadata_values', None) class VoiceReceiver(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_models_py3.py index ae73ab8d590ab..b01a5a5e876c1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_models_py3.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class ActionGroupList(msrest.serialization.Model): @@ -874,8 +874,8 @@ class TimeSeriesBaseline(msrest.serialization.Model): :type timestamps: list[~datetime.datetime] :param data: Required. The baseline values for each sensitivity. :type data: list[~$(python-base-namespace).v2019_03_01.models.SingleBaseline] - :param metadata: The baseline metadata values. - :type metadata: list[~$(python-base-namespace).v2019_03_01.models.BaselineMetadata] + :param metadata_values: The baseline metadata values. + :type metadata_values: list[~$(python-base-namespace).v2019_03_01.models.BaselineMetadata] """ _validation = { @@ -889,7 +889,7 @@ class TimeSeriesBaseline(msrest.serialization.Model): 'dimensions': {'key': 'dimensions', 'type': '[MetricSingleDimension]'}, 'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'}, 'data': {'key': 'data', 'type': '[SingleBaseline]'}, - 'metadata': {'key': 'metadata', 'type': '[BaselineMetadata]'}, + 'metadata_values': {'key': 'metadataValues', 'type': '[BaselineMetadata]'}, } def __init__( @@ -899,7 +899,7 @@ def __init__( timestamps: List[datetime.datetime], data: List["SingleBaseline"], dimensions: Optional[List["MetricSingleDimension"]] = None, - metadata: Optional[List["BaselineMetadata"]] = None, + metadata_values: Optional[List["BaselineMetadata"]] = None, **kwargs ): super(TimeSeriesBaseline, self).__init__(**kwargs) @@ -907,7 +907,7 @@ def __init__( self.dimensions = dimensions self.timestamps = timestamps self.data = data - self.metadata = metadata + self.metadata_values = metadata_values class VoiceReceiver(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_03_01/models/_monitor_client_enums.py 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 c9fbe20773ceb..2784128d35727 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 @@ -80,7 +80,7 @@ def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -148,7 +148,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -208,7 +208,7 @@ def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -267,7 +267,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -331,7 +331,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -403,7 +403,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -478,7 +478,7 @@ def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) 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 694d1ae0d6c6f..fa732d8872809 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 @@ -165,4 +165,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/metricBaselines'} # type: ignore + list.metadata = {'url': '/{resourceUri}/providers/Microsoft.Insights/metricBaselines'} # type: ignore 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 986ddf51548aa..a0c3b662aa507 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 b08a44abb8eae..e6ff433e7106f 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 @@ -2,14 +2,14 @@ "chosen_version": "2019-06-01", "total_api_version_list": ["2019-06-01"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py similarity index 86% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py index 8602679e95fb4..eeea0925bb510 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/_monitor_client.py @@ -17,19 +17,19 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations :vartype action_groups: $(python-base-namespace).v2019_06_01.operations.ActionGroupsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -44,12 +44,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -60,7 +59,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py index 5a6acb7a7c8e2..c808e76a91c94 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py similarity index 85% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py index defe4fa3c7211..e71723fc43ce3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/_monitor_client.py @@ -15,19 +15,19 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ActionGroupsOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar action_groups: ActionGroupsOperations operations :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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -41,12 +41,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.action_groups = ActionGroupsOperations( @@ -55,7 +54,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py index 234fd4de09971..50450066d735a 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/aio/operations/_action_groups_operations.py @@ -75,7 +75,7 @@ async def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -142,7 +142,7 @@ async def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -201,7 +201,7 @@ async def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -259,7 +259,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -322,7 +322,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -393,7 +393,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -467,7 +467,7 @@ async def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/__init__.py index 8b63784e2053a..e85394063e2bf 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/__init__.py @@ -41,7 +41,7 @@ from ._models import VoiceReceiver # type: ignore from ._models import WebhookReceiver # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( ReceiverStatus, ) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_06_01/models/_monitor_client_enums.py 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 5e5beb6f7e233..124cb038deb75 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 @@ -80,7 +80,7 @@ def create_or_update( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -148,7 +148,7 @@ def get( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -208,7 +208,7 @@ def delete( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -267,7 +267,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), } @@ -331,7 +331,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription_id.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -403,7 +403,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -478,7 +478,7 @@ def enable_receiver( path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'actionGroupName': self._serialize.url("action_group_name", action_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) 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 ccbeb512b0c20..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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 83a63e0eb1cad..657970816bd01 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 @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id 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 3c2b0e3f35258..bfdea836bd8cd 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 @@ -2,14 +2,14 @@ "chosen_version": "2019-10-17-preview", "total_api_version_list": ["2019-10-17-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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": true, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py similarity index 92% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py index 17ca2fc7e5c52..f586875e4a69f 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/_monitor_client.py @@ -17,7 +17,7 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import PrivateLinkScopesOperations from .operations import PrivateLinkScopeOperationStatusOperations from .operations import PrivateLinkResourcesOperations @@ -26,7 +26,7 @@ from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar private_link_scopes: PrivateLinkScopesOperations operations @@ -41,7 +41,7 @@ class MonitorManagementClient(object): :vartype private_link_scoped_resources: $(python-base-namespace).v2019_10_17.operations.PrivateLinkScopedResourcesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :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. @@ -57,12 +57,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.private_link_scopes = PrivateLinkScopesOperations( @@ -81,7 +80,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 96ce9b45c05b5..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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py index 92d60a10ecc5d..4cfc739a8cccb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py similarity index 91% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py index 21dbf08efa5cc..58a0b50bdbaf4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_monitor_client.py @@ -15,7 +15,7 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import PrivateLinkScopesOperations from .operations import PrivateLinkScopeOperationStatusOperations from .operations import PrivateLinkResourcesOperations @@ -24,7 +24,7 @@ from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar private_link_scopes: PrivateLinkScopesOperations operations @@ -39,7 +39,7 @@ class MonitorManagementClient(object): :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. + :param subscription_id: The ID of the target subscription. :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. @@ -54,12 +54,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.private_link_scopes = PrivateLinkScopesOperations( @@ -76,7 +75,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py index 6737376e31385..afff5949f540b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_endpoint_connections_operations.py @@ -74,7 +74,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -125,7 +125,7 @@ async def _create_or_update_initial( # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -218,7 +218,7 @@ def get_long_running_output(pipeline_response): return deserialized path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -255,7 +255,7 @@ async def _delete_initial( # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -331,7 +331,7 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -385,7 +385,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py index bed75a78ceaf4..b69c459190264 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_resources_operations.py @@ -75,7 +75,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } @@ -146,7 +146,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'groupName': self._serialize.url("group_name", group_name, 'str'), diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py index a5b6373e2a95c..3910328d964ea 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scope_operation_status_operations.py @@ -71,7 +71,7 @@ async def get( path_format_arguments = { 'asyncOperationId': self._serialize.url("async_operation_id", async_operation_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py index 54a032f85139a..85c7e4f6b1e66 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scoped_resources_operations.py @@ -74,7 +74,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -125,7 +125,7 @@ async def _create_or_update_initial( # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -221,7 +221,7 @@ def get_long_running_output(pipeline_response): return deserialized path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -258,7 +258,7 @@ async def _delete_initial( # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -334,7 +334,7 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -388,7 +388,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py index 64888edbabcb3..be17b6f80a592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/operations/_private_link_scopes_operations.py @@ -71,7 +71,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -141,7 +141,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -196,7 +196,7 @@ async def _delete_initial( url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -267,7 +267,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } @@ -314,7 +314,7 @@ async def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -378,7 +378,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -450,7 +450,7 @@ async def update_tags( url = self.update_tags.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) 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 db80c9574e456..f7f91017e9f7e 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 @@ -79,7 +79,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -131,7 +131,7 @@ def _create_or_update_initial( # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -225,7 +225,7 @@ def get_long_running_output(pipeline_response): return deserialized path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -263,7 +263,7 @@ def _delete_initial( # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -340,7 +340,7 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), @@ -395,7 +395,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } 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 6620eacc112b4..669f69362ef80 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 @@ -80,7 +80,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } @@ -152,7 +152,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'groupName': self._serialize.url("group_name", group_name, 'str'), 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 e1f637aaf3b52..e2af92cf65293 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 @@ -76,7 +76,7 @@ def get( path_format_arguments = { 'asyncOperationId': self._serialize.url("async_operation_id", async_operation_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) 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 7aa45cf03bd3e..45b7372e65b1d 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 @@ -79,7 +79,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -131,7 +131,7 @@ def _create_or_update_initial( # Construct URL url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -228,7 +228,7 @@ def get_long_running_output(pipeline_response): return deserialized path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -266,7 +266,7 @@ def _delete_initial( # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -343,7 +343,7 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), 'name': self._serialize.url("name", name, 'str'), @@ -398,7 +398,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_private_link_scope.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } 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 147a41ec0f0e8..01f3919b9eb9e 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 @@ -76,7 +76,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -147,7 +147,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -203,7 +203,7 @@ def _delete_initial( url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -275,7 +275,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } @@ -323,7 +323,7 @@ def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -388,7 +388,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -461,7 +461,7 @@ def update_tags( url = self.update_tags.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'scopeName': self._serialize.url("scope_name", scope_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/__init__.py index ccbeb512b0c20..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_configuration.py index 49e5764a1ad0d..7a00eb694f1eb 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_configuration.py @@ -20,8 +20,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_metadata.json index 9d1dbc34ccdba..c0b06cb89a145 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_metadata.json @@ -2,14 +2,14 @@ "chosen_version": "2019-11-01-preview", "total_api_version_list": ["2019-11-01-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_monitor_client.py similarity index 90% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_monitor_client.py index 26e7eb98aa3bb..528421a8cb96b 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/_monitor_client.py @@ -17,13 +17,13 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import DataCollectionRuleAssociationsOperations from .operations import DataCollectionRulesOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar data_collection_rule_associations: DataCollectionRuleAssociationsOperations operations @@ -47,12 +47,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.data_collection_rule_associations = DataCollectionRuleAssociationsOperations( @@ -65,7 +64,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/__init__.py index 96ce9b45c05b5..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_configuration.py index f2080febb084c..d84f7c4bcb3d0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_configuration.py @@ -18,8 +18,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_monitor_client.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_monitor_client.py index 723bd1e63fee5..b435d889ab516 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/aio/_monitor_client.py @@ -15,13 +15,13 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import DataCollectionRuleAssociationsOperations from .operations import DataCollectionRulesOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar data_collection_rule_associations: DataCollectionRuleAssociationsOperations operations @@ -44,12 +44,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.data_collection_rule_associations = DataCollectionRuleAssociationsOperations( @@ -60,7 +59,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/__init__.py index 419634ac11a70..161faf6d805f1 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/__init__.py @@ -26,9 +26,9 @@ from ._models_py3 import ErrorDetails from ._models_py3 import ErrorDetailsAutoGenerated from ._models_py3 import ErrorResponse - from ._models_py3 import ErrorResponseError from ._models_py3 import ErrorResponseAutoGenerated from ._models_py3 import ErrorResponseError + from ._models_py3 import ErrorResponseErrorAutoGenerated from ._models_py3 import ExtensionDataSource from ._models_py3 import LogAnalyticsDestination from ._models_py3 import PerfCounterDataSource @@ -55,9 +55,9 @@ from ._models import ErrorDetails # type: ignore from ._models import ErrorDetailsAutoGenerated # type: ignore from ._models import ErrorResponse # type: ignore - from ._models import ErrorResponseError # type: ignore from ._models import ErrorResponseAutoGenerated # type: ignore from ._models import ErrorResponseError # type: ignore + from ._models import ErrorResponseErrorAutoGenerated # type: ignore from ._models import ExtensionDataSource # type: ignore from ._models import LogAnalyticsDestination # type: ignore from ._models import PerfCounterDataSource # type: ignore @@ -65,7 +65,7 @@ from ._models import SyslogDataSource # type: ignore from ._models import WindowsEventLogDataSource # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( KnownDataCollectionRuleAssociationProvisioningState, KnownDataCollectionRuleProvisioningState, KnownDataFlowStreams, @@ -99,9 +99,9 @@ 'ErrorDetails', 'ErrorDetailsAutoGenerated', 'ErrorResponse', - 'ErrorResponseError', 'ErrorResponseAutoGenerated', 'ErrorResponseError', + 'ErrorResponseErrorAutoGenerated', 'ExtensionDataSource', 'LogAnalyticsDestination', 'PerfCounterDataSource', diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models.py index 923fe2674a45b..60075942c9d58 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models.py @@ -728,7 +728,32 @@ def __init__( self.error = None -class ErrorResponseError(ErrorDetailsAutoGenerated): +class ErrorResponseAutoGenerated(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsAutoGenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseAutoGenerated, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseError(ErrorDetails): """Error details. Variables are only populated by the server, and will be ignored when sending a request. @@ -741,8 +766,7 @@ class ErrorResponseError(ErrorDetailsAutoGenerated): error). :vartype target: str :ivar details: Additional nested error detail objects. - :vartype details: list[~$(python-base- - namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated] + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] :ivar additional_info: Additional error information. :vartype additional_info: list[~$(python-base- namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] @@ -760,7 +784,7 @@ class ErrorResponseError(ErrorDetailsAutoGenerated): 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetailsAutoGenerated]'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } @@ -771,32 +795,7 @@ def __init__( super(ErrorResponseError, self).__init__(**kwargs) -class ErrorResponseAutoGenerated(msrest.serialization.Model): - """Common error response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: Error details. - :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated - """ - - _validation = { - 'error': {'readonly': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetailsAutoGenerated'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponseAutoGenerated, self).__init__(**kwargs) - self.error = None - - -class ErrorResponseError(ErrorDetails): +class ErrorResponseErrorAutoGenerated(ErrorDetailsAutoGenerated): """Error details. Variables are only populated by the server, and will be ignored when sending a request. @@ -809,7 +808,8 @@ class ErrorResponseError(ErrorDetails): error). :vartype target: str :ivar details: Additional nested error detail objects. - :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated] :ivar additional_info: Additional error information. :vartype additional_info: list[~$(python-base- namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] @@ -827,7 +827,7 @@ class ErrorResponseError(ErrorDetails): 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsAutoGenerated]'}, 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } @@ -835,7 +835,7 @@ def __init__( self, **kwargs ): - super(ErrorResponseError, self).__init__(**kwargs) + super(ErrorResponseErrorAutoGenerated, self).__init__(**kwargs) class ExtensionDataSource(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models_py3.py index e3fcfe85a32a7..2a19661dae905 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_models_py3.py @@ -11,7 +11,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class AzureMonitorMetricsDestination(msrest.serialization.Model): @@ -787,7 +787,32 @@ def __init__( self.error = None -class ErrorResponseError(ErrorDetailsAutoGenerated): +class ErrorResponseAutoGenerated(msrest.serialization.Model): + """Common error response. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar error: Error details. + :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetailsAutoGenerated'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseAutoGenerated, self).__init__(**kwargs) + self.error = None + + +class ErrorResponseError(ErrorDetails): """Error details. Variables are only populated by the server, and will be ignored when sending a request. @@ -800,8 +825,7 @@ class ErrorResponseError(ErrorDetailsAutoGenerated): error). :vartype target: str :ivar details: Additional nested error detail objects. - :vartype details: list[~$(python-base- - namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated] + :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] :ivar additional_info: Additional error information. :vartype additional_info: list[~$(python-base- namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] @@ -819,7 +843,7 @@ class ErrorResponseError(ErrorDetailsAutoGenerated): 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetailsAutoGenerated]'}, + 'details': {'key': 'details', 'type': '[ErrorDetails]'}, 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } @@ -830,32 +854,7 @@ def __init__( super(ErrorResponseError, self).__init__(**kwargs) -class ErrorResponseAutoGenerated(msrest.serialization.Model): - """Common error response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: Error details. - :vartype error: ~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated - """ - - _validation = { - 'error': {'readonly': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetailsAutoGenerated'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponseAutoGenerated, self).__init__(**kwargs) - self.error = None - - -class ErrorResponseError(ErrorDetails): +class ErrorResponseErrorAutoGenerated(ErrorDetailsAutoGenerated): """Error details. Variables are only populated by the server, and will be ignored when sending a request. @@ -868,7 +867,8 @@ class ErrorResponseError(ErrorDetails): error). :vartype target: str :ivar details: Additional nested error detail objects. - :vartype details: list[~$(python-base-namespace).v2019_11_01_preview.models.ErrorDetails] + :vartype details: list[~$(python-base- + namespace).v2019_11_01_preview.models.ErrorDetailsAutoGenerated] :ivar additional_info: Additional error information. :vartype additional_info: list[~$(python-base- namespace).v2019_11_01_preview.models.ErrorAdditionalInfo] @@ -886,7 +886,7 @@ class ErrorResponseError(ErrorDetails): 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetails]'}, + 'details': {'key': 'details', 'type': '[ErrorDetailsAutoGenerated]'}, 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } @@ -894,7 +894,7 @@ def __init__( self, **kwargs ): - super(ErrorResponseError, self).__init__(**kwargs) + super(ErrorResponseErrorAutoGenerated, self).__init__(**kwargs) class ExtensionDataSource(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_11_01_preview/models/_monitor_client_enums.py 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 index ccbeb512b0c20..fa63968b37592 100644 --- 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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore 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 index 576b2cc745890..40a30732e6b8f 100644 --- 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 @@ -20,8 +20,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -38,7 +38,7 @@ def __init__( # type: (...) -> None if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2020-01-01-preview" 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 index b5d267fb35a74..0e184819af2c1 100644 --- 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 @@ -2,14 +2,14 @@ "chosen_version": "2020-01-01-preview", "total_api_version_list": ["2020-01-01-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py similarity index 89% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py index c3d1b9f772ef4..0a44a2308e031 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_client.py @@ -17,12 +17,12 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ManagementGroupDiagnosticSettingsOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar management_group_diagnostic_settings: ManagementGroupDiagnosticSettingsOperations operations @@ -41,12 +41,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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( @@ -57,7 +56,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self 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 index 96ce9b45c05b5..7096a59fbc1f0 100644 --- 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 @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +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 index 014f28055b135..f2814440fdb47 100644 --- 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 @@ -18,8 +18,8 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +class MonitorClientConfiguration(Configuration): + """Configuration for MonitorClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -35,7 +35,7 @@ def __init__( ) -> None: if credential is None: raise ValueError("Parameter 'credential' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.api_version = "2020-01-01-preview" diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py similarity index 88% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py index 2f7456674d928..0cb96dc6dedd8 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/aio/_monitor_client.py @@ -15,12 +15,12 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ManagementGroupDiagnosticSettingsOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar management_group_diagnostic_settings: ManagementGroupDiagnosticSettingsOperations operations @@ -38,12 +38,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, **kwargs) + 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( @@ -52,7 +51,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/__init__.py index ccbeb512b0c20..fa63968b37592 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._monitor_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] try: from ._patch import patch_sdk # type: ignore diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_configuration.py index 78473575fb289..dab590d5f4ce3 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_configuration.py @@ -20,15 +20,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -43,7 +43,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_metadata.json b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_metadata.json index 7892eefabedfc..bcf965e81eff4 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_metadata.json +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_metadata.json @@ -2,14 +2,14 @@ "chosen_version": "2020-05-01-preview", "total_api_version_list": ["2020-05-01-preview"], "client": { - "name": "MonitorManagementClient", - "filename": "_monitor_management_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, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { @@ -21,7 +21,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } @@ -35,7 +35,7 @@ }, "subscription_id": { "signature": "subscription_id, # type: str", - "description": "The Azure subscription Id.", + "description": "The ID of the target subscription.", "docstring_type": "str", "required": true } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_monitor_client.py similarity index 86% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_monitor_client.py index 57f192b65071c..439226f76ba48 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/_monitor_client.py @@ -17,19 +17,19 @@ from azure.core.credentials import TokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ScheduledQueryRulesOperations from . import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar scheduled_query_rules: ScheduledQueryRulesOperations operations :vartype scheduled_query_rules: $(python-base-namespace).v2020_05_01_preview.operations.ScheduledQueryRulesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -44,12 +44,11 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.scheduled_query_rules = ScheduledQueryRulesOperations( @@ -60,7 +59,7 @@ def close(self): self._client.close() def __enter__(self): - # type: () -> MonitorManagementClient + # type: () -> MonitorClient self._client.__enter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/__init__.py index 96ce9b45c05b5..7096a59fbc1f0 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_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_management_client import MonitorManagementClient -__all__ = ['MonitorManagementClient'] +from ._monitor_client import MonitorClient +__all__ = ['MonitorClient'] diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_configuration.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_configuration.py index 91c9d16538c30..d3eff86218f9d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_configuration.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_configuration.py @@ -18,15 +18,15 @@ VERSION = "unknown" -class MonitorManagementClientConfiguration(Configuration): - """Configuration for MonitorManagementClient. +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 - :param subscription_id: The Azure subscription Id. + :param subscription_id: The ID of the target subscription. :type subscription_id: str """ @@ -40,7 +40,7 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(MonitorManagementClientConfiguration, self).__init__(**kwargs) + super(MonitorClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_monitor_management_client.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_monitor_client.py similarity index 85% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_monitor_management_client.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_monitor_client.py index 8ec830e0b2525..b4ab0fa33042d 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_monitor_management_client.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/_monitor_client.py @@ -15,19 +15,19 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import MonitorManagementClientConfiguration +from ._configuration import MonitorClientConfiguration from .operations import ScheduledQueryRulesOperations from .. import models -class MonitorManagementClient(object): +class MonitorClient(object): """Monitor Management Client. :ivar scheduled_query_rules: ScheduledQueryRulesOperations operations :vartype scheduled_query_rules: $(python-base-namespace).v2020_05_01_preview.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. + :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL """ @@ -41,12 +41,11 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = MonitorManagementClientConfiguration(credential, subscription_id, **kwargs) + self._config = MonitorClientConfiguration(credential, subscription_id, **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.scheduled_query_rules = ScheduledQueryRulesOperations( @@ -55,7 +54,7 @@ def __init__( async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "MonitorManagementClient": + async def __aenter__(self) -> "MonitorClient": await self._client.__aenter__() return self diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/_scheduled_query_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/_scheduled_query_rules_operations.py index 25daa2f351ddc..00518fa8b596e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/_scheduled_query_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/aio/operations/_scheduled_query_rules_operations.py @@ -69,7 +69,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -139,7 +139,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -207,7 +207,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -270,7 +270,7 @@ async def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -341,7 +341,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -404,7 +404,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/__init__.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/__init__.py index 4856ee24980c8..58149d4e6127e 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/__init__.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/__init__.py @@ -35,7 +35,7 @@ from ._models import ScheduledQueryRuleResourcePatch # type: ignore from ._models import TrackedResource # type: ignore -from ._monitor_management_client_enums import ( +from ._monitor_client_enums import ( AlertSeverity, ConditionOperator, DimensionOperator, diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models_py3.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models_py3.py index b50679d0ac279..8a32c3553f845 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models_py3.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_models_py3.py @@ -12,7 +12,7 @@ from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._monitor_management_client_enums import * +from ._monitor_client_enums import * class Action(msrest.serialization.Model): diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_monitor_management_client_enums.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_monitor_client_enums.py similarity index 100% rename from sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_monitor_management_client_enums.py rename to sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/models/_monitor_client_enums.py diff --git a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/_scheduled_query_rules_operations.py b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/_scheduled_query_rules_operations.py index 6879360b4e773..2fb3b6b14f460 100644 --- a/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/_scheduled_query_rules_operations.py +++ b/sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_05_01_preview/operations/_scheduled_query_rules_operations.py @@ -74,7 +74,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_subscription.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -145,7 +145,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -214,7 +214,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -278,7 +278,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -350,7 +350,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), } @@ -414,7 +414,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'ruleName': self._serialize.url("rule_name", rule_name, 'str'), }