azure_mgmt_event_hub 0.17.2 → 0.17.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2015-08-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +1 -1
  3. data/lib/2017-04-01/generated/azure_mgmt_event_hub.rb +19 -13
  4. data/lib/2017-04-01/generated/azure_mgmt_event_hub/disaster_recovery_configs.rb +3 -3
  5. data/lib/2017-04-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +1 -1
  6. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/arm_disaster_recovery.rb +1 -1
  7. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/capture_description.rb +11 -0
  8. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/consumer_group.rb +1 -1
  9. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/default_action.rb +16 -0
  10. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/ehnamespace.rb +13 -1
  11. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/error_response.rb +1 -1
  12. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_ipaction.rb +15 -0
  13. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_set.rb +114 -0
  14. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/nwrule_set_ip_rules.rb +59 -0
  15. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/nwrule_set_virtual_network_rules.rb +59 -0
  16. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/regenerate_access_key_parameters.rb +1 -1
  17. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/sku.rb +1 -1
  18. data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/subnet.rb +46 -0
  19. data/lib/2017-04-01/generated/azure_mgmt_event_hub/namespaces.rb +209 -0
  20. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub.rb +15 -6
  21. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/clusters.rb +467 -0
  22. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/event_hub2018preview_management_client.rb +1 -1
  23. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/available_clusters_list.rb +63 -0
  24. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/default_action.rb +16 -0
  25. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace.rb +1 -1
  26. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace_id_container.rb +46 -0
  27. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace_id_list_result.rb +56 -0
  28. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/network_rule_ipaction.rb +15 -0
  29. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/network_rule_set.rb +114 -0
  30. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/nwrule_set_ip_rules.rb +58 -0
  31. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/nwrule_set_virtual_network_rules.rb +59 -0
  32. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/sku.rb +1 -1
  33. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/subnet.rb +46 -0
  34. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/virtual_network_rule_list_result.rb +5 -5
  35. data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb +220 -11
  36. data/lib/profiles/latest/modules/eventhub_profile_module.rb +55 -19
  37. data/lib/version.rb +1 -1
  38. metadata +18 -3
@@ -7,7 +7,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
7
7
  module Models
8
8
  #
9
9
  # Parameters supplied to the Regenerate Authorization Rule operation,
10
- # specifies which key neeeds to be reset.
10
+ # specifies which key needs to be reset.
11
11
  #
12
12
  class RegenerateAccessKeyParameters
13
13
 
@@ -20,7 +20,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
20
20
  # values include: 'Basic', 'Standard'
21
21
  attr_accessor :tier
22
22
 
23
- # @return [Integer] The Event Hubs throughput units, vaule should be 0 to
23
+ # @return [Integer] The Event Hubs throughput units, value should be 0 to
24
24
  # 20 throughput units.
25
25
  attr_accessor :capacity
26
26
 
