Skip to content

Commit a15ae15

Browse files
author
SDKAuto
committed
CodeGen from PR 31112 in Azure/azure-rest-api-specs
Merge cc24896b112eb55d2d95dda0cb1e03252588df15 into 637adebd6042eab6c721be8eda4ff3f5d4d0c2b8
1 parent 9d96133 commit a15ae15

File tree

159 files changed

+9694
-2136
lines changed

Some content is hidden

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

159 files changed

+9694
-2136
lines changed

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

Lines changed: 2 additions & 5 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 Elastic Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
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.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -59,6 +59,3 @@ Code samples for this package can be found at:
5959
If you encounter any bugs or have suggestions, please file an issue in the
6060
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6161
section of the project.
62-
63-
64-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-elastic%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "1f449b5a17448f05ce1cd914f8ed75a0b568d130",
2+
"commit": "7ec172fb12d6683a568b81acc1e89fa3ac01e979",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.4.8",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.19.0",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/elastic/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/elastic/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.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/elastic/resource-manager/readme.md"
1111
}

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

@@ -19,25 +18,23 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class MicrosoftElasticConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class MicrosoftElasticConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for MicrosoftElastic.
2423
2524
Note that all parameters used to create this instance are saved as instance
2625
attributes.
2726
2827
:param credential: Credential needed for the client to connect to Azure. Required.
2928
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
31-
00000000-0000-0000-0000-000000000000). Required.
29+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3230
:type subscription_id: str
33-
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
31+
:keyword api_version: Api Version. Default value is "2024-10-01-preview". Note that overriding
3432
this default value may result in unsupported behavior.
3533
:paramtype api_version: str
3634
"""
3735

3836
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
39-
super(MicrosoftElasticConfiguration, self).__init__(**kwargs)
40-
api_version: str = kwargs.pop("api_version", "2023-02-01-preview")
37+
api_version: str = kwargs.pop("api_version", "2024-10-01-preview")
4138

4239
if credential is None:
4340
raise ValueError("Parameter 'credential' must not be None.")
@@ -49,6 +46,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4946
self.api_version = api_version
5047
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5148
kwargs.setdefault("sdk_moniker", "mgmt-elastic/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
5250
self._configure(**kwargs)
5351

5452
def _configure(self, **kwargs: Any) -> None:
@@ -57,9 +55,9 @@ def _configure(self, **kwargs: Any) -> None:
5755
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5856
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5957
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
60-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6158
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6259
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6361
self.authentication_policy = kwargs.get("authentication_policy")
6462
if self.credential and not self.authentication_policy:
6563
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/elastic/azure-mgmt-elastic/azure/mgmt/elastic/_microsoft_elastic.py

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,21 @@
88

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
1315
from azure.mgmt.core import ARMPipelineClient
16+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1417

1518
from . import models as _models
1619
from ._configuration import MicrosoftElasticConfiguration
1720
from ._serialization import Deserializer, Serializer
1821
from .operations import (
1922
AllTrafficFiltersOperations,
2023
AssociateTrafficFilterOperations,
24+
BillingInfoOperations,
25+
ConnectedPartnerResourcesOperations,
2126
CreateAndAssociateIPFilterOperations,
2227
CreateAndAssociatePLFilterOperations,
2328
DeploymentInfoOperations,
@@ -28,7 +33,9 @@
2833
ListAssociatedTrafficFiltersOperations,
2934
MonitorOperations,
3035
MonitoredResourcesOperations,
36+
MonitoredSubscriptionsOperations,
3137
MonitorsOperations,
38+
OpenAIOperations,
3239
Operations,
3340
OrganizationsOperations,
3441
TagRulesOperations,
@@ -53,12 +60,22 @@ class MicrosoftElastic: # pylint: disable=client-accepts-api-version-keyword,to
5360
:vartype monitors: azure.mgmt.elastic.operations.MonitorsOperations
5461
:ivar elastic_versions: ElasticVersionsOperations operations
5562
:vartype elastic_versions: azure.mgmt.elastic.operations.ElasticVersionsOperations
63+
:ivar monitored_subscriptions: MonitoredSubscriptionsOperations operations
64+
:vartype monitored_subscriptions:
65+
azure.mgmt.elastic.operations.MonitoredSubscriptionsOperations
5666
:ivar monitored_resources: MonitoredResourcesOperations operations
5767
:vartype monitored_resources: azure.mgmt.elastic.operations.MonitoredResourcesOperations
5868
:ivar deployment_info: DeploymentInfoOperations operations
5969
:vartype deployment_info: azure.mgmt.elastic.operations.DeploymentInfoOperations
6070
:ivar external_user: ExternalUserOperations operations
6171
:vartype external_user: azure.mgmt.elastic.operations.ExternalUserOperations
72+
:ivar billing_info: BillingInfoOperations operations
73+
:vartype billing_info: azure.mgmt.elastic.operations.BillingInfoOperations
74+
:ivar connected_partner_resources: ConnectedPartnerResourcesOperations operations
75+
:vartype connected_partner_resources:
76+
azure.mgmt.elastic.operations.ConnectedPartnerResourcesOperations
77+
:ivar open_ai: OpenAIOperations operations
78+
:vartype open_ai: azure.mgmt.elastic.operations.OpenAIOperations
6279
:ivar tag_rules: TagRulesOperations operations
6380
:vartype tag_rules: azure.mgmt.elastic.operations.TagRulesOperations
6481
:ivar vm_host: VMHostOperations operations
@@ -96,12 +113,11 @@ class MicrosoftElastic: # pylint: disable=client-accepts-api-version-keyword,to
96113
:vartype organizations: azure.mgmt.elastic.operations.OrganizationsOperations
97114
:param credential: Credential needed for the client to connect to Azure. Required.
98115
:type credential: ~azure.core.credentials.TokenCredential
99-
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
100-
00000000-0000-0000-0000-000000000000). Required.
116+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
101117
:type subscription_id: str
102118
:param base_url: Service URL. Default value is "https://management.azure.com".
103119
:type base_url: str
104-
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
120+
:keyword api_version: Api Version. Default value is "2024-10-01-preview". Note that overriding
105121
this default value may result in unsupported behavior.
106122
:paramtype api_version: str
107123
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -116,7 +132,25 @@ def __init__(
116132
**kwargs: Any
117133
) -> None:
118134
self._config = MicrosoftElasticConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
119-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
135+
_policies = kwargs.pop("policies", None)
136+
if _policies is None:
137+
_policies = [
138+
policies.RequestIdPolicy(**kwargs),
139+
self._config.headers_policy,
140+
self._config.user_agent_policy,
141+
self._config.proxy_policy,
142+
policies.ContentDecodePolicy(**kwargs),
143+
ARMAutoResourceProviderRegistrationPolicy(),
144+
self._config.redirect_policy,
145+
self._config.retry_policy,
146+
self._config.authentication_policy,
147+
self._config.custom_hook_policy,
148+
self._config.logging_policy,
149+
policies.DistributedTracingPolicy(**kwargs),
150+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
151+
self._config.http_logging_policy,
152+
]
153+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
120154

121155
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
122156
self._serialize = Serializer(client_models)
@@ -127,11 +161,19 @@ def __init__(
127161
self.elastic_versions = ElasticVersionsOperations(
128162
self._client, self._config, self._serialize, self._deserialize
129163
)
164+
self.monitored_subscriptions = MonitoredSubscriptionsOperations(
165+
self._client, self._config, self._serialize, self._deserialize
166+
)
130167
self.monitored_resources = MonitoredResourcesOperations(
131168
self._client, self._config, self._serialize, self._deserialize
132169
)
133170
self.deployment_info = DeploymentInfoOperations(self._client, self._config, self._serialize, self._deserialize)
134171
self.external_user = ExternalUserOperations(self._client, self._config, self._serialize, self._deserialize)
172+
self.billing_info = BillingInfoOperations(self._client, self._config, self._serialize, self._deserialize)
173+
self.connected_partner_resources = ConnectedPartnerResourcesOperations(
174+
self._client, self._config, self._serialize, self._deserialize
175+
)
176+
self.open_ai = OpenAIOperations(self._client, self._config, self._serialize, self._deserialize)
135177
self.tag_rules = TagRulesOperations(self._client, self._config, self._serialize, self._deserialize)
136178
self.vm_host = VMHostOperations(self._client, self._config, self._serialize, self._deserialize)
137179
self.vm_ingestion = VMIngestionOperations(self._client, self._config, self._serialize, self._deserialize)
@@ -164,7 +206,7 @@ def __init__(
164206
self.traffic_filters = TrafficFiltersOperations(self._client, self._config, self._serialize, self._deserialize)
165207
self.organizations = OrganizationsOperations(self._client, self._config, self._serialize, self._deserialize)
166208

167-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
209+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
168210
"""Runs the network request through the client's chained policies.
169211
170212
>>> from azure.core.rest import HttpRequest
@@ -184,12 +226,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
184226

185227
request_copy = deepcopy(request)
186228
request_copy.url = self._client.format_url(request_copy.url)
187-
return self._client.send_request(request_copy, **kwargs)
229+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
188230

189231
def close(self) -> None:
190232
self._client.close()
191233

192-
def __enter__(self) -> "MicrosoftElastic":
234+
def __enter__(self) -> Self:
193235
self._client.__enter__()
194236
return self
195237

0 commit comments

Comments
 (0)