6
6
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
# --------------------------------------------------------------------------
8
8
9
+ from copy import deepcopy
9
10
from typing import TYPE_CHECKING
10
11
11
12
from azure .mgmt .core import ARMPipelineClient
12
13
from msrest import Deserializer , Serializer
13
14
15
+ from . import models
16
+ from ._configuration import DataFactoryManagementClientConfiguration
17
+ from .operations import ActivityRunsOperations , DataFlowDebugSessionOperations , DataFlowsOperations , DatasetsOperations , ExposureControlOperations , FactoriesOperations , IntegrationRuntimeNodesOperations , IntegrationRuntimeObjectMetadataOperations , IntegrationRuntimesOperations , LinkedServicesOperations , ManagedPrivateEndpointsOperations , ManagedVirtualNetworksOperations , Operations , PipelineRunsOperations , PipelinesOperations , PrivateEndPointConnectionsOperations , PrivateEndpointConnectionOperations , PrivateLinkResourcesOperations , TriggerRunsOperations , TriggersOperations
18
+
14
19
if TYPE_CHECKING :
15
20
# pylint: disable=unused-import,ungrouped-imports
16
21
from typing import Any , Optional
17
22
18
23
from azure .core .credentials import TokenCredential
19
- from azure .core .pipeline .transport import HttpRequest , HttpResponse
20
-
21
- from ._configuration import DataFactoryManagementClientConfiguration
22
- from .operations import Operations
23
- from .operations import FactoriesOperations
24
- from .operations import ExposureControlOperations
25
- from .operations import IntegrationRuntimesOperations
26
- from .operations import IntegrationRuntimeObjectMetadataOperations
27
- from .operations import IntegrationRuntimeNodesOperations
28
- from .operations import LinkedServicesOperations
29
- from .operations import DatasetsOperations
30
- from .operations import PipelinesOperations
31
- from .operations import PipelineRunsOperations
32
- from .operations import ActivityRunsOperations
33
- from .operations import TriggersOperations
34
- from .operations import TriggerRunsOperations
35
- from .operations import DataFlowsOperations
36
- from .operations import DataFlowDebugSessionOperations
37
- from .operations import ManagedVirtualNetworksOperations
38
- from .operations import ManagedPrivateEndpointsOperations
39
- from .operations import PrivateEndPointConnectionsOperations
40
- from .operations import PrivateEndpointConnectionOperations
41
- from .operations import PrivateLinkResourcesOperations
42
- from . import models
43
-
24
+ from azure .core .rest import HttpRequest , HttpResponse
44
25
45
26
class DataFactoryManagementClient (object ):
46
27
"""The Azure Data Factory V2 management API provides a RESTful set of web services that interact with Azure Data Factory V2 services.
@@ -53,10 +34,13 @@ class DataFactoryManagementClient(object):
53
34
:vartype exposure_control: azure.mgmt.datafactory.operations.ExposureControlOperations
54
35
:ivar integration_runtimes: IntegrationRuntimesOperations operations
55
36
:vartype integration_runtimes: azure.mgmt.datafactory.operations.IntegrationRuntimesOperations
56
- :ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations operations
57
- :vartype integration_runtime_object_metadata: azure.mgmt.datafactory.operations.IntegrationRuntimeObjectMetadataOperations
37
+ :ivar integration_runtime_object_metadata: IntegrationRuntimeObjectMetadataOperations
38
+ operations
39
+ :vartype integration_runtime_object_metadata:
40
+ azure.mgmt.datafactory.operations.IntegrationRuntimeObjectMetadataOperations
58
41
:ivar integration_runtime_nodes: IntegrationRuntimeNodesOperations operations
59
- :vartype integration_runtime_nodes: azure.mgmt.datafactory.operations.IntegrationRuntimeNodesOperations
42
+ :vartype integration_runtime_nodes:
43
+ azure.mgmt.datafactory.operations.IntegrationRuntimeNodesOperations
60
44
:ivar linked_services: LinkedServicesOperations operations
61
45
:vartype linked_services: azure.mgmt.datafactory.operations.LinkedServicesOperations
62
46
:ivar datasets: DatasetsOperations operations
@@ -74,101 +58,96 @@ class DataFactoryManagementClient(object):
74
58
:ivar data_flows: DataFlowsOperations operations
75
59
:vartype data_flows: azure.mgmt.datafactory.operations.DataFlowsOperations
76
60
:ivar data_flow_debug_session: DataFlowDebugSessionOperations operations
77
- :vartype data_flow_debug_session: azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations
61
+ :vartype data_flow_debug_session:
62
+ azure.mgmt.datafactory.operations.DataFlowDebugSessionOperations
78
63
:ivar managed_virtual_networks: ManagedVirtualNetworksOperations operations
79
- :vartype managed_virtual_networks: azure.mgmt.datafactory.operations.ManagedVirtualNetworksOperations
64
+ :vartype managed_virtual_networks:
65
+ azure.mgmt.datafactory.operations.ManagedVirtualNetworksOperations
80
66
:ivar managed_private_endpoints: ManagedPrivateEndpointsOperations operations
81
- :vartype managed_private_endpoints: azure.mgmt.datafactory.operations.ManagedPrivateEndpointsOperations
67
+ :vartype managed_private_endpoints:
68
+ azure.mgmt.datafactory.operations.ManagedPrivateEndpointsOperations
82
69
:ivar private_end_point_connections: PrivateEndPointConnectionsOperations operations
83
- :vartype private_end_point_connections: azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations
70
+ :vartype private_end_point_connections:
71
+ azure.mgmt.datafactory.operations.PrivateEndPointConnectionsOperations
84
72
:ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations
85
- :vartype private_endpoint_connection: azure.mgmt.datafactory.operations.PrivateEndpointConnectionOperations
73
+ :vartype private_endpoint_connection:
74
+ azure.mgmt.datafactory.operations.PrivateEndpointConnectionOperations
86
75
:ivar private_link_resources: PrivateLinkResourcesOperations operations
87
- :vartype private_link_resources: azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations
76
+ :vartype private_link_resources:
77
+ azure.mgmt.datafactory.operations.PrivateLinkResourcesOperations
88
78
:param credential: Credential needed for the client to connect to Azure.
89
79
:type credential: ~azure.core.credentials.TokenCredential
90
80
:param subscription_id: The subscription identifier.
91
81
:type subscription_id: str
92
- :param str base_url: Service URL
93
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
82
+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
83
+ :type base_url: str
84
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
85
+ Retry-After header is present.
94
86
"""
95
87
96
88
def __init__ (
97
89
self ,
98
90
credential , # type: "TokenCredential"
99
91
subscription_id , # type: str
100
- base_url = None , # type: Optional[ str]
92
+ base_url = "https://management.azure.com" , # type: str
101
93
** kwargs # type: Any
102
94
):
103
95
# type: (...) -> None
104
- if not base_url :
105
- base_url = 'https://management.azure.com'
106
- self ._config = DataFactoryManagementClientConfiguration (credential , subscription_id , ** kwargs )
96
+ self ._config = DataFactoryManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
107
97
self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
108
98
109
99
client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
110
100
self ._serialize = Serializer (client_models )
111
- self ._serialize .client_side_validation = False
112
101
self ._deserialize = Deserializer (client_models )
113
-
114
- self .operations = Operations (
115
- self ._client , self ._config , self ._serialize , self ._deserialize )
116
- self .factories = FactoriesOperations (
117
- self ._client , self ._config , self ._serialize , self ._deserialize )
118
- self .exposure_control = ExposureControlOperations (
119
- self ._client , self ._config , self ._serialize , self ._deserialize )
120
- self .integration_runtimes = IntegrationRuntimesOperations (
121
- self ._client , self ._config , self ._serialize , self ._deserialize )
122
- self .integration_runtime_object_metadata = IntegrationRuntimeObjectMetadataOperations (
123
- self ._client , self ._config , self ._serialize , self ._deserialize )
124
- self .integration_runtime_nodes = IntegrationRuntimeNodesOperations (
125
- self ._client , self ._config , self ._serialize , self ._deserialize )
126
- self .linked_services = LinkedServicesOperations (
127
- self ._client , self ._config , self ._serialize , self ._deserialize )
128
- self .datasets = DatasetsOperations (
129
- self ._client , self ._config , self ._serialize , self ._deserialize )
130
- self .pipelines = PipelinesOperations (
131
- self ._client , self ._config , self ._serialize , self ._deserialize )
132
- self .pipeline_runs = PipelineRunsOperations (
133
- self ._client , self ._config , self ._serialize , self ._deserialize )
134
- self .activity_runs = ActivityRunsOperations (
135
- self ._client , self ._config , self ._serialize , self ._deserialize )
136
- self .triggers = TriggersOperations (
137
- self ._client , self ._config , self ._serialize , self ._deserialize )
138
- self .trigger_runs = TriggerRunsOperations (
139
- self ._client , self ._config , self ._serialize , self ._deserialize )
140
- self .data_flows = DataFlowsOperations (
141
- self ._client , self ._config , self ._serialize , self ._deserialize )
142
- self .data_flow_debug_session = DataFlowDebugSessionOperations (
143
- self ._client , self ._config , self ._serialize , self ._deserialize )
144
- self .managed_virtual_networks = ManagedVirtualNetworksOperations (
145
- self ._client , self ._config , self ._serialize , self ._deserialize )
146
- self .managed_private_endpoints = ManagedPrivateEndpointsOperations (
147
- self ._client , self ._config , self ._serialize , self ._deserialize )
148
- self .private_end_point_connections = PrivateEndPointConnectionsOperations (
149
- self ._client , self ._config , self ._serialize , self ._deserialize )
150
- self .private_endpoint_connection = PrivateEndpointConnectionOperations (
151
- self ._client , self ._config , self ._serialize , self ._deserialize )
152
- self .private_link_resources = PrivateLinkResourcesOperations (
153
- self ._client , self ._config , self ._serialize , self ._deserialize )
154
-
155
- def _send_request (self , http_request , ** kwargs ):
156
- # type: (HttpRequest, Any) -> HttpResponse
102
+ self ._serialize .client_side_validation = False
103
+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
104
+ self .factories = FactoriesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
105
+ self .exposure_control = ExposureControlOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
106
+ self .integration_runtimes = IntegrationRuntimesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
107
+ self .integration_runtime_object_metadata = IntegrationRuntimeObjectMetadataOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
108
+ self .integration_runtime_nodes = IntegrationRuntimeNodesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
109
+ self .linked_services = LinkedServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
110
+ self .datasets = DatasetsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
111
+ self .pipelines = PipelinesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
112
+ self .pipeline_runs = PipelineRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
113
+ self .activity_runs = ActivityRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
114
+ self .triggers = TriggersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
115
+ self .trigger_runs = TriggerRunsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
116
+ self .data_flows = DataFlowsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
117
+ self .data_flow_debug_session = DataFlowDebugSessionOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
118
+ self .managed_virtual_networks = ManagedVirtualNetworksOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
119
+ self .managed_private_endpoints = ManagedPrivateEndpointsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
120
+ self .private_end_point_connections = PrivateEndPointConnectionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
121
+ self .private_endpoint_connection = PrivateEndpointConnectionOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
122
+ self .private_link_resources = PrivateLinkResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
123
+
124
+
125
+ def _send_request (
126
+ self ,
127
+ request , # type: HttpRequest
128
+ ** kwargs # type: Any
129
+ ):
130
+ # type: (...) -> HttpResponse
157
131
"""Runs the network request through the client's chained policies.
158
132
159
- :param http_request: The network request you want to make. Required.
160
- :type http_request: ~azure.core.pipeline.transport.HttpRequest
161
- :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
133
+ >>> from azure.core.rest import HttpRequest
134
+ >>> request = HttpRequest("GET", "https://www.example.org/")
135
+ <HttpRequest [GET], url: 'https://www.example.org/'>
136
+ >>> response = client._send_request(request)
137
+ <HttpResponse: 200 OK>
138
+
139
+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
140
+
141
+ :param request: The network request you want to make. Required.
142
+ :type request: ~azure.core.rest.HttpRequest
143
+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
162
144
:return: The response of your network call. Does not do error handling on your response.
163
- :rtype: ~azure.core.pipeline.transport .HttpResponse
145
+ :rtype: ~azure.core.rest .HttpResponse
164
146
"""
165
- path_format_arguments = {
166
- 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
167
- }
168
- http_request .url = self ._client .format_url (http_request .url , ** path_format_arguments )
169
- stream = kwargs .pop ("stream" , True )
170
- pipeline_response = self ._client ._pipeline .run (http_request , stream = stream , ** kwargs )
171
- return pipeline_response .http_response
147
+
148
+ request_copy = deepcopy (request )
149
+ request_copy .url = self ._client .format_url (request_copy .url )
150
+ return self ._client .send_request (request_copy , ** kwargs )
172
151
173
152
def close (self ):
174
153
# type: () -> None
0 commit comments