Skip to content

Commit cfb191b

Browse files
author
SDKAuto
committed
CodeGen from PR 34435 in Azure/azure-rest-api-specs
Merge 82f0ec4e9ca23c5848692d0ef3f37f563af93536 into 4a748a953cb8408283e3b5e9fd8773e012ca74ae
1 parent fa88072 commit cfb191b

File tree

191 files changed

+1803
-36495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+1803
-36495
lines changed

sdk/monitor/azure-mgmt-monitor/CHANGELOG.md

+281
Large diffs are not rendered by default.

sdk/monitor/azure-mgmt-monitor/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Monitor Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "a86a97dd03e0b9e692b5583e369feec3a579ef55",
2+
"commit": "1c7451fea4bbce4ac21b4bd66d198484d52dd8ae",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.27.4",
6+
"@autorest/python@6.34.1",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-python-sdk-for-cli-only --use=@autorest/python@6.27.4 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/monitor/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.34.1 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/monitor/resource-manager/readme.md"
1111
}

sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_configuration.py

+6
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,22 @@ class MonitorManagementClientConfiguration: # pylint: disable=too-many-instance
2727
:type credential: ~azure.core.credentials.TokenCredential
2828
:param subscription_id: The ID of the target subscription. Required.
2929
:type subscription_id: str
30+
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
31+
this default value may result in unsupported behavior.
32+
:paramtype api_version: str
3033
"""
3134

3235
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
36+
api_version: str = kwargs.pop("api_version", "2024-03-01-preview")
37+
3338
if credential is None:
3439
raise ValueError("Parameter 'credential' must not be None.")
3540
if subscription_id is None:
3641
raise ValueError("Parameter 'subscription_id' must not be None.")
3742

3843
self.credential = credential
3944
self.subscription_id = subscription_id
45+
self.api_version = api_version
4046
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4147
kwargs.setdefault("sdk_moniker", "mgmt-monitor/{}".format(VERSION))
4248
self.polling_interval = kwargs.get("polling_interval", 30)

sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_management_client.py

+19-179
Original file line numberDiff line numberDiff line change
@@ -7,143 +7,53 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from . import models as _models
1921
from ._configuration import MonitorManagementClientConfiguration
20-
from ._serialization import Deserializer, Serializer
21-
from .operations import (
22-
ActionGroupsOperations,
23-
ActivityLogAlertsOperations,
24-
ActivityLogsOperations,
25-
AlertRuleIncidentsOperations,
26-
AutoscaleSettingsOperations,
27-
BaselinesOperations,
28-
DiagnosticSettingsCategoryOperations,
29-
DiagnosticSettingsOperations,
30-
EventCategoriesOperations,
31-
GuestDiagnosticsSettingsAssociationOperations,
32-
GuestDiagnosticsSettingsOperations,
33-
LogProfilesOperations,
34-
MetricAlertsOperations,
35-
MetricAlertsStatusOperations,
36-
MetricDefinitionsOperations,
37-
MetricNamespacesOperations,
38-
MetricsOperations,
39-
Operations,
40-
PredictiveMetricOperations,
41-
PrivateEndpointConnectionsOperations,
42-
PrivateLinkResourcesOperations,
43-
PrivateLinkScopeOperationStatusOperations,
44-
PrivateLinkScopedResourcesOperations,
45-
PrivateLinkScopesOperations,
46-
ScheduledQueryRulesOperations,
47-
ServiceDiagnosticSettingsOperations,
48-
SubscriptionDiagnosticSettingsOperations,
49-
TenantActivityLogsOperations,
50-
VMInsightsOperations,
51-
)
22+
from ._utils.serialization import Deserializer, Serializer
23+
from .operations import MetricAlertsOperations
5224

5325
if TYPE_CHECKING:
5426
from azure.core.credentials import TokenCredential
5527

5628

57-
class MonitorManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
29+
class MonitorManagementClient:
5830
"""Monitor Management Client.
5931
60-
:ivar action_groups: ActionGroupsOperations operations
61-
:vartype action_groups: azure.mgmt.monitor.operations.ActionGroupsOperations
62-
:ivar activity_log_alerts: ActivityLogAlertsOperations operations
63-
:vartype activity_log_alerts: azure.mgmt.monitor.operations.ActivityLogAlertsOperations
64-
:ivar activity_logs: ActivityLogsOperations operations
65-
:vartype activity_logs: azure.mgmt.monitor.operations.ActivityLogsOperations
66-
:ivar tenant_activity_logs: TenantActivityLogsOperations operations
67-
:vartype tenant_activity_logs: azure.mgmt.monitor.operations.TenantActivityLogsOperations
68-
:ivar alert_rule_incidents: AlertRuleIncidentsOperations operations
69-
:vartype alert_rule_incidents: azure.mgmt.monitor.operations.AlertRuleIncidentsOperations
70-
:ivar autoscale_settings: AutoscaleSettingsOperations operations
71-
:vartype autoscale_settings: azure.mgmt.monitor.operations.AutoscaleSettingsOperations
72-
:ivar predictive_metric: PredictiveMetricOperations operations
73-
:vartype predictive_metric: azure.mgmt.monitor.operations.PredictiveMetricOperations
74-
:ivar baselines: BaselinesOperations operations
75-
:vartype baselines: azure.mgmt.monitor.operations.BaselinesOperations
76-
:ivar diagnostic_settings: DiagnosticSettingsOperations operations
77-
:vartype diagnostic_settings: azure.mgmt.monitor.operations.DiagnosticSettingsOperations
78-
:ivar diagnostic_settings_category: DiagnosticSettingsCategoryOperations operations
79-
:vartype diagnostic_settings_category:
80-
azure.mgmt.monitor.operations.DiagnosticSettingsCategoryOperations
81-
:ivar event_categories: EventCategoriesOperations operations
82-
:vartype event_categories: azure.mgmt.monitor.operations.EventCategoriesOperations
83-
:ivar guest_diagnostics_settings: GuestDiagnosticsSettingsOperations operations
84-
:vartype guest_diagnostics_settings:
85-
azure.mgmt.monitor.operations.GuestDiagnosticsSettingsOperations
86-
:ivar guest_diagnostics_settings_association: GuestDiagnosticsSettingsAssociationOperations
87-
operations
88-
:vartype guest_diagnostics_settings_association:
89-
azure.mgmt.monitor.operations.GuestDiagnosticsSettingsAssociationOperations
90-
:ivar log_profiles: LogProfilesOperations operations
91-
:vartype log_profiles: azure.mgmt.monitor.operations.LogProfilesOperations
9232
:ivar metric_alerts: MetricAlertsOperations operations
9333
:vartype metric_alerts: azure.mgmt.monitor.operations.MetricAlertsOperations
94-
:ivar metric_alerts_status: MetricAlertsStatusOperations operations
95-
:vartype metric_alerts_status: azure.mgmt.monitor.operations.MetricAlertsStatusOperations
96-
:ivar metric_definitions: MetricDefinitionsOperations operations
97-
:vartype metric_definitions: azure.mgmt.monitor.operations.MetricDefinitionsOperations
98-
:ivar metric_namespaces: MetricNamespacesOperations operations
99-
:vartype metric_namespaces: azure.mgmt.monitor.operations.MetricNamespacesOperations
100-
:ivar metrics: MetricsOperations operations
101-
:vartype metrics: azure.mgmt.monitor.operations.MetricsOperations
102-
:ivar operations: Operations operations
103-
:vartype operations: azure.mgmt.monitor.operations.Operations
104-
:ivar scheduled_query_rules: ScheduledQueryRulesOperations operations
105-
:vartype scheduled_query_rules: azure.mgmt.monitor.operations.ScheduledQueryRulesOperations
106-
:ivar service_diagnostic_settings: ServiceDiagnosticSettingsOperations operations
107-
:vartype service_diagnostic_settings:
108-
azure.mgmt.monitor.operations.ServiceDiagnosticSettingsOperations
109-
:ivar vm_insights: VMInsightsOperations operations
110-
:vartype vm_insights: azure.mgmt.monitor.operations.VMInsightsOperations
111-
:ivar private_link_scopes: PrivateLinkScopesOperations operations
112-
:vartype private_link_scopes: azure.mgmt.monitor.operations.PrivateLinkScopesOperations
113-
:ivar private_link_scope_operation_status: PrivateLinkScopeOperationStatusOperations operations
114-
:vartype private_link_scope_operation_status:
115-
azure.mgmt.monitor.operations.PrivateLinkScopeOperationStatusOperations
116-
:ivar private_link_resources: PrivateLinkResourcesOperations operations
117-
:vartype private_link_resources: azure.mgmt.monitor.operations.PrivateLinkResourcesOperations
118-
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
119-
:vartype private_endpoint_connections:
120-
azure.mgmt.monitor.operations.PrivateEndpointConnectionsOperations
121-
:ivar private_link_scoped_resources: PrivateLinkScopedResourcesOperations operations
122-
:vartype private_link_scoped_resources:
123-
azure.mgmt.monitor.operations.PrivateLinkScopedResourcesOperations
124-
:ivar subscription_diagnostic_settings: SubscriptionDiagnosticSettingsOperations operations
125-
:vartype subscription_diagnostic_settings:
126-
azure.mgmt.monitor.operations.SubscriptionDiagnosticSettingsOperations
12734
:param credential: Credential needed for the client to connect to Azure. Required.
12835
:type credential: ~azure.core.credentials.TokenCredential
12936
:param subscription_id: The ID of the target subscription. Required.
13037
:type subscription_id: str
131-
:param base_url: Service URL. Default value is "https://management.azure.com".
38+
:param base_url: Service URL. Default value is None.
13239
:type base_url: str
133-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
134-
Retry-After header is present.
40+
:keyword api_version: Api Version. Default value is "2024-03-01-preview". Note that overriding
41+
this default value may result in unsupported behavior.
42+
:paramtype api_version: str
13543
"""
13644

13745
def __init__(
138-
self,
139-
credential: "TokenCredential",
140-
subscription_id: str,
141-
base_url: str = "https://management.azure.com",
142-
**kwargs: Any
46+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
14347
) -> None:
48+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
49+
_endpoints = get_arm_endpoints(_cloud)
50+
if not base_url:
51+
base_url = _endpoints["resource_manager"]
52+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
14453
self._config = MonitorManagementClientConfiguration(
145-
credential=credential, subscription_id=subscription_id, **kwargs
54+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
14655
)
56+
14757
_policies = kwargs.pop("policies", None)
14858
if _policies is None:
14959
_policies = [
@@ -162,83 +72,13 @@ def __init__(
16272
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
16373
self._config.http_logging_policy,
16474
]
165-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
75+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
16676

16777
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
16878
self._serialize = Serializer(client_models)
16979
self._deserialize = Deserializer(client_models)
17080
self._serialize.client_side_validation = False
171-
self.action_groups = ActionGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
172-
self.activity_log_alerts = ActivityLogAlertsOperations(
173-
self._client, self._config, self._serialize, self._deserialize
174-
)
175-
self.activity_logs = ActivityLogsOperations(self._client, self._config, self._serialize, self._deserialize)
176-
self.tenant_activity_logs = TenantActivityLogsOperations(
177-
self._client, self._config, self._serialize, self._deserialize
178-
)
179-
self.alert_rule_incidents = AlertRuleIncidentsOperations(
180-
self._client, self._config, self._serialize, self._deserialize
181-
)
182-
self.autoscale_settings = AutoscaleSettingsOperations(
183-
self._client, self._config, self._serialize, self._deserialize
184-
)
185-
self.predictive_metric = PredictiveMetricOperations(
186-
self._client, self._config, self._serialize, self._deserialize
187-
)
188-
self.baselines = BaselinesOperations(self._client, self._config, self._serialize, self._deserialize)
189-
self.diagnostic_settings = DiagnosticSettingsOperations(
190-
self._client, self._config, self._serialize, self._deserialize
191-
)
192-
self.diagnostic_settings_category = DiagnosticSettingsCategoryOperations(
193-
self._client, self._config, self._serialize, self._deserialize
194-
)
195-
self.event_categories = EventCategoriesOperations(
196-
self._client, self._config, self._serialize, self._deserialize
197-
)
198-
self.guest_diagnostics_settings = GuestDiagnosticsSettingsOperations(
199-
self._client, self._config, self._serialize, self._deserialize
200-
)
201-
self.guest_diagnostics_settings_association = GuestDiagnosticsSettingsAssociationOperations(
202-
self._client, self._config, self._serialize, self._deserialize
203-
)
204-
self.log_profiles = LogProfilesOperations(self._client, self._config, self._serialize, self._deserialize)
20581
self.metric_alerts = MetricAlertsOperations(self._client, self._config, self._serialize, self._deserialize)
206-
self.metric_alerts_status = MetricAlertsStatusOperations(
207-
self._client, self._config, self._serialize, self._deserialize
208-
)
209-
self.metric_definitions = MetricDefinitionsOperations(
210-
self._client, self._config, self._serialize, self._deserialize
211-
)
212-
self.metric_namespaces = MetricNamespacesOperations(
213-
self._client, self._config, self._serialize, self._deserialize
214-
)
215-
self.metrics = MetricsOperations(self._client, self._config, self._serialize, self._deserialize)
216-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
217-
self.scheduled_query_rules = ScheduledQueryRulesOperations(
218-
self._client, self._config, self._serialize, self._deserialize
219-
)
220-
self.service_diagnostic_settings = ServiceDiagnosticSettingsOperations(
221-
self._client, self._config, self._serialize, self._deserialize
222-
)
223-
self.vm_insights = VMInsightsOperations(self._client, self._config, self._serialize, self._deserialize)
224-
self.private_link_scopes = PrivateLinkScopesOperations(
225-
self._client, self._config, self._serialize, self._deserialize
226-
)
227-
self.private_link_scope_operation_status = PrivateLinkScopeOperationStatusOperations(
228-
self._client, self._config, self._serialize, self._deserialize
229-
)
230-
self.private_link_resources = PrivateLinkResourcesOperations(
231-
self._client, self._config, self._serialize, self._deserialize
232-
)
233-
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
234-
self._client, self._config, self._serialize, self._deserialize
235-
)
236-
self.private_link_scoped_resources = PrivateLinkScopedResourcesOperations(
237-
self._client, self._config, self._serialize, self._deserialize
238-
)
239-
self.subscription_diagnostic_settings = SubscriptionDiagnosticSettingsOperations(
240-
self._client, self._config, self._serialize, self._deserialize
241-
)
24282

24383
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
24484
"""Runs the network request through the client's chained policies.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)