9
9
from copy import deepcopy
10
10
from typing import Any , TYPE_CHECKING
11
11
12
+ from azure .core .pipeline import policies
12
13
from azure .core .rest import HttpRequest , HttpResponse
13
14
from azure .mgmt .core import ARMPipelineClient
15
+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
14
16
15
17
from . import models as _models
16
18
from ._configuration import DataProtectionMgmtClientConfiguration
17
19
from ._serialization import Deserializer , Serializer
18
20
from .operations import (
21
+ BackupInstancesExtensionRoutingOperations ,
19
22
BackupInstancesOperations ,
20
23
BackupPoliciesOperations ,
21
24
BackupVaultOperationResultsOperations ,
@@ -84,6 +87,9 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
84
87
:ivar fetch_cross_region_restore_jobs: FetchCrossRegionRestoreJobsOperations operations
85
88
:vartype fetch_cross_region_restore_jobs:
86
89
azure.mgmt.dataprotection.operations.FetchCrossRegionRestoreJobsOperations
90
+ :ivar backup_instances_extension_routing: BackupInstancesExtensionRoutingOperations operations
91
+ :vartype backup_instances_extension_routing:
92
+ azure.mgmt.dataprotection.operations.BackupInstancesExtensionRoutingOperations
87
93
:ivar jobs: JobsOperations operations
88
94
:vartype jobs: azure.mgmt.dataprotection.operations.JobsOperations
89
95
:ivar restorable_time_ranges: RestorableTimeRangesOperations operations
@@ -108,7 +114,7 @@ class DataProtectionMgmtClient: # pylint: disable=client-accepts-api-version-ke
108
114
:type subscription_id: str
109
115
:param base_url: Service URL. Default value is "https://management.azure.com".
110
116
:type base_url: str
111
- :keyword api_version: Api Version. Default value is "2023-11 -01". Note that overriding this
117
+ :keyword api_version: Api Version. Default value is "2024-04 -01". Note that overriding this
112
118
default value may result in unsupported behavior.
113
119
:paramtype api_version: str
114
120
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -125,7 +131,25 @@ def __init__(
125
131
self ._config = DataProtectionMgmtClientConfiguration (
126
132
credential = credential , subscription_id = subscription_id , ** kwargs
127
133
)
128
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
134
+ _policies = kwargs .pop ("policies" , None )
135
+ if _policies is None :
136
+ _policies = [
137
+ policies .RequestIdPolicy (** kwargs ),
138
+ self ._config .headers_policy ,
139
+ self ._config .user_agent_policy ,
140
+ self ._config .proxy_policy ,
141
+ policies .ContentDecodePolicy (** kwargs ),
142
+ ARMAutoResourceProviderRegistrationPolicy (),
143
+ self ._config .redirect_policy ,
144
+ self ._config .retry_policy ,
145
+ self ._config .authentication_policy ,
146
+ self ._config .custom_hook_policy ,
147
+ self ._config .logging_policy ,
148
+ policies .DistributedTracingPolicy (** kwargs ),
149
+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
150
+ self ._config .http_logging_policy ,
151
+ ]
152
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
129
153
130
154
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
131
155
self ._serialize = Serializer (client_models )
@@ -165,6 +189,9 @@ def __init__(
165
189
self .fetch_cross_region_restore_jobs = FetchCrossRegionRestoreJobsOperations (
166
190
self ._client , self ._config , self ._serialize , self ._deserialize
167
191
)
192
+ self .backup_instances_extension_routing = BackupInstancesExtensionRoutingOperations (
193
+ self ._client , self ._config , self ._serialize , self ._deserialize
194
+ )
168
195
self .jobs = JobsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
169
196
self .restorable_time_ranges = RestorableTimeRangesOperations (
170
197
self ._client , self ._config , self ._serialize , self ._deserialize
@@ -181,7 +208,7 @@ def __init__(
181
208
self ._client , self ._config , self ._serialize , self ._deserialize
182
209
)
183
210
184
- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
211
+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
185
212
"""Runs the network request through the client's chained policies.
186
213
187
214
>>> from azure.core.rest import HttpRequest
@@ -201,7 +228,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
201
228
202
229
request_copy = deepcopy (request )
203
230
request_copy .url = self ._client .format_url (request_copy .url )
204
- return self ._client .send_request (request_copy , ** kwargs )
231
+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
205
232
206
233
def close (self ) -> None :
207
234
self ._client .close ()
0 commit comments