Skip to content

Commit eb5561e

Browse files
author
SDKAuto
committed
CodeGen from PR 34270 in Azure/azure-rest-api-specs
Merge 447c4193246efcde66d0d0feaa59da2c756c794f into a19648565889eaae019e531c15f3045d1244c7ce
1 parent 6c30600 commit eb5561e

File tree

274 files changed

+9180
-43773
lines changed

Some content is hidden

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

274 files changed

+9180
-43773
lines changed

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

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 3 additions & 3 deletions
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.
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "a86a97dd03e0b9e692b5583e369feec3a579ef55",
2+
"commit": "5ab69662eff4ee3c2bc93c2a4959470ab9867c99",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.10.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
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/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/monitor/resource-manager/readme.md"
4+
"typespec_src": "specification/monitor/Microsoft.Monitor.Management",
5+
"@azure-tools/typespec-python": "0.44.2"
116
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.Monitor",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.monitor.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
5+
"azure.mgmt.monitor.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
6+
"azure.mgmt.monitor.models.AzureMonitorWorkspace": "Microsoft.Monitor.AzureMonitorWorkspace",
7+
"azure.mgmt.monitor.models.AzureMonitorWorkspaceLogsApiConfig": "Microsoft.Monitor.AzureMonitorWorkspaceLogsApiConfig",
8+
"azure.mgmt.monitor.models.AzureMonitorWorkspaceLogsExporter": "Microsoft.Monitor.AzureMonitorWorkspaceLogsExporter",
9+
"azure.mgmt.monitor.models.AzureMonitorWorkspaceProperties": "Microsoft.Monitor.AzureMonitorWorkspaceProperties",
10+
"azure.mgmt.monitor.models.AzureMonitorWorkspaceUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel",
11+
"azure.mgmt.monitor.models.AzureMonitorWorkspaceUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties",
12+
"azure.mgmt.monitor.models.BatchProcessor": "Microsoft.Monitor.BatchProcessor",
13+
"azure.mgmt.monitor.models.CacheConfiguration": "Microsoft.Monitor.CacheConfiguration",
14+
"azure.mgmt.monitor.models.ConcurrencyConfiguration": "Microsoft.Monitor.ConcurrencyConfiguration",
15+
"azure.mgmt.monitor.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
16+
"azure.mgmt.monitor.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
17+
"azure.mgmt.monitor.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
18+
"azure.mgmt.monitor.models.Exporter": "Microsoft.Monitor.Exporter",
19+
"azure.mgmt.monitor.models.ExtendedLocation": "Azure.ResourceManager.CommonTypes.ExtendedLocation",
20+
"azure.mgmt.monitor.models.IngestionSettings": "Microsoft.Monitor.IngestionSettings",
21+
"azure.mgmt.monitor.models.Metrics": "Microsoft.Monitor.Metrics",
22+
"azure.mgmt.monitor.models.NetworkingConfiguration": "Microsoft.Monitor.NetworkingConfiguration",
23+
"azure.mgmt.monitor.models.NetworkingRoute": "Microsoft.Monitor.NetworkingRoute",
24+
"azure.mgmt.monitor.models.Operation": "Azure.ResourceManager.CommonTypes.Operation",
25+
"azure.mgmt.monitor.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
26+
"azure.mgmt.monitor.models.OtlpReceiver": "Microsoft.Monitor.OtlpReceiver",
27+
"azure.mgmt.monitor.models.PersistenceConfigurations": "Microsoft.Monitor.PersistenceConfigurations",
28+
"azure.mgmt.monitor.models.Pipeline": "Microsoft.Monitor.Pipeline",
29+
"azure.mgmt.monitor.models.PipelineGroup": "Microsoft.Monitor.PipelineGroup",
30+
"azure.mgmt.monitor.models.PipelineGroupProperties": "Microsoft.Monitor.PipelineGroupProperties",
31+
"azure.mgmt.monitor.models.PipelineGroupUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel",
32+
"azure.mgmt.monitor.models.PipelineGroupUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties",
33+
"azure.mgmt.monitor.models.PrivateEndpoint": "Azure.ResourceManager.CommonTypes.PrivateEndpoint",
34+
"azure.mgmt.monitor.models.PrivateEndpointConnection": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnection",
35+
"azure.mgmt.monitor.models.PrivateEndpointConnectionProperties": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties",
36+
"azure.mgmt.monitor.models.PrivateLinkServiceConnectionState": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState",
37+
"azure.mgmt.monitor.models.Processor": "Microsoft.Monitor.Processor",
38+
"azure.mgmt.monitor.models.Receiver": "Microsoft.Monitor.Receiver",
39+
"azure.mgmt.monitor.models.RecordMap": "Microsoft.Monitor.RecordMap",
40+
"azure.mgmt.monitor.models.ResourceMap": "Microsoft.Monitor.ResourceMap",
41+
"azure.mgmt.monitor.models.SchemaMap": "Microsoft.Monitor.SchemaMap",
42+
"azure.mgmt.monitor.models.ScopeMap": "Microsoft.Monitor.ScopeMap",
43+
"azure.mgmt.monitor.models.Service": "Microsoft.Monitor.Service",
44+
"azure.mgmt.monitor.models.SyslogReceiver": "Microsoft.Monitor.SyslogReceiver",
45+
"azure.mgmt.monitor.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
46+
"azure.mgmt.monitor.models.TcpExporter": "Microsoft.Monitor.TcpExporter",
47+
"azure.mgmt.monitor.models.UdpReceiver": "Microsoft.Monitor.UdpReceiver",
48+
"azure.mgmt.monitor.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
49+
"azure.mgmt.monitor.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
50+
"azure.mgmt.monitor.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
51+
"azure.mgmt.monitor.models.ProvisioningState": "Microsoft.Monitor.ProvisioningState",
52+
"azure.mgmt.monitor.models.PrivateEndpointServiceConnectionStatus": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus",
53+
"azure.mgmt.monitor.models.PrivateEndpointConnectionProvisioningState": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState",
54+
"azure.mgmt.monitor.models.PublicNetworkAccess": "Microsoft.Monitor.PublicNetworkAccess",
55+
"azure.mgmt.monitor.models.ReceiverType": "Microsoft.Monitor.ReceiverType",
56+
"azure.mgmt.monitor.models.SyslogProtocol": "Microsoft.Monitor.SyslogProtocol",
57+
"azure.mgmt.monitor.models.StreamEncodingType": "Microsoft.Monitor.StreamEncodingType",
58+
"azure.mgmt.monitor.models.ProcessorType": "Microsoft.Monitor.ProcessorType",
59+
"azure.mgmt.monitor.models.ExporterType": "Microsoft.Monitor.ExporterType",
60+
"azure.mgmt.monitor.models.PipelineType": "Microsoft.Monitor.PipelineType",
61+
"azure.mgmt.monitor.models.ExternalNetworkingMode": "Microsoft.Monitor.ExternalNetworkingMode",
62+
"azure.mgmt.monitor.models.ExtendedLocationType": "Azure.ResourceManager.CommonTypes.ExtendedLocationType",
63+
"azure.mgmt.monitor.operations.Operations.list": "Azure.ResourceManager.Operations.list",
64+
"azure.mgmt.monitor.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list",
65+
"azure.mgmt.monitor.operations.AzureMonitorWorkspacesOperations.get": "Microsoft.Monitor.AzureMonitorWorkspaces.get",
66+
"azure.mgmt.monitor.aio.operations.AzureMonitorWorkspacesOperations.get": "Microsoft.Monitor.AzureMonitorWorkspaces.get",
67+
"azure.mgmt.monitor.operations.AzureMonitorWorkspacesOperations.begin_create_or_update": "Microsoft.Monitor.AzureMonitorWorkspaces.createOrUpdate",
68+
"azure.mgmt.monitor.aio.operations.AzureMonitorWorkspacesOperations.begin_create_or_update": "Microsoft.Monitor.AzureMonitorWorkspaces.createOrUpdate",
69+
"azure.mgmt.monitor.operations.AzureMonitorWorkspacesOperations.update": "Microsoft.Monitor.AzureMonitorWorkspaces.update",
70+
"azure.mgmt.monitor.aio.operations.AzureMonitorWorkspacesOperations.update": "Microsoft.Monitor.AzureMonitorWorkspaces.update",
71+
"azure.mgmt.monitor.operations.AzureMonitorWorkspacesOperations.begin_delete": "Microsoft.Monitor.AzureMonitorWorkspaces.delete",
72+
"azure.mgmt.monitor.aio.operations.AzureMonitorWorkspacesOperations.begin_delete": "Microsoft.Monitor.AzureMonitorWorkspaces.delete",
73+
"azure.mgmt.monitor.operations.AzureMonitorWorkspacesOperations.list_by_resource_group": "Microsoft.Monitor.AzureMonitorWorkspaces.listByResourceGroup",
74+
"azure.mgmt.monitor.aio.operations.AzureMonitorWorkspacesOperations.list_by_resource_group": "Microsoft.Monitor.AzureMonitorWorkspaces.listByResourceGroup",
75+
"azure.mgmt.monitor.operations.AzureMonitorWorkspacesOperations.list_by_subscription": "Microsoft.Monitor.AzureMonitorWorkspaces.listBySubscription",
76+
"azure.mgmt.monitor.aio.operations.AzureMonitorWorkspacesOperations.list_by_subscription": "Microsoft.Monitor.AzureMonitorWorkspaces.listBySubscription",
77+
"azure.mgmt.monitor.operations.PipelineGroupsOperations.get": "Microsoft.Monitor.PipelineGroups.get",
78+
"azure.mgmt.monitor.aio.operations.PipelineGroupsOperations.get": "Microsoft.Monitor.PipelineGroups.get",
79+
"azure.mgmt.monitor.operations.PipelineGroupsOperations.begin_create_or_update": "Microsoft.Monitor.PipelineGroups.createOrUpdate",
80+
"azure.mgmt.monitor.aio.operations.PipelineGroupsOperations.begin_create_or_update": "Microsoft.Monitor.PipelineGroups.createOrUpdate",
81+
"azure.mgmt.monitor.operations.PipelineGroupsOperations.begin_delete": "Microsoft.Monitor.PipelineGroups.delete",
82+
"azure.mgmt.monitor.aio.operations.PipelineGroupsOperations.begin_delete": "Microsoft.Monitor.PipelineGroups.delete",
83+
"azure.mgmt.monitor.operations.PipelineGroupsOperations.begin_update": "Microsoft.Monitor.PipelineGroups.update",
84+
"azure.mgmt.monitor.aio.operations.PipelineGroupsOperations.begin_update": "Microsoft.Monitor.PipelineGroups.update",
85+
"azure.mgmt.monitor.operations.PipelineGroupsOperations.list_by_resource_group": "Microsoft.Monitor.PipelineGroups.listByResourceGroup",
86+
"azure.mgmt.monitor.aio.operations.PipelineGroupsOperations.list_by_resource_group": "Microsoft.Monitor.PipelineGroups.listByResourceGroup",
87+
"azure.mgmt.monitor.operations.PipelineGroupsOperations.list_by_subscription": "Microsoft.Monitor.PipelineGroups.listBySubscription",
88+
"azure.mgmt.monitor.aio.operations.PipelineGroupsOperations.list_by_subscription": "Microsoft.Monitor.PipelineGroups.listBySubscription"
89+
}
90+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88
# pylint: disable=wrong-import-position
@@ -12,7 +12,7 @@
1212
if TYPE_CHECKING:
1313
from ._patch import * # pylint: disable=unused-wildcard-import
1414