@@ -0,0 +1,46 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::EventHub::Mgmt::V2017_04_01
7
+ module Models
8
+ #
9
+ # Properties supplied for Subnet
10
+ #
11
+ class Subnet
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Resource ID of Virtual Network Subnet
16
+ attr_accessor :id
17
+
18
+
19
+ #
20
+ # Mapper for Subnet class as Ruby Hash.
21
+ # This will be used for serialization/deserialization.
22
+ #
23
+ def self.mapper()
24
+ {
25
+ client_side_validation: true,
26
+ required: false,
27
+ serialized_name: 'Subnet',
28
+ type: {
29
+ name: 'Composite',
30
+ class_name: 'Subnet',
31
+ model_properties: {
32
+ id: {
33
+ client_side_validation: true,
34
+ required: true,
35
+ serialized_name: 'id',
36
+ type: {
37
+ name: 'String'
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1354,6 +1354,215 @@ module Azure::EventHub::Mgmt::V2017_04_01
1354
1354
  promise.execute
1355
1355
  end
1356
1356
 
1357
+ #
1358
+ # Create or update NetworkRuleSet for a Namespace.
1359
+ #
1360
+ # @param resource_group_name [String] Name of the resource group within the
1361
+ # azure subscription.
1362
+ # @param namespace_name [String] The Namespace name
1363
+ # @param parameters [NetworkRuleSet] The Namespace IpFilterRule.
1364
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1365
+ # will be added to the HTTP request.
1366
+ #
1367
+ # @return [NetworkRuleSet] operation results.
1368
+ #
1369
+ def create_or_update_network_rule_set(resource_group_name, namespace_name, parameters, custom_headers:nil)
1370
+ response = create_or_update_network_rule_set_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
1371
+ response.body unless response.nil?
1372
+ end
1373
+
1374
+ #
1375
+ # Create or update NetworkRuleSet for a Namespace.
1376
+ #
1377
+ # @param resource_group_name [String] Name of the resource group within the
1378
+ # azure subscription.
1379
+ # @param namespace_name [String] The Namespace name
1380
+ # @param parameters [NetworkRuleSet] The Namespace IpFilterRule.
1381
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1382
+ # will be added to the HTTP request.
1383
+ #
1384
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1385
+ #
1386
+ def create_or_update_network_rule_set_with_http_info(resource_group_name, namespace_name, parameters, custom_headers:nil)
1387
+ create_or_update_network_rule_set_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
1388
+ end
1389
+
1390
+ #
1391
+ # Create or update NetworkRuleSet for a Namespace.
1392
+ #
1393
+ # @param resource_group_name [String] Name of the resource group within the
1394
+ # azure subscription.
1395
+ # @param namespace_name [String] The Namespace name
1396
+ # @param parameters [NetworkRuleSet] The Namespace IpFilterRule.
1397
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1398
+ # to the HTTP request.
1399
+ #
1400
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1401
+ #
1402
+ def create_or_update_network_rule_set_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
1403
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1404
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1405
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1406
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1407
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1408
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1409
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1410
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1411
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1412
+
1413
+
1414
+ request_headers = {}
1415
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1416
+
1417
+ # Set Headers
1418
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1419
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1420
+
1421
+ # Serialize Request
1422
+ request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::NetworkRuleSet.mapper()
1423
+ request_content = @client.serialize(request_mapper, parameters)
1424
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1425
+
1426
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default'
1427
+
1428
+ request_url = @base_url || @client.base_url
1429
+
1430
+ options = {
1431
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1432
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
1433
+ query_params: {'api-version' => @client.api_version},
1434
+ body: request_content,
1435
+ headers: request_headers.merge(custom_headers || {}),
1436
+ base_url: request_url
1437
+ }
1438
+ promise = @client.make_request_async(:put, path_template, options)
1439
+
1440
+ promise = promise.then do |result|
1441
+ http_response = result.response
1442
+ status_code = http_response.status
1443
+ response_content = http_response.body
1444
+ unless status_code == 200
1445
+ error_model = JSON.load(response_content)
1446
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1447
+ end
1448
+
1449
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1450
+ # Deserialize Response
1451
+ if status_code == 200
1452
+ begin
1453
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1454
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::NetworkRuleSet.mapper()
1455
+ result.body = @client.deserialize(result_mapper, parsed_response)
1456
+ rescue Exception => e
1457
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1458
+ end
1459
+ end
1460
+
1461
+ result
1462
+ end
1463
+
1464
+ promise.execute
1465
+ end
1466
+
1467
+ #
1468
+ # Gets NetworkRuleSet for a Namespace.
1469
+ #
1470
+ # @param resource_group_name [String] Name of the resource group within the
1471
+ # azure subscription.
1472
+ # @param namespace_name [String] The Namespace name
1473
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1474
+ # will be added to the HTTP request.
1475
+ #
1476
+ # @return [NetworkRuleSet] operation results.
1477
+ #
1478
+ def get_network_rule_set(resource_group_name, namespace_name, custom_headers:nil)
1479
+ response = get_network_rule_set_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
1480
+ response.body unless response.nil?
1481
+ end
1482
+
1483
+ #
1484
+ # Gets NetworkRuleSet for a Namespace.
1485
+ #
1486
+ # @param resource_group_name [String] Name of the resource group within the
1487
+ # azure subscription.
1488
+ # @param namespace_name [String] The Namespace name
1489
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1490
+ # will be added to the HTTP request.
1491
+ #
1492
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1493
+ #
1494
+ def get_network_rule_set_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
1495
+ get_network_rule_set_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
1496
+ end
1497
+
1498
+ #
1499
+ # Gets NetworkRuleSet for a Namespace.
1500
+ #
1501
+ # @param resource_group_name [String] Name of the resource group within the
1502
+ # azure subscription.
1503
+ # @param namespace_name [String] The Namespace name
1504
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1505
+ # to the HTTP request.
1506
+ #
1507
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1508
+ #
1509
+ def get_network_rule_set_async(resource_group_name, namespace_name, custom_headers:nil)
1510
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1511
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1512
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1513
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1514
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
1515
+ fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
1516
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1517
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1518
+
1519
+
1520
+ request_headers = {}
1521
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1522
+
1523
+ # Set Headers
1524
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1525
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1526
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default'
1527
+
1528
+ request_url = @base_url || @client.base_url
1529
+
1530
+ options = {
1531
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1532
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
1533
+ query_params: {'api-version' => @client.api_version},
1534
+ headers: request_headers.merge(custom_headers || {}),
1535
+ base_url: request_url
1536
+ }
1537
+ promise = @client.make_request_async(:get, path_template, options)
1538
+
1539
+ promise = promise.then do |result|
1540
+ http_response = result.response
1541
+ status_code = http_response.status
1542
+ response_content = http_response.body
1543
+ unless status_code == 200
1544
+ error_model = JSON.load(response_content)
1545
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1546
+ end
1547
+
1548
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1549
+ # Deserialize Response
1550
+ if status_code == 200
1551
+ begin
1552
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1553
+ result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::NetworkRuleSet.mapper()
1554
+ result.body = @client.deserialize(result_mapper, parsed_response)
1555
+ rescue Exception => e
1556
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1557
+ end
1558
+ end
1559
+
1560
+ result
1561
+ end
1562
+
1563
+ promise.execute
1564
+ end
1565
+
1357
1566
  #
1358
1567
  # Creates or updates a namespace. Once created, this namespace's resource
1359
1568
  # manifest is immutable. This operation is idempotent.
@@ -27,25 +27,34 @@ module Azure::EventHub::Mgmt::V2018_01_01_preview
27
27
  autoload :EventHub2018PreviewManagementClient, '2018-01-01-preview/generated/azure_mgmt_event_hub/event_hub2018preview_management_client.rb'
28
28
 
29
29
  module Models
30
- autoload :ClusterQuotaConfigurationProperties, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster_quota_configuration_properties.rb'
30
+ autoload :EHNamespaceIdListResult, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace_id_list_result.rb'
31
31
  autoload :OperationDisplay, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/operation_display.rb'
32
- autoload :ErrorResponse, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/error_response.rb'
32
+ autoload :Sku, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/sku.rb'
33
33
  autoload :OperationListResult, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/operation_list_result.rb'
34
+ autoload :Operation, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/operation.rb'
35
+ autoload :Subnet, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/subnet.rb'
36
+ autoload :AvailableClustersList, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/available_clusters_list.rb'
37
+ autoload :ClusterSku, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster_sku.rb'
38
+ autoload :ClusterQuotaConfigurationProperties, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster_quota_configuration_properties.rb'
34
39
  autoload :VirtualNetworkRuleListResult, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/virtual_network_rule_list_result.rb'
35
40
  autoload :Resource, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/resource.rb'
36
- autoload :Operation, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/operation.rb'
37
- autoload :Sku, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/sku.rb'
41
+ autoload :EHNamespaceListResult, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace_list_result.rb'
38
42
  autoload :ClusterListResult, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster_list_result.rb'
43
+ autoload :NWRuleSetVirtualNetworkRules, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/nwrule_set_virtual_network_rules.rb'
44
+ autoload :EHNamespaceIdContainer, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace_id_container.rb'
39
45
  autoload :IpFilterRuleListResult, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/ip_filter_rule_list_result.rb'
40
- autoload :ClusterSku, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster_sku.rb'
41
- autoload :EHNamespaceListResult, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace_list_result.rb'
46
+ autoload :ErrorResponse, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/error_response.rb'
47
+ autoload :NWRuleSetIpRules, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/nwrule_set_ip_rules.rb'
42
48
  autoload :TrackedResource, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/tracked_resource.rb'
43
49
  autoload :Cluster, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster.rb'
44
50
  autoload :EHNamespace, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace.rb'
45
51
  autoload :IpFilterRule, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/ip_filter_rule.rb'
46
52
  autoload :VirtualNetworkRule, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/virtual_network_rule.rb'
53
+ autoload :NetworkRuleSet, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/network_rule_set.rb'
47
54
  autoload :SkuName, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/sku_name.rb'
48
55
  autoload :SkuTier, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/sku_tier.rb'
49
56
  autoload :IPAction, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/ipaction.rb'
57
+ autoload :NetworkRuleIPAction, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/network_rule_ipaction.rb'
58
+ autoload :DefaultAction, '2018-01-01-preview/generated/azure_mgmt_event_hub/models/default_action.rb'
50
59
  end
51
60
  end
@@ -22,6 +22,93 @@ module Azure::EventHub::Mgmt::V2018_01_01_preview
22
22
  # @return [EventHub2018PreviewManagementClient] reference to the EventHub2018PreviewManagementClient
23
23
  attr_reader :client
24
24
 
25
+ #
26
+ # List the quantity of available pre-provisioned Event Hubs Clusters, indexed
27
+ # by Azure region.
28
+ #
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [AvailableClustersList] operation results.
33
+ #
34
+ def list_available_clusters(custom_headers:nil)
35
+ response = list_available_clusters_async(custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # List the quantity of available pre-provisioned Event Hubs Clusters, indexed
41
+ # by Azure region.
42
+ #
43
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
44
+ # will be added to the HTTP request.
45
+ #
46
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
47
+ #
48
+ def list_available_clusters_with_http_info(custom_headers:nil)
49
+ list_available_clusters_async(custom_headers:custom_headers).value!
50
+ end
51
+
52
+ #
53
+ # List the quantity of available pre-provisioned Event Hubs Clusters, indexed
54
+ # by Azure region.
55
+ #
56
+ # @param [Hash{String => String}] A hash of custom headers that will be added
57
+ # to the HTTP request.
58
+ #
59
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
60
+ #
61
+ def list_available_clusters_async(custom_headers:nil)
62
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
63
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
64
+
65
+
66
+ request_headers = {}
67
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
68
+
69
+ # Set Headers
70
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
71
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
72
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventHub/availableClusters'
73
+
74
+ request_url = @base_url || @client.base_url
75
+
76
+ options = {
77
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
78
+ path_params: {'subscriptionId' => @client.subscription_id},
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:get, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ # Deserialize Response
96
+ if status_code == 200
97
+ begin
98
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
99
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::AvailableClustersList.mapper()
100
+ result.body = @client.deserialize(result_mapper, parsed_response)
101
+ rescue Exception => e
102
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
103
+ end
104
+ end
105
+
106
+ result
107
+ end
108
+
109
+ promise.execute
110
+ end
111
+
25
112
  #
26
113
  # Lists the available Event Hubs Clusters within an ARM resource group.
27
114
  #
@@ -214,6 +301,50 @@ module Azure::EventHub::Mgmt::V2018_01_01_preview
214
301
  promise.execute
215
302
  end
216
303
 
304
+ #
305
+ # Creates or updates an instance of an Event Hubs Cluster.
306
+ #
307
+ # @param resource_group_name [String] Name of the resource group within the
308
+ # Azure subscription.
309
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
310
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
311
+ # will be added to the HTTP request.
312
+ #
313
+ # @return [Cluster] operation results.
314
+ #
315
+ def put(resource_group_name, cluster_name, custom_headers:nil)
316
+ response = put_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
317
+ response.body unless response.nil?
318
+ end
319
+
320
+ #
321
+ # @param resource_group_name [String] Name of the resource group within the
322
+ # Azure subscription.
323
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
324
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
325
+ # will be added to the HTTP request.
326
+ #
327
+ # @return [Concurrent::Promise] promise which provides async access to http
328
+ # response.
329
+ #
330
+ def put_async(resource_group_name, cluster_name, custom_headers:nil)
331
+ # Send request
332
+ promise = begin_put_async(resource_group_name, cluster_name, custom_headers:custom_headers)
333
+
334
+ promise = promise.then do |response|
335
+ # Defining deserialization method.
336
+ deserialize_method = lambda do |parsed_response|
337
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::Cluster.mapper()
338
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
339
+ end
340
+
341
+ # Waiting for response.
342
+ @client.get_long_running_operation_result(response, deserialize_method)
343
+ end
344
+
345
+ promise
346
+ end
347
+
217
348
  #
218
349
  # Modifies mutable properties on the Event Hubs Cluster. This operation is
219
350
  # idempotent.
@@ -263,6 +394,254 @@ module Azure::EventHub::Mgmt::V2018_01_01_preview
263
394
  promise
264
395
  end
265
396
 
397
+ #
398
+ # Deletes an existing Event Hubs Cluster. This operation is idempotent.
399
+ #
400
+ # @param resource_group_name [String] Name of the resource group within the
401
+ # Azure subscription.
402
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
403
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
404
+ # will be added to the HTTP request.
405
+ #
406
+ def delete(resource_group_name, cluster_name, custom_headers:nil)
407
+ response = delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
408
+ nil
409
+ end
410
+
411
+ #
412
+ # @param resource_group_name [String] Name of the resource group within the
413
+ # Azure subscription.
414
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
415
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
416
+ # will be added to the HTTP request.
417
+ #
418
+ # @return [Concurrent::Promise] promise which provides async access to http
419
+ # response.
420
+ #
421
+ def delete_async(resource_group_name, cluster_name, custom_headers:nil)
422
+ # Send request
423
+ promise = begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers)
424
+
425
+ promise = promise.then do |response|
426
+ # Defining deserialization method.
427
+ deserialize_method = lambda do |parsed_response|
428
+ end
429
+
430
+ # Waiting for response.
431
+ @client.get_long_running_operation_result(response, deserialize_method)
432
+ end
433
+
434
+ promise
435
+ end
436
+
437
+ #
438
+ # List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster.
439
+ #
440
+ # @param resource_group_name [String] Name of the resource group within the
441
+ # Azure subscription.
442
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
443
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
444
+ # will be added to the HTTP request.
445
+ #
446
+ # @return [EHNamespaceIdListResult] operation results.
447
+ #
448
+ def list_namespaces(resource_group_name, cluster_name, custom_headers:nil)
449
+ response = list_namespaces_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
450
+ response.body unless response.nil?
451
+ end
452
+
453
+ #
454
+ # List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster.
455
+ #
456
+ # @param resource_group_name [String] Name of the resource group within the
457
+ # Azure subscription.
458
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
459
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
460
+ # will be added to the HTTP request.
461
+ #
462
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
463
+ #
464
+ def list_namespaces_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
465
+ list_namespaces_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
466
+ end
467
+
468
+ #
469
+ # List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster.
470
+ #
471
+ # @param resource_group_name [String] Name of the resource group within the
472
+ # Azure subscription.
473
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
474
+ # @param [Hash{String => String}] A hash of custom headers that will be added
475
+ # to the HTTP request.
476
+ #
477
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
478
+ #
479
+ def list_namespaces_async(resource_group_name, cluster_name, custom_headers:nil)
480
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
481
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
482
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
483
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
484
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
485
+ fail ArgumentError, "'cluster_name' should satisfy the constraint - 'MaxLength': '50'" if !cluster_name.nil? && cluster_name.length > 50
486
+ fail ArgumentError, "'cluster_name' should satisfy the constraint - 'MinLength': '6'" if !cluster_name.nil? && cluster_name.length < 6
487
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
488
+
489
+
490
+ request_headers = {}
491
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
492
+
493
+ # Set Headers
494
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
495
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
496
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}/namespaces'
497
+
498
+ request_url = @base_url || @client.base_url
499
+
500
+ options = {
501
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
502
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
503
+ query_params: {'api-version' => @client.api_version},
504
+ headers: request_headers.merge(custom_headers || {}),
505
+ base_url: request_url
506
+ }
507
+ promise = @client.make_request_async(:get, path_template, options)
508
+
509
+ promise = promise.then do |result|
510
+ http_response = result.response
511
+ status_code = http_response.status
512
+ response_content = http_response.body
513
+ unless status_code == 200
514
+ error_model = JSON.load(response_content)
515
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
516
+ end
517
+
518
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
519
+ # Deserialize Response
520
+ if status_code == 200
521
+ begin
522
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
523
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::EHNamespaceIdListResult.mapper()
524
+ result.body = @client.deserialize(result_mapper, parsed_response)
525
+ rescue Exception => e
526
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
527
+ end
528
+ end
529
+
530
+ result
531
+ end
532
+
533
+ promise.execute
534
+ end
535
+
536
+ #
537
+ # Creates or updates an instance of an Event Hubs Cluster.
538
+ #
539
+ # @param resource_group_name [String] Name of the resource group within the
540
+ # Azure subscription.
541
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
542
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
543
+ # will be added to the HTTP request.
544
+ #
545
+ # @return [Cluster] operation results.
546
+ #
547
+ def begin_put(resource_group_name, cluster_name, custom_headers:nil)
548
+ response = begin_put_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
549
+ response.body unless response.nil?
550
+ end
551
+
552
+ #
553
+ # Creates or updates an instance of an Event Hubs Cluster.
554
+ #
555
+ # @param resource_group_name [String] Name of the resource group within the
556
+ # Azure subscription.
557
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
558
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
559
+ # will be added to the HTTP request.
560
+ #
561
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
562
+ #
563
+ def begin_put_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
564
+ begin_put_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
565
+ end
566
+
567
+ #
568
+ # Creates or updates an instance of an Event Hubs Cluster.
569
+ #
570
+ # @param resource_group_name [String] Name of the resource group within the
571
+ # Azure subscription.
572
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
573
+ # @param [Hash{String => String}] A hash of custom headers that will be added
574
+ # to the HTTP request.
575
+ #
576
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
577
+ #
578
+ def begin_put_async(resource_group_name, cluster_name, custom_headers:nil)
579
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
580
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
581
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
582
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
583
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
584
+ fail ArgumentError, "'cluster_name' should satisfy the constraint - 'MaxLength': '50'" if !cluster_name.nil? && cluster_name.length > 50
585
+ fail ArgumentError, "'cluster_name' should satisfy the constraint - 'MinLength': '6'" if !cluster_name.nil? && cluster_name.length < 6
586
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
587
+
588
+
589
+ request_headers = {}
590
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
591
+
592
+ # Set Headers
593
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
594
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
595
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'
596
+
597
+ request_url = @base_url || @client.base_url
598
+
599
+ options = {
600
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
601
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
602
+ query_params: {'api-version' => @client.api_version},
603
+ headers: request_headers.merge(custom_headers || {}),
604
+ base_url: request_url
605
+ }
606
+ promise = @client.make_request_async(:put, path_template, options)
607
+
608
+ promise = promise.then do |result|
609
+ http_response = result.response
610
+ status_code = http_response.status
611
+ response_content = http_response.body
612
+ unless status_code == 200 || status_code == 201 || status_code == 202
613
+ error_model = JSON.load(response_content)
614
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
615
+ end
616
+
617
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
618
+ # Deserialize Response
619
+ if status_code == 200
620
+ begin
621
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
622
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::Cluster.mapper()
623
+ result.body = @client.deserialize(result_mapper, parsed_response)
624
+ rescue Exception => e
625
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
626
+ end
627
+ end
628
+ # Deserialize Response
629
+ if status_code == 201
630
+ begin
631
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
632
+ result_mapper = Azure::EventHub::Mgmt::V2018_01_01_preview::Models::Cluster.mapper()
633
+ result.body = @client.deserialize(result_mapper, parsed_response)
634
+ rescue Exception => e
635
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
636
+ end
637
+ end
638
+
639
+ result
640
+ end
641
+
642
+ promise.execute
643
+ end
644
+
266
645
  #
267
646
  # Modifies mutable properties on the Event Hubs Cluster. This operation is
268
647
  # idempotent.
@@ -389,6 +768,94 @@ module Azure::EventHub::Mgmt::V2018_01_01_preview
389
768
  promise.execute
390
769
  end
391
770
 
771
+ #
772
+ # Deletes an existing Event Hubs Cluster. This operation is idempotent.
773
+ #
774
+ # @param resource_group_name [String] Name of the resource group within the
775
+ # Azure subscription.
776
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
777
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
778
+ # will be added to the HTTP request.
779
+ #
780
+ #
781
+ def begin_delete(resource_group_name, cluster_name, custom_headers:nil)
782
+ response = begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
783
+ nil
784
+ end
785
+
786
+ #
787
+ # Deletes an existing Event Hubs Cluster. This operation is idempotent.
788
+ #
789
+ # @param resource_group_name [String] Name of the resource group within the
790
+ # Azure subscription.
791
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
792
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
793
+ # will be added to the HTTP request.
794
+ #
795
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
796
+ #
797
+ def begin_delete_with_http_info(resource_group_name, cluster_name, custom_headers:nil)
798
+ begin_delete_async(resource_group_name, cluster_name, custom_headers:custom_headers).value!
799
+ end
800
+
801
+ #
802
+ # Deletes an existing Event Hubs Cluster. This operation is idempotent.
803
+ #
804
+ # @param resource_group_name [String] Name of the resource group within the
805
+ # Azure subscription.
806
+ # @param cluster_name [String] The name of the Event Hubs Cluster.
807
+ # @param [Hash{String => String}] A hash of custom headers that will be added
808
+ # to the HTTP request.
809
+ #
810
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
811
+ #
812
+ def begin_delete_async(resource_group_name, cluster_name, custom_headers:nil)
813
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
814
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
815
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
816
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
817
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
818
+ fail ArgumentError, "'cluster_name' should satisfy the constraint - 'MaxLength': '50'" if !cluster_name.nil? && cluster_name.length > 50
819
+ fail ArgumentError, "'cluster_name' should satisfy the constraint - 'MinLength': '6'" if !cluster_name.nil? && cluster_name.length < 6
820
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
821
+
822
+
823
+ request_headers = {}
824
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
825
+
826
+ # Set Headers
827
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
828
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
829
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}'
830
+
831
+ request_url = @base_url || @client.base_url
832
+
833
+ options = {
834
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
835
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
836
+ query_params: {'api-version' => @client.api_version},
837
+ headers: request_headers.merge(custom_headers || {}),
838
+ base_url: request_url
839
+ }
840
+ promise = @client.make_request_async(:delete, path_template, options)
841
+
842
+ promise = promise.then do |result|
843
+ http_response = result.response
844
+ status_code = http_response.status
845
+ response_content = http_response.body
846
+ unless status_code == 200 || status_code == 202 || status_code == 204
847
+ error_model = JSON.load(response_content)
848
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
849
+ end
850
+
851
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
852
+
853
+ result
854
+ end
855
+
856
+ promise.execute
857
+ end
858
+
392
859
  #
393
860
  # Lists the available Event Hubs Clusters within an ARM resource group.
394
861
  #