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 HybridComputeManagementClientConfiguration
17
19
from ._serialization import Deserializer , Serializer
18
20
from .operations import (
19
- AgentVersionOperations ,
20
21
ExtensionMetadataOperations ,
21
22
HybridComputeManagementClientOperationsMixin ,
22
- HybridIdentityMetadataOperations ,
23
- LicenseProfilesOperations ,
24
- LicensesOperations ,
25
23
MachineExtensionsOperations ,
24
+ MachineRunCommandsOperations ,
26
25
MachinesOperations ,
27
26
NetworkProfileOperations ,
28
27
Operations ,
@@ -41,12 +40,8 @@ class HybridComputeManagementClient(
41
40
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
42
41
"""The Hybrid Compute Management Client.
43
42
44
- :ivar licenses: LicensesOperations operations
45
- :vartype licenses: azure.mgmt.hybridcompute.operations.LicensesOperations
46
43
:ivar machines: MachinesOperations operations
47
44
:vartype machines: azure.mgmt.hybridcompute.operations.MachinesOperations
48
- :ivar license_profiles: LicenseProfilesOperations operations
49
- :vartype license_profiles: azure.mgmt.hybridcompute.operations.LicenseProfilesOperations
50
45
:ivar machine_extensions: MachineExtensionsOperations operations
51
46
:vartype machine_extensions: azure.mgmt.hybridcompute.operations.MachineExtensionsOperations
52
47
:ivar extension_metadata: ExtensionMetadataOperations operations
@@ -55,11 +50,8 @@ class HybridComputeManagementClient(
55
50
:vartype operations: azure.mgmt.hybridcompute.operations.Operations
56
51
:ivar network_profile: NetworkProfileOperations operations
57
52
:vartype network_profile: azure.mgmt.hybridcompute.operations.NetworkProfileOperations
58
- :ivar hybrid_identity_metadata: HybridIdentityMetadataOperations operations
59
- :vartype hybrid_identity_metadata:
60
- azure.mgmt.hybridcompute.operations.HybridIdentityMetadataOperations
61
- :ivar agent_version: AgentVersionOperations operations
62
- :vartype agent_version: azure.mgmt.hybridcompute.operations.AgentVersionOperations
53
+ :ivar machine_run_commands: MachineRunCommandsOperations operations
54
+ :vartype machine_run_commands: azure.mgmt.hybridcompute.operations.MachineRunCommandsOperations
63
55
:ivar private_link_scopes: PrivateLinkScopesOperations operations
64
56
:vartype private_link_scopes: azure.mgmt.hybridcompute.operations.PrivateLinkScopesOperations
65
57
:ivar private_link_resources: PrivateLinkResourcesOperations operations
@@ -74,7 +66,7 @@ class HybridComputeManagementClient(
74
66
:type subscription_id: str
75
67
:param base_url: Service URL. Default value is "https://management.azure.com".
76
68
:type base_url: str
77
- :keyword api_version: Api Version. Default value is "2023-06-20 -preview". Note that overriding
69
+ :keyword api_version: Api Version. Default value is "2023-10-03 -preview". Note that overriding
78
70
this default value may result in unsupported behavior.
79
71
:paramtype api_version: str
80
72
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -91,17 +83,31 @@ def __init__(
91
83
self ._config = HybridComputeManagementClientConfiguration (
92
84
credential = credential , subscription_id = subscription_id , ** kwargs
93
85
)
94
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
86
+ _policies = kwargs .pop ("policies" , None )
87
+ if _policies is None :
88
+ _policies = [
89
+ policies .RequestIdPolicy (** kwargs ),
90
+ self ._config .headers_policy ,
91
+ self ._config .user_agent_policy ,
92
+ self ._config .proxy_policy ,
93
+ policies .ContentDecodePolicy (** kwargs ),
94
+ ARMAutoResourceProviderRegistrationPolicy (),
95
+ self ._config .redirect_policy ,
96
+ self ._config .retry_policy ,
97
+ self ._config .authentication_policy ,
98
+ self ._config .custom_hook_policy ,
99
+ self ._config .logging_policy ,
100
+ policies .DistributedTracingPolicy (** kwargs ),
101
+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
102
+ self ._config .http_logging_policy ,
103
+ ]
104
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
95
105
96
106
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
97
107
self ._serialize = Serializer (client_models )
98
108
self ._deserialize = Deserializer (client_models )
99
109
self ._serialize .client_side_validation = False
100
- self .licenses = LicensesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
101
110
self .machines = MachinesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
102
- self .license_profiles = LicenseProfilesOperations (
103
- self ._client , self ._config , self ._serialize , self ._deserialize
104
- )
105
111
self .machine_extensions = MachineExtensionsOperations (
106
112
self ._client , self ._config , self ._serialize , self ._deserialize
107
113
)
@@ -110,10 +116,9 @@ def __init__(
110
116
)
111
117
self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
112
118
self .network_profile = NetworkProfileOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
113
- self .hybrid_identity_metadata = HybridIdentityMetadataOperations (
119
+ self .machine_run_commands = MachineRunCommandsOperations (
114
120
self ._client , self ._config , self ._serialize , self ._deserialize
115
121
)
116
- self .agent_version = AgentVersionOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
117
122
self .private_link_scopes = PrivateLinkScopesOperations (
118
123
self ._client , self ._config , self ._serialize , self ._deserialize
119
124
)
@@ -124,7 +129,7 @@ def __init__(
124
129
self ._client , self ._config , self ._serialize , self ._deserialize
125
130
)
126
131
127
- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
132
+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
128
133
"""Runs the network request through the client's chained policies.
129
134
130
135
>>> from azure.core.rest import HttpRequest
@@ -144,7 +149,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
144
149
145
150
request_copy = deepcopy (request )
146
151
request_copy .url = self ._client .format_url (request_copy .url )
147
- return self ._client .send_request (request_copy , ** kwargs )
152
+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
148
153
149
154
def close (self ) -> None :
150
155
self ._client .close ()
0 commit comments