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 NetAppManagementClientConfiguration
17
19
from ._serialization import Deserializer , Serializer
18
20
from .operations import (
19
21
AccountsOperations ,
20
22
BackupPoliciesOperations ,
23
+ BackupVaultsOperations ,
21
24
BackupsOperations ,
25
+ BackupsUnderAccountOperations ,
26
+ BackupsUnderBackupVaultOperations ,
27
+ BackupsUnderVolumeOperations ,
22
28
NetAppResourceOperations ,
23
29
NetAppResourceQuotaLimitsOperations ,
30
+ NetAppResourceRegionInfosOperations ,
24
31
Operations ,
25
32
PoolsOperations ,
26
33
SnapshotPoliciesOperations ,
@@ -46,6 +53,9 @@ class NetAppManagementClient: # pylint: disable=client-accepts-api-version-keyw
46
53
:ivar net_app_resource_quota_limits: NetAppResourceQuotaLimitsOperations operations
47
54
:vartype net_app_resource_quota_limits:
48
55
azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsOperations
56
+ :ivar net_app_resource_region_infos: NetAppResourceRegionInfosOperations operations
57
+ :vartype net_app_resource_region_infos:
58
+ azure.mgmt.netapp.operations.NetAppResourceRegionInfosOperations
49
59
:ivar accounts: AccountsOperations operations
50
60
:vartype accounts: azure.mgmt.netapp.operations.AccountsOperations
51
61
:ivar pools: PoolsOperations operations
@@ -56,8 +66,6 @@ class NetAppManagementClient: # pylint: disable=client-accepts-api-version-keyw
56
66
:vartype snapshots: azure.mgmt.netapp.operations.SnapshotsOperations
57
67
:ivar snapshot_policies: SnapshotPoliciesOperations operations
58
68
:vartype snapshot_policies: azure.mgmt.netapp.operations.SnapshotPoliciesOperations
59
- :ivar backups: BackupsOperations operations
60
- :vartype backups: azure.mgmt.netapp.operations.BackupsOperations
61
69
:ivar backup_policies: BackupPoliciesOperations operations
62
70
:vartype backup_policies: azure.mgmt.netapp.operations.BackupPoliciesOperations
63
71
:ivar volume_quota_rules: VolumeQuotaRulesOperations operations
@@ -66,13 +74,24 @@ class NetAppManagementClient: # pylint: disable=client-accepts-api-version-keyw
66
74
:vartype volume_groups: azure.mgmt.netapp.operations.VolumeGroupsOperations
67
75
:ivar subvolumes: SubvolumesOperations operations
68
76
:vartype subvolumes: azure.mgmt.netapp.operations.SubvolumesOperations
77
+ :ivar backups: BackupsOperations operations
78
+ :vartype backups: azure.mgmt.netapp.operations.BackupsOperations
79
+ :ivar backup_vaults: BackupVaultsOperations operations
80
+ :vartype backup_vaults: azure.mgmt.netapp.operations.BackupVaultsOperations
81
+ :ivar backups_under_backup_vault: BackupsUnderBackupVaultOperations operations
82
+ :vartype backups_under_backup_vault:
83
+ azure.mgmt.netapp.operations.BackupsUnderBackupVaultOperations
84
+ :ivar backups_under_volume: BackupsUnderVolumeOperations operations
85
+ :vartype backups_under_volume: azure.mgmt.netapp.operations.BackupsUnderVolumeOperations
86
+ :ivar backups_under_account: BackupsUnderAccountOperations operations
87
+ :vartype backups_under_account: azure.mgmt.netapp.operations.BackupsUnderAccountOperations
69
88
:param credential: Credential needed for the client to connect to Azure. Required.
70
89
:type credential: ~azure.core.credentials.TokenCredential
71
90
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
72
91
:type subscription_id: str
73
92
:param base_url: Service URL. Default value is "https://management.azure.com".
74
93
:type base_url: str
75
- :keyword api_version: Api Version. Default value is "2023-07 -01". Note that overriding this
94
+ :keyword api_version: Api Version. Default value is "2023-11 -01". Note that overriding this
76
95
default value may result in unsupported behavior.
77
96
:paramtype api_version: str
78
97
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -89,7 +108,25 @@ def __init__(
89
108
self ._config = NetAppManagementClientConfiguration (
90
109
credential = credential , subscription_id = subscription_id , ** kwargs
91
110
)
92
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
111
+ _policies = kwargs .pop ("policies" , None )
112
+ if _policies is None :
113
+ _policies = [
114
+ policies .RequestIdPolicy (** kwargs ),
115
+ self ._config .headers_policy ,
116
+ self ._config .user_agent_policy ,
117
+ self ._config .proxy_policy ,
118
+ policies .ContentDecodePolicy (** kwargs ),
119
+ ARMAutoResourceProviderRegistrationPolicy (),
120
+ self ._config .redirect_policy ,
121
+ self ._config .retry_policy ,
122
+ self ._config .authentication_policy ,
123
+ self ._config .custom_hook_policy ,
124
+ self ._config .logging_policy ,
125
+ policies .DistributedTracingPolicy (** kwargs ),
126
+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
127
+ self ._config .http_logging_policy ,
128
+ ]
129
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
93
130
94
131
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
95
132
self ._serialize = Serializer (client_models )
@@ -100,22 +137,35 @@ def __init__(
100
137
self .net_app_resource_quota_limits = NetAppResourceQuotaLimitsOperations (
101
138
self ._client , self ._config , self ._serialize , self ._deserialize
102
139
)
140
+ self .net_app_resource_region_infos = NetAppResourceRegionInfosOperations (
141
+ self ._client , self ._config , self ._serialize , self ._deserialize
142
+ )
103
143
self .accounts = AccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
104
144
self .pools = PoolsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
105
145
self .volumes = VolumesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
106
146
self .snapshots = SnapshotsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
107
147
self .snapshot_policies = SnapshotPoliciesOperations (
108
148
self ._client , self ._config , self ._serialize , self ._deserialize
109
149
)
110
- self .backups = BackupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
111
150
self .backup_policies = BackupPoliciesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
112
151
self .volume_quota_rules = VolumeQuotaRulesOperations (
113
152
self ._client , self ._config , self ._serialize , self ._deserialize
114
153
)
115
154
self .volume_groups = VolumeGroupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
116
155
self .subvolumes = SubvolumesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
156
+ self .backups = BackupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
157
+ self .backup_vaults = BackupVaultsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
158
+ self .backups_under_backup_vault = BackupsUnderBackupVaultOperations (
159
+ self ._client , self ._config , self ._serialize , self ._deserialize
160
+ )
161
+ self .backups_under_volume = BackupsUnderVolumeOperations (
162
+ self ._client , self ._config , self ._serialize , self ._deserialize
163
+ )
164
+ self .backups_under_account = BackupsUnderAccountOperations (
165
+ self ._client , self ._config , self ._serialize , self ._deserialize
166
+ )
117
167
118
- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
168
+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
119
169
"""Runs the network request through the client's chained policies.
120
170
121
171
>>> from azure.core.rest import HttpRequest
@@ -135,7 +185,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
135
185
136
186
request_copy = deepcopy (request )
137
187
request_copy .url = self ._client .format_url (request_copy .url )
138
- return self ._client .send_request (request_copy , ** kwargs )
188
+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
139
189
140
190
def close (self ) -> None :
141
191
self ._client .close ()
0 commit comments