@@ -40,7 +40,7 @@ def __init__(self, client, config, serializer, deserializer):
40
40
41
41
self .config = config
42
42
43
- def list_available_clusters (
43
+ def list_available_cluster_region (
44
44
self , custom_headers = None , raw = False , ** operation_config ):
45
45
"""List the quantity of available pre-provisioned Event Hubs Clusters,
46
46
indexed by Azure region.
@@ -58,7 +58,7 @@ def list_available_clusters(
58
58
:class:`ErrorResponseException<azure.mgmt.eventhub.v2018_01_01_preview.models.ErrorResponseException>`
59
59
"""
60
60
# Construct URL
61
- url = self .list_available_clusters .metadata ['url' ]
61
+ url = self .list_available_cluster_region .metadata ['url' ]
62
62
path_format_arguments = {
63
63
'subscriptionId' : self ._serialize .url ("self.config.subscription_id" , self .config .subscription_id , 'str' )
64
64
}
@@ -94,7 +94,7 @@ def list_available_clusters(
94
94
return client_raw_response
95
95
96
96
return deserialized
97
- list_available_clusters .metadata = {'url' : '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions' }
97
+ list_available_cluster_region .metadata = {'url' : '/subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusterRegions' }
98
98
99
99
def list_by_resource_group (
100
100
self , resource_group_name , custom_headers = None , raw = False , ** operation_config ):
@@ -227,10 +227,10 @@ def get(
227
227
get .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}' }
228
228
229
229
230
- def _put_initial (
231
- self , resource_group_name , cluster_name , custom_headers = None , raw = False , ** operation_config ):
230
+ def _create_or_update_initial (
231
+ self , resource_group_name , cluster_name , parameters , custom_headers = None , raw = False , ** operation_config ):
232
232
# Construct URL
233
- url = self .put .metadata ['url' ]
233
+ url = self .create_or_update .metadata ['url' ]
234
234
path_format_arguments = {
235
235
'subscriptionId' : self ._serialize .url ("self.config.subscription_id" , self .config .subscription_id , 'str' ),
236
236
'resourceGroupName' : self ._serialize .url ("resource_group_name" , resource_group_name , 'str' , max_length = 90 , min_length = 1 ),
@@ -245,15 +245,19 @@ def _put_initial(
245
245
# Construct headers
246
246
header_parameters = {}
247
247
header_parameters ['Accept' ] = 'application/json'
248
+ header_parameters ['Content-Type' ] = 'application/json; charset=utf-8'
248
249
if self .config .generate_client_request_id :
249
250
header_parameters ['x-ms-client-request-id' ] = str (uuid .uuid1 ())
250
251
if custom_headers :
251
252
header_parameters .update (custom_headers )
252
253
if self .config .accept_language is not None :
253
254
header_parameters ['accept-language' ] = self ._serialize .header ("self.config.accept_language" , self .config .accept_language , 'str' )
254
255
256
+ # Construct body
257
+ body_content = self ._serialize .body (parameters , 'Cluster' )
258
+
255
259
# Construct and send request
256
- request = self ._client .put (url , query_parameters , header_parameters )
260
+ request = self ._client .put (url , query_parameters , header_parameters , body_content )
257
261
response = self ._client .send (request , stream = False , ** operation_config )
258
262
259
263
if response .status_code not in [200 , 201 , 202 ]:
@@ -272,15 +276,19 @@ def _put_initial(
272
276
273
277
return deserialized
274
278
275
- def put (
276
- self , resource_group_name , cluster_name , custom_headers = None , raw = False , polling = True , ** operation_config ):
279
+ def create_or_update (
280
+ self , resource_group_name , cluster_name , parameters , custom_headers = None , raw = False , polling = True , ** operation_config ):
277
281
"""Creates or updates an instance of an Event Hubs Cluster.
278
282
279
283
:param resource_group_name: Name of the resource group within the
280
284
azure subscription.
281
285
:type resource_group_name: str
282
286
:param cluster_name: The name of the Event Hubs Cluster.
283
287
:type cluster_name: str
288
+ :param parameters: Parameters for creating a eventhub cluster
289
+ resource.
290
+ :type parameters:
291
+ ~azure.mgmt.eventhub.v2018_01_01_preview.models.Cluster
284
292
:param dict custom_headers: headers that will be added to the request
285
293
:param bool raw: The poller return type is ClientRawResponse, the
286
294
direct response alongside the deserialized response
@@ -295,9 +303,10 @@ def put(
295
303
:raises:
296
304
:class:`ErrorResponseException<azure.mgmt.eventhub.v2018_01_01_preview.models.ErrorResponseException>`
297
305
"""
298
- raw_result = self ._put_initial (
306
+ raw_result = self ._create_or_update_initial (
299
307
resource_group_name = resource_group_name ,
300
308
cluster_name = cluster_name ,
309
+ parameters = parameters ,
301
310
custom_headers = custom_headers ,
302
311
raw = True ,
303
312
** operation_config
@@ -319,13 +328,13 @@ def get_long_running_output(response):
319
328
elif polling is False : polling_method = NoPolling ()
320
329
else : polling_method = polling
321
330
return LROPoller (self ._client , raw_result , get_long_running_output , polling_method )
322
- put .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}' }
331
+ create_or_update .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}' }
323
332
324
333
325
- def _patch_initial (
334
+ def _update_initial (
326
335
self , resource_group_name , cluster_name , parameters , custom_headers = None , raw = False , ** operation_config ):
327
336
# Construct URL
328
- url = self .patch .metadata ['url' ]
337
+ url = self .update .metadata ['url' ]
329
338
path_format_arguments = {
330
339
'subscriptionId' : self ._serialize .url ("self.config.subscription_id" , self .config .subscription_id , 'str' ),
331
340
'resourceGroupName' : self ._serialize .url ("resource_group_name" , resource_group_name , 'str' , max_length = 90 , min_length = 1 ),
@@ -371,7 +380,7 @@ def _patch_initial(
371
380
372
381
return deserialized
373
382
374
- def patch (
383
+ def update (
375
384
self , resource_group_name , cluster_name , parameters , custom_headers = None , raw = False , polling = True , ** operation_config ):
376
385
"""Modifies mutable properties on the Event Hubs Cluster. This operation
377
386
is idempotent.
@@ -399,7 +408,7 @@ def patch(
399
408
:raises:
400
409
:class:`ErrorResponseException<azure.mgmt.eventhub.v2018_01_01_preview.models.ErrorResponseException>`
401
410
"""
402
- raw_result = self ._patch_initial (
411
+ raw_result = self ._update_initial (
403
412
resource_group_name = resource_group_name ,
404
413
cluster_name = cluster_name ,
405
414
parameters = parameters ,
@@ -424,7 +433,7 @@ def get_long_running_output(response):
424
433
elif polling is False : polling_method = NoPolling ()
425
434
else : polling_method = polling
426
435
return LROPoller (self ._client , raw_result , get_long_running_output , polling_method )
427
- patch .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}' }
436
+ update .metadata = {'url' : '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}' }
428
437
429
438
430
439
def _delete_initial (
0 commit comments