15-
from ._monitor_management_client import MonitorManagementClient # type: ignore
15+
from ._client import MonitorManagementClient # type: ignore
1616
from ._version import VERSION
1717

1818
__version__ = VERSION
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from ._configuration import MonitorManagementClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import AzureMonitorWorkspacesOperations, Operations, PipelineGroupsOperations
23+
24+
if TYPE_CHECKING:
25+
from azure.core.credentials import TokenCredential
26+
27+
28+
class MonitorManagementClient:
29+
"""Provides operations for working with Azure Monitor.
30+
31+
:ivar operations: Operations operations
32+
:vartype operations: azure.mgmt.monitor.operations.Operations
33+
:ivar azure_monitor_workspaces: AzureMonitorWorkspacesOperations operations
34+
:vartype azure_monitor_workspaces:
35+
azure.mgmt.monitor.operations.AzureMonitorWorkspacesOperations
36+
:ivar pipeline_groups: PipelineGroupsOperations operations
37+
:vartype pipeline_groups: azure.mgmt.monitor.operations.PipelineGroupsOperations
38+
:param credential: Credential used to authenticate requests to the service. Required.
39+
:type credential: ~azure.core.credentials.TokenCredential
40+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
41+
:type subscription_id: str
42+
:param base_url: Service host. Default value is None.
43+
:type base_url: str
44+
:keyword api_version: The API version to use for this operation. Default value is
45+
"2023-10-01-preview". Note that overriding this default value may result in unsupported
46+
behavior.
47+
:paramtype api_version: str
48+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
49+
Retry-After header is present.
50+
"""
51+
52+
def __init__(
53+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
54+
) -> None:
55+
_endpoint = "{endpoint}"
56+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
57+
_endpoints = get_arm_endpoints(_cloud)
58+
if not base_url:
59+
base_url = _endpoints["resource_manager"]
60+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
61+
self._config = MonitorManagementClientConfiguration(
62+
credential=credential,
63+
subscription_id=subscription_id,
64+
base_url=cast(str, base_url),
65+
credential_scopes=credential_scopes,
66+
**kwargs
67+
)
68+
69+
_policies = kwargs.pop("policies", None)
70+
if _policies is None:
71+
_policies = [
72+
policies.RequestIdPolicy(**kwargs),
73+
self._config.headers_policy,
74+
self._config.user_agent_policy,
75+
self._config.proxy_policy,
76+
policies.ContentDecodePolicy(**kwargs),
77+
ARMAutoResourceProviderRegistrationPolicy(),
78+
self._config.redirect_policy,
79+
self._config.retry_policy,
80+
self._config.authentication_policy,
81+
self._config.custom_hook_policy,
82+
self._config.logging_policy,
83+
policies.DistributedTracingPolicy(**kwargs),
84+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
85+
self._config.http_logging_policy,
86+
]
87+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
88+
89+
self._serialize = Serializer()
90+
self._deserialize = Deserializer()
91+
self._serialize.client_side_validation = False
92+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
93+
self.azure_monitor_workspaces = AzureMonitorWorkspacesOperations(
94+
self._client, self._config, self._serialize, self._deserialize
95+
)
96+
self.pipeline_groups = PipelineGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
97+
98+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
99+
"""Runs the network request through the client's chained policies.
100+
101+
>>> from azure.core.rest import HttpRequest
102+
>>> request = HttpRequest("GET", "https://www.example.org/")
103+
<HttpRequest [GET], url: 'https://www.example.org/'>
104+
>>> response = client.send_request(request)
105+
<HttpResponse: 200 OK>
106+
107+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
108+
109+
:param request: The network request you want to make. Required.
110+
:type request: ~azure.core.rest.HttpRequest
111+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
112+
:return: The response of your network call. Does not do error handling on your response.
113+
:rtype: ~azure.core.rest.HttpResponse
114+
"""
115+
116+
request_copy = deepcopy(request)
117+
path_format_arguments = {
118+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
119+
}
120+
121+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
122+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
123+
124+
def close(self) -> None:
125+
self._client.close()
126+
127+
def __enter__(self) -> Self:
128+
self._client.__enter__()
129+
return self
130+
131+
def __exit__(self, *exc_details: Any) -> None:
132+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)