Skip to content

Commit 4bb8dc9

Browse files
azure-sdksaleelpkCopilot
authored
[AutoPR azure-mgmt-monitorslis]-generated-from-SDK Generation - Python-6195144 (#46478)
* Configurations: 'specification/monitoringservice/resource-manager/Microsoft.Monitor/Slis/tspconfig.yaml', and CommitSHA: 'd32a3f6cc49c6dd6604161f8c7cee7c95a84c578' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6195144 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. * Add verifytypes = false to pyproject.toml * Update CHANGELOG with initial preview features Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove generic Other Changes section from CHANGELOG Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Saleel Kattiyat <sakattiy@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Saleel Kattiyat <88824270+saleelpk@users.noreply.github.com>
1 parent ef03bb7 commit 4bb8dc9

43 files changed

Lines changed: 7177 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Release History
2+
3+
## 1.0.0b1 (2026-04-27)
4+
5+
### Other Changes
6+
7+
- Initial version
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) Microsoft Corporation.
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include *.md
2+
include LICENSE
3+
include azure/mgmt/monitorslis/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/mgmt/__init__.py
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Microsoft Azure SDK for Python
2+
3+
This is the Microsoft Azure Monitorslis Management Client Library.
4+
This package has been tested with Python 3.10+.
5+
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
6+
7+
## _Disclaimer_
8+
9+
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
10+
11+
## Getting started
12+
13+
### Prerequisites
14+
15+
- Python 3.10+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
17+
18+
### Install the package
19+
20+
```bash
21+
pip install azure-mgmt-monitorslis
22+
pip install azure-identity
23+
```
24+
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
With above configuration, client can be authenticated by following code:
34+
35+
```python
36+
from azure.identity import DefaultAzureCredential
37+
from azure.mgmt.monitorslis import MonitorSlisMgmtClient
38+
39+
client = MonitorSlisMgmtClient(credential=DefaultAzureCredential())
40+
```
41+
42+
## Examples
43+
44+
Code samples for this package can be found at:
45+
- [Search Monitorslis Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
46+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
47+
48+
49+
## Troubleshooting
50+
51+
## Next steps
52+
53+
## Provide Feedback
54+
55+
If you encounter any bugs or have suggestions, please file an issue in the
56+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
57+
section of the project.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"apiVersion": "2025-03-01-preview",
3+
"apiVersions": {
4+
"Microsoft.Monitor": "2025-03-01-preview"
5+
},
6+
"commit": "fa74a24ebfcd57429a95ef827b06eae0e639800a",
7+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
8+
"typespec_src": "specification/monitoringservice/resource-manager/Microsoft.Monitor/Slis",
9+
"emitterVersion": "0.61.3"
10+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.Monitor",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.monitorslis.models.AmwAccount": "Microsoft.Monitor.AmwAccount",
5+
"azure.mgmt.monitorslis.models.Baseline": "Microsoft.Monitor.Baseline",
6+
"azure.mgmt.monitorslis.models.BaselineProperties": "Microsoft.Monitor.BaselineProperties",
7+
"azure.mgmt.monitorslis.models.Condition": "Microsoft.Monitor.Condition",
8+
"azure.mgmt.monitorslis.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo",
9+
"azure.mgmt.monitorslis.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail",
10+
"azure.mgmt.monitorslis.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse",
11+
"azure.mgmt.monitorslis.models.ExecutionState": "Microsoft.Monitor.ExecutionState",
12+
"azure.mgmt.monitorslis.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity",
13+
"azure.mgmt.monitorslis.models.Metric": "Microsoft.Monitor.Metric",
14+
"azure.mgmt.monitorslis.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
15+
"azure.mgmt.monitorslis.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource",
16+
"azure.mgmt.monitorslis.models.Signal": "Microsoft.Monitor.Signal",
17+
"azure.mgmt.monitorslis.models.SignalSource": "Microsoft.Monitor.SignalSource",
18+
"azure.mgmt.monitorslis.models.Sli": "Microsoft.Monitor.Sli",
19+
"azure.mgmt.monitorslis.models.SliProperties": "Microsoft.Monitor.SliProperties",
20+
"azure.mgmt.monitorslis.models.SliResource": "Microsoft.Monitor.SliResource",
21+
"azure.mgmt.monitorslis.models.SpatialAggregation": "Microsoft.Monitor.SpatialAggregation",
22+
"azure.mgmt.monitorslis.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
23+
"azure.mgmt.monitorslis.models.TemporalAggregation": "Microsoft.Monitor.TemporalAggregation",
24+
"azure.mgmt.monitorslis.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity",
25+
"azure.mgmt.monitorslis.models.WindowUptimeCriteria": "Microsoft.Monitor.WindowUptimeCriteria",
26+
"azure.mgmt.monitorslis.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
27+
"azure.mgmt.monitorslis.models.ProvisioningState": "Microsoft.Monitor.ProvisioningState",
28+
"azure.mgmt.monitorslis.models.Category": "Microsoft.Monitor.Category",
29+
"azure.mgmt.monitorslis.models.EvaluationType": "Microsoft.Monitor.EvaluationType",
30+
"azure.mgmt.monitorslis.models.EvaluationCalculationType": "Microsoft.Monitor.EvaluationCalculationType",
31+
"azure.mgmt.monitorslis.models.ScalarFunction": "Microsoft.Monitor.ScalarFunction",
32+
"azure.mgmt.monitorslis.models.SamplingType": "Microsoft.Monitor.SamplingType",
33+
"azure.mgmt.monitorslis.models.ConditionOperator": "Microsoft.Monitor.ConditionOperator",
34+
"azure.mgmt.monitorslis.models.SpatialAggregationType": "Microsoft.Monitor.SpatialAggregationType",
35+
"azure.mgmt.monitorslis.models.TemporalAggregationType": "Microsoft.Monitor.TemporalAggregationType",
36+
"azure.mgmt.monitorslis.models.WindowUptimeCriteriaComparator": "Microsoft.Monitor.WindowUptimeCriteriaComparator",
37+
"azure.mgmt.monitorslis.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType",
38+
"azure.mgmt.monitorslis.operations.SlisOperations.get": "Microsoft.Monitor.Slis.get",
39+
"azure.mgmt.monitorslis.aio.operations.SlisOperations.get": "Microsoft.Monitor.Slis.get",
40+
"azure.mgmt.monitorslis.operations.SlisOperations.create_or_update": "Microsoft.Monitor.Slis.createOrUpdate",
41+
"azure.mgmt.monitorslis.aio.operations.SlisOperations.create_or_update": "Microsoft.Monitor.Slis.createOrUpdate",
42+
"azure.mgmt.monitorslis.operations.SlisOperations.delete": "Microsoft.Monitor.Slis.delete",
43+
"azure.mgmt.monitorslis.aio.operations.SlisOperations.delete": "Microsoft.Monitor.Slis.delete",
44+
"azure.mgmt.monitorslis.operations.SlisOperations.list_by_parent": "Microsoft.Monitor.Slis.listByParent",
45+
"azure.mgmt.monitorslis.aio.operations.SlisOperations.list_by_parent": "Microsoft.Monitor.Slis.listByParent"
46+
}
47+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
# pylint: disable=wrong-import-position
9+
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import MonitorSlisMgmtClient # type: ignore
16+
from ._version import VERSION
17+
18+
__version__ = VERSION
19+
20+
try:
21+
from ._patch import __all__ as _patch_all
22+
from ._patch import *
23+
except ImportError:
24+
_patch_all = []
25+
from ._patch import patch_sdk as _patch_sdk
26+
27+
__all__ = [
28+
"MonitorSlisMgmtClient",
29+
]
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
31+
32+
_patch_sdk()
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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 MonitorSlisMgmtClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import SlisOperations
23+
24+
if TYPE_CHECKING:
25+
from azure.core import AzureClouds
26+
from azure.core.credentials import TokenCredential
27+
28+
29+
class MonitorSlisMgmtClient:
30+
"""MonitorSlisMgmtClient.
31+
32+
:ivar slis: SlisOperations operations
33+
:vartype slis: azure.mgmt.monitorslis.operations.SlisOperations
34+
:param credential: Credential used to authenticate requests to the service. Required.
35+
:type credential: ~azure.core.credentials.TokenCredential
36+
:param base_url: Service host. Default value is None.
37+
:type base_url: str
38+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
39+
None.
40+
:paramtype cloud_setting: ~azure.core.AzureClouds
41+
:keyword api_version: The API version to use for this operation. Known values are
42+
"2025-03-01-preview". Default value is "2025-03-01-preview". Note that overriding this default
43+
value may result in unsupported behavior.
44+
:paramtype api_version: str
45+
"""
46+
47+
def __init__(
48+
self,
49+
credential: "TokenCredential",
50+
base_url: Optional[str] = None,
51+
*,
52+
cloud_setting: Optional["AzureClouds"] = None,
53+
**kwargs: Any
54+
) -> None:
55+
_endpoint = "{endpoint}"
56+
_cloud = cloud_setting 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 = MonitorSlisMgmtClientConfiguration(
62+
credential=credential,
63+
base_url=cast(str, base_url),
64+
cloud_setting=cloud_setting,
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.slis = SlisOperations(self._client, self._config, self._serialize, self._deserialize)
93+
94+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
95+
"""Runs the network request through the client's chained policies.
96+
97+
>>> from azure.core.rest import HttpRequest
98+
>>> request = HttpRequest("GET", "https://www.example.org/")
99+
<HttpRequest [GET], url: 'https://www.example.org/'>
100+
>>> response = client.send_request(request)
101+
<HttpResponse: 200 OK>
102+
103+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
104+
105+
:param request: The network request you want to make. Required.
106+
:type request: ~azure.core.rest.HttpRequest
107+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
108+
:return: The response of your network call. Does not do error handling on your response.
109+
:rtype: ~azure.core.rest.HttpResponse
110+
"""
111+
112+
request_copy = deepcopy(request)
113+
path_format_arguments = {
114+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
115+
}
116+
117+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
118+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
119+
120+
def close(self) -> None:
121+
self._client.close()
122+
123+
def __enter__(self) -> Self:
124+
self._client.__enter__()
125+
return self
126+
127+
def __exit__(self, *exc_details: Any) -> None:
128+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)