Class: Azure::ARM::EventHub::EventHubs

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_event_hub/event_hubs.rb

Overview

Azure Event Hubs client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ EventHubs

Creates and initializes a new instance of the EventHubs class.

Parameters:

  • client

    service class for accessing basic functionality.



18
19
20
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 18

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientEventHubManagementClient (readonly)

Returns reference to the EventHubManagementClient.

Returns:



23
24
25
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 23

def client
  @client
end

Instance Method Details

#create_or_update(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers = nil) ⇒ EventHubResource

Creates or updates a new Event Hub as a nested resource within a namespace.

create an Event Hub resource. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • parameters (EventHubCreateOrUpdateParameters)

    Parameters supplied to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



129
130
131
132
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 129

def create_or_update(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers = nil)
  response = create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Creates or updates a new Event Hub as a nested resource within a namespace.

create an Event Hub resource. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • parameters (EventHubCreateOrUpdateParameters)

    Parameters supplied to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 164

def create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = EventHubCreateOrUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters, 'parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = EventHubResource.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_or_update_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil) ⇒ SharedAccessAuthorizationRuleResource

Creates or updates an authorization rule for the specified Event Hub.

shared access authorization rule. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The authorization rule name.

  • parameters (SharedAccessAuthorizationRuleCreateOrUpdateParameters)

    The

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



515
516
517
518
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 515

def create_or_update_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil)
  response = create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Creates or updates an authorization rule for the specified Event Hub.

shared access authorization rule. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The authorization rule name.

  • parameters (SharedAccessAuthorizationRuleCreateOrUpdateParameters)

    The

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 552

def create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = SharedAccessAuthorizationRuleCreateOrUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters, 'parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = SharedAccessAuthorizationRuleResource.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_or_update_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates an authorization rule for the specified Event Hub.

shared access authorization rule. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The authorization rule name.

  • parameters (SharedAccessAuthorizationRuleCreateOrUpdateParameters)

    The

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



534
535
536
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 534

def create_or_update_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil)
  create_or_update_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers).value!
end

#create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Creates or updates a new Event Hub as a nested resource within a namespace.

create an Event Hub resource. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • parameters (EventHubCreateOrUpdateParameters)

    Parameters supplied to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



147
148
149
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 147

def create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers = nil)
  create_or_update_async(resource_group_name, namespace_name, event_hub_name, parameters, custom_headers).value!
end

#delete(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ Object

Deletes an Event Hub from the specified namespace and resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The name of the Event Hub to delete.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



237
238
239
240
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 237

def delete(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  response = delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
  nil
end

#delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ Concurrent::Promise

Deletes an Event Hub from the specified namespace and resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The name of the Event Hub to delete.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 268

def delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#delete_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil) ⇒ Object

Deletes an Event Hubs authorization rule.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The authorization rule name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



726
727
728
729
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 726

def delete_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil)
  response = delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers).value!
  nil
end

#delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil) ⇒ Concurrent::Promise

Deletes an Event Hubs authorization rule.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The authorization rule name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 759

def delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 204 || status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#delete_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an Event Hubs authorization rule.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The authorization rule name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



743
744
745
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 743

def delete_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil)
  delete_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers).value!
end

#delete_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes an Event Hub from the specified namespace and resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The name of the Event Hub to delete.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



253
254
255
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 253

def delete_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  delete_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
end

#get(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ EventHubResource

Gets an Event Hubs description for the specified Event Hub.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



322
323
324
325
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 322

def get(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  response = get_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets an Event Hubs description for the specified Event Hub.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 353

def get_async(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = EventHubResource.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil) ⇒ SharedAccessAuthorizationRuleResource

Gets an authorization rule for an Event Hub by rule name.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The authorization rule name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



628
629
630
631
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 628

def get_authorization_rule(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil)
  response = get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers).value!
  response.body unless response.nil?
end

#get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets an authorization rule for an Event Hub by rule name.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The authorization rule name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 661

def get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = SharedAccessAuthorizationRuleResource.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets an authorization rule for an Event Hub by rule name.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The authorization rule name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



645
646
647
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 645

def get_authorization_rule_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil)
  get_authorization_rule_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers).value!
end

#get_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets an Event Hubs description for the specified Event Hub.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



338
339
340
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 338

def get_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  get_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
end

#list_all(resource_group_name, namespace_name, custom_headers = nil) ⇒ Array<EventHubResource>

Gets all the Event Hubs in a namespace.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



35
36
37
38
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 35

def list_all(resource_group_name, namespace_name, custom_headers = nil)
  first_page = list_all_as_lazy(resource_group_name, namespace_name, custom_headers)
  first_page.get_all_items
end

#list_all_as_lazy(resource_group_name, namespace_name, custom_headers = nil) ⇒ EventHubListResult

Gets all the Event Hubs in a namespace.

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 1208

