11
11
12
12
import uuid
13
13
from msrest .pipeline import ClientRawResponse
14
+ from msrest .polling import LROPoller , NoPolling
15
+ from msrestazure .polling .arm_polling import ARMPolling
14
16
15
17
from .. import models
16
18
@@ -101,32 +103,9 @@ def get(
101
103
return deserialized
102
104
get .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/managedIdentitySqlControlSettings/default' }
103
105
104
- def create_or_update (
105
- self , resource_group_name , workspace_name , grant_sql_control_to_managed_identity = None , custom_headers = None , raw = False , ** operation_config ):
106
- """Create or update Managed Identity Sql Control Settings.
107
106
108
- :param resource_group_name: The name of the resource group. The name
109
- is case insensitive.
110
- :type resource_group_name: str
111
- :param workspace_name: The name of the workspace
112
- :type workspace_name: str
113
- :param grant_sql_control_to_managed_identity: Grant sql control to
114
- managed identity
115
- :type grant_sql_control_to_managed_identity:
116
- ~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity
117
- :param dict custom_headers: headers that will be added to the request
118
- :param bool raw: returns the direct response alongside the
119
- deserialized response
120
- :param operation_config: :ref:`Operation configuration
121
- overrides<msrest:optionsforoperations>`.
122
- :return: ManagedIdentitySqlControlSettingsModel or ClientRawResponse
123
- if raw=true
124
- :rtype:
125
- ~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModel or
126
- ~msrest.pipeline.ClientRawResponse
127
- :raises:
128
- :class:`ErrorContractException<azure.mgmt.synapse.models.ErrorContractException>`
129
- """
107
+ def _create_or_update_initial (
108
+ self , resource_group_name , workspace_name , grant_sql_control_to_managed_identity = None , custom_headers = None , raw = False , ** operation_config ):
130
109
managed_identity_sql_control_settings = models .ManagedIdentitySqlControlSettingsModel (grant_sql_control_to_managed_identity = grant_sql_control_to_managed_identity )
131
110
132
111
# Construct URL
@@ -164,6 +143,7 @@ def create_or_update(
164
143
raise models .ErrorContractException (self ._deserialize , response )
165
144
166
145
deserialized = None
146
+
167
147
if response .status_code == 200 :
168
148
deserialized = self ._deserialize ('ManagedIdentitySqlControlSettingsModel' , response )
169
149
@@ -172,4 +152,58 @@ def create_or_update(
172
152
return client_raw_response
173
153
174
154
return deserialized
155
+
156
+ def create_or_update (
157
+ self , resource_group_name , workspace_name , grant_sql_control_to_managed_identity = None , custom_headers = None , raw = False , polling = True , ** operation_config ):
158
+ """Create or update Managed Identity Sql Control Settings.
159
+
160
+ :param resource_group_name: The name of the resource group. The name
161
+ is case insensitive.
162
+ :type resource_group_name: str
163
+ :param workspace_name: The name of the workspace
164
+ :type workspace_name: str
165
+ :param grant_sql_control_to_managed_identity: Grant sql control to
166
+ managed identity
167
+ :type grant_sql_control_to_managed_identity:
168
+ ~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity
169
+ :param dict custom_headers: headers that will be added to the request
170
+ :param bool raw: The poller return type is ClientRawResponse, the
171
+ direct response alongside the deserialized response
172
+ :param polling: True for ARMPolling, False for no polling, or a
173
+ polling object for personal polling strategy
174
+ :return: An instance of LROPoller that returns
175
+ ManagedIdentitySqlControlSettingsModel or
176
+ ClientRawResponse<ManagedIdentitySqlControlSettingsModel> if raw==True
177
+ :rtype:
178
+ ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModel]
179
+ or
180
+ ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.ManagedIdentitySqlControlSettingsModel]]
181
+ :raises:
182
+ :class:`ErrorContractException<azure.mgmt.synapse.models.ErrorContractException>`
183
+ """
184
+ raw_result = self ._create_or_update_initial (
185
+ resource_group_name = resource_group_name ,
186
+ workspace_name = workspace_name ,
187
+ grant_sql_control_to_managed_identity = grant_sql_control_to_managed_identity ,
188
+ custom_headers = custom_headers ,
189
+ raw = True ,
190
+ ** operation_config
191
+ )
192
+
193
+ def get_long_running_output (response ):
194
+ deserialized = self ._deserialize ('ManagedIdentitySqlControlSettingsModel' , response )
195
+
196
+ if raw :
197
+ client_raw_response = ClientRawResponse (deserialized , response )
198
+ return client_raw_response
199
+
200
+ return deserialized
201
+
202
+ lro_delay = operation_config .get (
203
+ 'long_running_operation_timeout' ,
204
+ self .config .long_running_operation_timeout )
205
+ if polling is True : polling_method = ARMPolling (lro_delay , ** operation_config )
206
+ elif polling is False : polling_method = NoPolling ()
207
+ else : polling_method = polling
208
+ return LROPoller (self ._client , raw_result , get_long_running_output , polling_method )
175
209
create_or_update .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/managedIdentitySqlControlSettings/default' }
0 commit comments