7
7
# --------------------------------------------------------------------------
8
8
9
9
from copy import deepcopy
10
- from typing import Any , TYPE_CHECKING
10
+ from typing import Any , Optional , TYPE_CHECKING , cast
11
11
from typing_extensions import Self
12
12
13
13
from azure .core .pipeline import policies
14
14
from azure .core .rest import HttpRequest , HttpResponse
15
+ from azure .core .settings import settings
15
16
from azure .mgmt .core import ARMPipelineClient
16
17
from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
18
+ from azure .mgmt .core .tools import get_arm_endpoints
17
19
18
20
from . import models as _models
19
21
from ._configuration import PostgreSQLManagementClientConfiguration
20
- from ._serialization import Deserializer , Serializer
22
+ from ._utils . serialization import Deserializer , Serializer
21
23
from .operations import (
22
24
AdministratorsOperations ,
23
25
BackupsOperations ,
37
39
PrivateEndpointConnectionOperations ,
38
40
PrivateEndpointConnectionsOperations ,
39
41
PrivateLinkResourcesOperations ,
42
+ QuotaUsagesOperations ,
40
43
ReplicasOperations ,
41
44
ServerCapabilitiesOperations ,
42
45
ServerThreatProtectionSettingsOperations ,
43
46
ServersOperations ,
47
+ TuningConfigurationOperations ,
48
+ TuningIndexOperations ,
49
+ TuningOptionsOperations ,
44
50
VirtualEndpointsOperations ,
45
51
VirtualNetworkSubnetUsageOperations ,
46
52
)
@@ -106,13 +112,23 @@ class PostgreSQLManagementClient(
106
112
:ivar private_link_resources: PrivateLinkResourcesOperations operations
107
113
:vartype private_link_resources:
108
114
azure.mgmt.postgresqlflexibleservers.operations.PrivateLinkResourcesOperations
115
+ :ivar quota_usages: QuotaUsagesOperations operations
116
+ :vartype quota_usages: azure.mgmt.postgresqlflexibleservers.operations.QuotaUsagesOperations
109
117
:ivar replicas: ReplicasOperations operations
110
118
:vartype replicas: azure.mgmt.postgresqlflexibleservers.operations.ReplicasOperations
111
119
:ivar log_files: LogFilesOperations operations
112
120
:vartype log_files: azure.mgmt.postgresqlflexibleservers.operations.LogFilesOperations
113
121
:ivar server_threat_protection_settings: ServerThreatProtectionSettingsOperations operations
114
122
:vartype server_threat_protection_settings:
115
123
azure.mgmt.postgresqlflexibleservers.operations.ServerThreatProtectionSettingsOperations
124
+ :ivar tuning_options: TuningOptionsOperations operations
125
+ :vartype tuning_options:
126
+ azure.mgmt.postgresqlflexibleservers.operations.TuningOptionsOperations
127
+ :ivar tuning_index: TuningIndexOperations operations
128
+ :vartype tuning_index: azure.mgmt.postgresqlflexibleservers.operations.TuningIndexOperations
129
+ :ivar tuning_configuration: TuningConfigurationOperations operations
130
+ :vartype tuning_configuration:
131
+ azure.mgmt.postgresqlflexibleservers.operations.TuningConfigurationOperations
116
132
:ivar virtual_endpoints: VirtualEndpointsOperations operations
117
133
:vartype virtual_endpoints:
118
134
azure.mgmt.postgresqlflexibleservers.operations.VirtualEndpointsOperations
@@ -123,25 +139,27 @@ class PostgreSQLManagementClient(
123
139
:type credential: ~azure.core.credentials.TokenCredential
124
140
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
125
141
:type subscription_id: str
126
- :param base_url: Service URL. Default value is "https://management.azure.com" .
142
+ :param base_url: Service URL. Default value is None .
127
143
:type base_url: str
128
- :keyword api_version: Api Version. Default value is "2024-08 -01". Note that overriding this
129
- default value may result in unsupported behavior.
144
+ :keyword api_version: Api Version. Default value is "2025-01 -01-preview ". Note that overriding
145
+ this default value may result in unsupported behavior.
130
146
:paramtype api_version: str
131
147
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
132
148
Retry-After header is present.
133
149
"""
134
150
135
151
def __init__ (
136
- self ,
137
- credential : "TokenCredential" ,
138
- subscription_id : str ,
139
- base_url : str = "https://management.azure.com" ,
140
- ** kwargs : Any
152
+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
141
153
) -> None :
154
+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
155
+ _endpoints = get_arm_endpoints (_cloud )
156
+ if not base_url :
157
+ base_url = _endpoints ["resource_manager" ]
158
+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
142
159
self ._config = PostgreSQLManagementClientConfiguration (
143
- credential = credential , subscription_id = subscription_id , ** kwargs
160
+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
144
161
)
162
+
145
163
_policies = kwargs .pop ("policies" , None )
146
164
if _policies is None :
147
165
_policies = [
@@ -160,7 +178,7 @@ def __init__(
160
178
policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
161
179
self ._config .http_logging_policy ,
162
180
]
163
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
181
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
164
182
165
183
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
166
184
self ._serialize = Serializer (client_models )
@@ -202,11 +220,17 @@ def __init__(
202
220
self .private_link_resources = PrivateLinkResourcesOperations (
203
221
self ._client , self ._config , self ._serialize , self ._deserialize
204
222
)
223
+ self .quota_usages = QuotaUsagesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
205
224
self .replicas = ReplicasOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
206
225
self .log_files = LogFilesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
207
226
self .server_threat_protection_settings = ServerThreatProtectionSettingsOperations (
208
227
self ._client , self ._config , self ._serialize , self ._deserialize
209
228
)
229
+ self .tuning_options = TuningOptionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
230
+ self .tuning_index = TuningIndexOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
231
+ self .tuning_configuration = TuningConfigurationOperations (
232
+ self ._client , self ._config , self ._serialize , self ._deserialize
233
+ )
210
234
self .virtual_endpoints = VirtualEndpointsOperations (
211
235
self ._client , self ._config , self ._serialize , self ._deserialize
212
236
)
0 commit comments