def list_all_as_lazy(resource_group_name, namespace_name, custom_headers = nil)
  response = list_all_async(resource_group_name, namespace_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_all_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_all_async(resource_group_name, namespace_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets all the Event Hubs in a namespace.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 64

def list_all_async(resource_group_name, namespace_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = EventHubListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_all_next(next_page_link, custom_headers = nil) ⇒ EventHubListResult

Gets all the Event Hubs in a namespace.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



1033
1034
1035
1036
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 1033

def list_all_next(next_page_link, custom_headers = nil)
  response = list_all_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_all_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets all the Event Hubs in a namespace.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 1062

def list_all_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = EventHubListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_all_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all the Event Hubs in a namespace.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1048
1049
1050
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 1048

def list_all_next_with_http_info(next_page_link, custom_headers = nil)
  list_all_next_async(next_page_link, custom_headers).value!
end

#list_all_with_http_info(resource_group_name, namespace_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets all the Event Hubs in a namespace.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



50
51
52
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 50

def list_all_with_http_info(resource_group_name, namespace_name, custom_headers = nil)
  list_all_async(resource_group_name, namespace_name, custom_headers).value!
end

#list_authorization_rules(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ Array<SharedAccessAuthorizationRuleResource>

Gets the authorization rules for an Event Hub.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name

  • event_hub_name (String)

    The Event Hub name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



417
418
419
420
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 417

def list_authorization_rules(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers)
  first_page.get_all_items
end

#list_authorization_rules_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ SharedAccessAuthorizationRuleListResult

Gets the authorization rules for an Event Hub.

will be added to the HTTP request.

to pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name

  • event_hub_name (String)

    The Event Hub name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 1231

def list_authorization_rules_as_lazy(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  response = list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_authorization_rules_next_async(next_page_link, custom_headers)
    end
    page
  end
end

#list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets the authorization rules for an Event Hub.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name

  • event_hub_name (String)

    The Event Hub name.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 448

def list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = SharedAccessAuthorizationRuleListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_authorization_rules_next(next_page_link, custom_headers = nil) ⇒ SharedAccessAuthorizationRuleListResult

Gets the authorization rules for an Event Hub.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



1120
1121
1122
1123
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 1120

def list_authorization_rules_next(next_page_link, custom_headers = nil)
  response = list_authorization_rules_next_async(next_page_link, custom_headers).value!
  response.body unless response.nil?
end

#list_authorization_rules_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise

Gets the authorization rules for an Event Hub.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 1149

def list_authorization_rules_next_async(next_page_link, custom_headers = nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = SharedAccessAuthorizationRuleListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_authorization_rules_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the authorization rules for an Event Hub.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1135
1136
1137
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 1135

def list_authorization_rules_next_with_http_info(next_page_link, custom_headers = nil)
  list_authorization_rules_next_async(next_page_link, custom_headers).value!
end

#list_authorization_rules_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the authorization rules for an Event Hub.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name

  • event_hub_name (String)

    The Event Hub name.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



433
434
435
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 433

def list_authorization_rules_with_http_info(resource_group_name, namespace_name, event_hub_name, custom_headers = nil)
  list_authorization_rules_async(resource_group_name, namespace_name, event_hub_name, custom_headers).value!
end

#list_keys(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil) ⇒ ResourceListKeys

Gets the ACS and SAS connection strings for the Event Hub.

namespace for the specified authorization rule. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The connection string of the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



816
817
818
819
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 816

def list_keys(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil)
  response = list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers).value!
  response.body unless response.nil?
end

#list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil) ⇒ Concurrent::Promise

Gets the ACS and SAS connection strings for the Event Hub.

namespace for the specified authorization rule. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The connection string of the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 851

def list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/ListKeys'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = ResourceListKeys.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_keys_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the ACS and SAS connection strings for the Event Hub.

namespace for the specified authorization rule. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The connection string of the

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



834
835
836
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 834

def list_keys_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers = nil)
  list_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, custom_headers).value!
end

#regenerate_keys(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil) ⇒ ResourceListKeys

Regenerates the ACS and SAS connection strings for the Event Hub.

Hub for the specified authorization rule. regenerate the authorization rule. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The connection string of the Event

  • parameters (RegenerateKeysParameters)

    Parameters supplied to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:



920
921
922
923
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 920

def regenerate_keys(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil)
  response = regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers).value!
  response.body unless response.nil?
end

#regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise

Regenerates the ACS and SAS connection strings for the Event Hub.

Hub for the specified authorization rule. regenerate the authorization rule. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The connection string of the Event

  • parameters (RegenerateKeysParameters)

    Parameters supplied to

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 959

def regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
  fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil?
  fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Serialize Request
  request_mapper = RegenerateKeysParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters, 'parameters')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = ResourceListKeys.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#regenerate_keys_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Regenerates the ACS and SAS connection strings for the Event Hub.

Hub for the specified authorization rule. regenerate the authorization rule. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • namespace_name (String)

    The namespace name.

  • event_hub_name (String)

    The Event Hub name.

  • authorization_rule_name (String)

    The connection string of the Event

  • parameters (RegenerateKeysParameters)

    Parameters supplied to

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



940
941
942
# File 'lib/generated/azure_mgmt_event_hub/event_hubs.rb', line 940

def regenerate_keys_with_http_info(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers = nil)
  regenerate_keys_async(resource_group_name, namespace_name, event_hub_name, authorization_rule_name, parameters, custom_headers).value!
end