Class: Azure::EventHub::Mgmt::V2017_04_01::ConsumerGroups
- Inherits:
-
Object
- Object
- Azure::EventHub::Mgmt::V2017_04_01::ConsumerGroups
- Includes:
- MsRestAzure
- Defined in:
- lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb
Overview
Azure Event Hubs client
Instance Attribute Summary collapse
-
#client ⇒ EventHubManagementClient
readonly
Reference to the EventHubManagementClient.
Instance Method Summary collapse
-
#create_or_update(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers: nil) ⇒ ConsumerGroup
Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
-
#create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
-
#create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
-
#delete(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ Object
Deletes a consumer group from the specified Event Hub and resource group.
-
#delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes a consumer group from the specified Event Hub and resource group.
-
#delete_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes a consumer group from the specified Event Hub and resource group.
-
#get(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ ConsumerGroup
Gets a description for the specified consumer group.
-
#get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets a description for the specified consumer group.
-
#get_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a description for the specified consumer group.
-
#initialize(client) ⇒ ConsumerGroups
constructor
Creates and initializes a new instance of the ConsumerGroups class.
-
#list_by_event_hub(resource_group_name, namespace_name, event_hub_name, skip: nil, top: nil, custom_headers: nil) ⇒ Array<ConsumerGroup>
Gets all the consumer groups in a Namespace.
-
#list_by_event_hub_as_lazy(resource_group_name, namespace_name, event_hub_name, skip: nil, top: nil, custom_headers: nil) ⇒ ConsumerGroupListResult
Gets all the consumer groups in a Namespace.
-
#list_by_event_hub_async(resource_group_name, namespace_name, event_hub_name, skip: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise
Gets all the consumer groups in a Namespace.
-
#list_by_event_hub_next(next_page_link, custom_headers: nil) ⇒ ConsumerGroupListResult
Gets all the consumer groups in a Namespace.
-
#list_by_event_hub_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Gets all the consumer groups in a Namespace.
-
#list_by_event_hub_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets all the consumer groups in a Namespace.
-
#list_by_event_hub_with_http_info(resource_group_name, namespace_name, event_hub_name, skip: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets all the consumer groups in a Namespace.
Constructor Details
#initialize(client) ⇒ ConsumerGroups
Creates and initializes a new instance of the ConsumerGroups class.
17 18 19 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ EventHubManagementClient (readonly)
Returns reference to the EventHubManagementClient.
22 23 24 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 22 def client @client end |
Instance Method Details
#create_or_update(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers: nil) ⇒ ConsumerGroup
Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
azure subscription. consumer group resource. will be added to the HTTP request.
40 41 42 43 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 40 def create_or_update(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
azure subscription. consumer group resource. to the HTTP request.
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 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 81 def create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, 'namespace_name is nil' if namespace_name.nil? fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50 fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6 fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil? fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1 fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil? fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MaxLength': '50'" if !consumer_group_name.nil? && consumer_group_name.length > 50 fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MinLength': '1'" if !consumer_group_name.nil? && consumer_group_name.length < 1 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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::ConsumerGroup.mapper() request_content = @client.serialize(request_mapper, 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}/consumergroups/{consumerGroupName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_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, ) 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 MsRest::HttpOperationError.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 = Azure::EventHub::Mgmt::V2017_04_01::Models::ConsumerGroup.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Creates or updates an Event Hubs consumer group as a nested resource within a Namespace.
azure subscription. consumer group resource. will be added to the HTTP request.
61 62 63 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 61 def create_or_update_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:nil) create_or_update_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, parameters, custom_headers:custom_headers).value! end |
#delete(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ Object
Deletes a consumer group from the specified Event Hub and resource group.
azure subscription. will be added to the HTTP request.
163 164 165 166 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 163 def delete(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil) response = delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:custom_headers).value! nil end |
#delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes a consumer group from the specified Event Hub and resource group.
azure subscription. to the HTTP request.
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 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 198 def delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, 'namespace_name is nil' if namespace_name.nil? fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50 fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6 fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil? fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1 fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil? fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MaxLength': '50'" if !consumer_group_name.nil? && consumer_group_name.length > 50 fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MinLength': '1'" if !consumer_group_name.nil? && consumer_group_name.length < 1 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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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}/consumergroups/{consumerGroupName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_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, ) 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 MsRest::HttpOperationError.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_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes a consumer group from the specified Event Hub and resource group.
azure subscription. will be added to the HTTP request.
181 182 183 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 181 def delete_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil) delete_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:custom_headers).value! end |
#get(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ ConsumerGroup
Gets a description for the specified consumer group.
azure subscription. will be added to the HTTP request.
263 264 265 266 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 263 def get(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil) response = get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets a description for the specified consumer group.
azure subscription. to the HTTP request.
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 298 def get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, 'namespace_name is nil' if namespace_name.nil? fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50 fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6 fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil? fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1 fail ArgumentError, 'consumer_group_name is nil' if consumer_group_name.nil? fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MaxLength': '50'" if !consumer_group_name.nil? && consumer_group_name.length > 50 fail ArgumentError, "'consumer_group_name' should satisfy the constraint - 'MinLength': '1'" if !consumer_group_name.nil? && consumer_group_name.length < 1 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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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}/consumergroups/{consumerGroupName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'eventHubName' => event_hub_name,'consumerGroupName' => consumer_group_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, ) 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 MsRest::HttpOperationError.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 = Azure::EventHub::Mgmt::V2017_04_01::Models::ConsumerGroup.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a description for the specified consumer group.
azure subscription. will be added to the HTTP request.
281 282 283 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 281 def get_with_http_info(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:nil) get_async(resource_group_name, namespace_name, event_hub_name, consumer_group_name, custom_headers:custom_headers).value! end |
#list_by_event_hub(resource_group_name, namespace_name, event_hub_name, skip: nil, top: nil, custom_headers: nil) ⇒ Array<ConsumerGroup>
Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
azure subscription. partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
379 380 381 382 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 379 def list_by_event_hub(resource_group_name, namespace_name, event_hub_name, skip:nil, top:nil, custom_headers:nil) first_page = list_by_event_hub_as_lazy(resource_group_name, namespace_name, event_hub_name, skip:skip, top:top, custom_headers:custom_headers) first_page.get_all_items end |
#list_by_event_hub_as_lazy(resource_group_name, namespace_name, event_hub_name, skip: nil, top: nil, custom_headers: nil) ⇒ ConsumerGroupListResult
Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
azure subscription. partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
response.
600 601 602 603 604 605 606 607 608 609 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 600 def list_by_event_hub_as_lazy(resource_group_name, namespace_name, event_hub_name, skip:nil, top:nil, custom_headers:nil) response = list_by_event_hub_async(resource_group_name, namespace_name, event_hub_name, skip:skip, top:top, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_event_hub_next_async(next_page_link, custom_headers:custom_headers) end page end end |
#list_by_event_hub_async(resource_group_name, namespace_name, event_hub_name, skip: nil, top: nil, custom_headers: nil) ⇒ Concurrent::Promise
Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
azure subscription. partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. to the HTTP request.
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 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 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 426 def list_by_event_hub_async(resource_group_name, namespace_name, event_hub_name, skip:nil, top:nil, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1 fail ArgumentError, 'namespace_name is nil' if namespace_name.nil? fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50 fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6 fail ArgumentError, 'event_hub_name is nil' if event_hub_name.nil? fail ArgumentError, "'event_hub_name' should satisfy the constraint - 'MinLength': '1'" if !event_hub_name.nil? && event_hub_name.length < 1 fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !skip.nil? && skip > 1000 fail ArgumentError, "'skip' should satisfy the constraint - 'InclusiveMinimum': '0'" if !skip.nil? && skip < 0 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000 fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1 request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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}/consumergroups' request_url = @base_url || @client.base_url = { 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,'$skip' => skip,'$top' => top}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) 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 MsRest::HttpOperationError.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 = Azure::EventHub::Mgmt::V2017_04_01::Models::ConsumerGroupListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_event_hub_next(next_page_link, custom_headers: nil) ⇒ ConsumerGroupListResult
Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
to List operation. will be added to the HTTP request.
500 501 502 503 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 500 def list_by_event_hub_next(next_page_link, custom_headers:nil) response = list_by_event_hub_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_by_event_hub_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
to List operation. to the HTTP request.
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 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 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 531 def list_by_event_hub_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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 = { 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, ) 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 MsRest::HttpOperationError.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 = Azure::EventHub::Mgmt::V2017_04_01::Models::ConsumerGroupListResult.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_by_event_hub_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
to List operation. will be added to the HTTP request.
516 517 518 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 516 def list_by_event_hub_next_with_http_info(next_page_link, custom_headers:nil) list_by_event_hub_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_by_event_hub_with_http_info(resource_group_name, namespace_name, event_hub_name, skip: nil, top: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists in the Namespace.
azure subscription. partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skip parameter that specifies a starting point to use for subsequent calls. recent N usageDetails. will be added to the HTTP request.
403 404 405 |
# File 'lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb', line 403 def list_by_event_hub_with_http_info(resource_group_name, namespace_name, event_hub_name, skip:nil, top:nil, custom_headers:nil) list_by_event_hub_async(resource_group_name, namespace_name, event_hub_name, skip:skip, top:top, custom_headers:custom_headers).value! end |