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 HDInsightContainersMgmtClientConfiguration
17
19
from ._serialization import Deserializer , Serializer
18
20
from .operations import (
19
21
AvailableClusterPoolVersionsOperations ,
20
22
AvailableClusterVersionsOperations ,
23
+ ClusterAvailableUpgradesOperations ,
21
24
ClusterJobsOperations ,
25
+ ClusterPoolAvailableUpgradesOperations ,
22
26
ClusterPoolsOperations ,
23
27
ClustersOperations ,
24
28
LocationsOperations ,
31
35
32
36
33
37
class HDInsightContainersMgmtClient : # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
34
- """HDInsight On Aks Management Client.
38
+ """HDInsight Containers Management Client.
35
39
36
40
:ivar cluster_pools: ClusterPoolsOperations operations
37
41
:vartype cluster_pools: azure.mgmt.hdinsightcontainers.operations.ClusterPoolsOperations
42
+ :ivar cluster_pool_available_upgrades: ClusterPoolAvailableUpgradesOperations operations
43
+ :vartype cluster_pool_available_upgrades:
44
+ azure.mgmt.hdinsightcontainers.operations.ClusterPoolAvailableUpgradesOperations
38
45
:ivar clusters: ClustersOperations operations
39
46
:vartype clusters: azure.mgmt.hdinsightcontainers.operations.ClustersOperations
47
+ :ivar cluster_available_upgrades: ClusterAvailableUpgradesOperations operations
48
+ :vartype cluster_available_upgrades:
49
+ azure.mgmt.hdinsightcontainers.operations.ClusterAvailableUpgradesOperations
40
50
:ivar cluster_jobs: ClusterJobsOperations operations
41
51
:vartype cluster_jobs: azure.mgmt.hdinsightcontainers.operations.ClusterJobsOperations
42
52
:ivar locations: LocationsOperations operations
@@ -55,7 +65,7 @@ class HDInsightContainersMgmtClient: # pylint: disable=client-accepts-api-versi
55
65
:type subscription_id: str
56
66
:param base_url: Service URL. Default value is "https://management.azure.com".
57
67
:type base_url: str
58
- :keyword api_version: Api Version. Default value is "2023-06 -01-preview". Note that overriding
68
+ :keyword api_version: Api Version. Default value is "2023-11 -01-preview". Note that overriding
59
69
this default value may result in unsupported behavior.
60
70
:paramtype api_version: str
61
71
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -72,14 +82,38 @@ def __init__(
72
82
self ._config = HDInsightContainersMgmtClientConfiguration (
73
83
credential = credential , subscription_id = subscription_id , ** kwargs
74
84
)
75
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
85
+ _policies = kwargs .pop ("policies" , None )
86
+ if _policies is None :
87
+ _policies = [
88
+ policies .RequestIdPolicy (** kwargs ),
89
+ self ._config .headers_policy ,
90
+ self ._config .user_agent_policy ,
91
+ self ._config .proxy_policy ,
92
+ policies .ContentDecodePolicy (** kwargs ),
93
+ ARMAutoResourceProviderRegistrationPolicy (),
94
+ self ._config .redirect_policy ,
95
+ self ._config .retry_policy ,
96
+ self ._config .authentication_policy ,
97
+ self ._config .custom_hook_policy ,
98
+ self ._config .logging_policy ,
99
+ policies .DistributedTracingPolicy (** kwargs ),
100
+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
101
+ self ._config .http_logging_policy ,
102
+ ]
103
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
76
104
77
105
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
78
106
self ._serialize = Serializer (client_models )
79
107
self ._deserialize = Deserializer (client_models )
80
108
self ._serialize .client_side_validation = False
81
109
self .cluster_pools = ClusterPoolsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
110
+ self .cluster_pool_available_upgrades = ClusterPoolAvailableUpgradesOperations (
111
+ self ._client , self ._config , self ._serialize , self ._deserialize
112
+ )
82
113
self .clusters = ClustersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
114
+ self .cluster_available_upgrades = ClusterAvailableUpgradesOperations (
115
+ self ._client , self ._config , self ._serialize , self ._deserialize
116
+ )
83
117
self .cluster_jobs = ClusterJobsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
84
118
self .locations = LocationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
85
119
self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
@@ -90,7 +124,7 @@ def __init__(
90
124
self ._client , self ._config , self ._serialize , self ._deserialize
91
125
)
92
126
93
- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
127
+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
94
128
"""Runs the network request through the client's chained policies.
95
129
96
130
>>> from azure.core.rest import HttpRequest
@@ -110,7 +144,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
110
144
111
145
request_copy = deepcopy (request )
112
146
request_copy .url = self ._client .format_url (request_copy .url )
113
- return self ._client .send_request (request_copy , ** kwargs )
147
+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
114
148
115
149
def close (self ) -> None :
116
150
self ._client .close ()
0 commit comments