azure_mgmt_service_bus 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_service_bus.rb +21 -16
  3. data/lib/generated/azure_mgmt_service_bus/disaster_recovery_configs.rb +711 -0
  4. data/lib/generated/azure_mgmt_service_bus/event_hubs.rb +1 -1
  5. data/lib/generated/azure_mgmt_service_bus/models/access_keys.rb +25 -1
  6. data/lib/generated/azure_mgmt_service_bus/models/access_rights.rb +1 -1
  7. data/lib/generated/azure_mgmt_service_bus/models/action.rb +1 -1
  8. data/lib/generated/azure_mgmt_service_bus/models/arm_disaster_recovery.rb +99 -0
  9. data/lib/generated/azure_mgmt_service_bus/models/arm_disaster_recovery_list_result.rb +97 -0
  10. data/lib/generated/azure_mgmt_service_bus/models/authorization_rule_properties.rb +1 -1
  11. data/lib/generated/azure_mgmt_service_bus/models/capture_description.rb +1 -1
  12. data/lib/generated/azure_mgmt_service_bus/models/check_name_availability.rb +1 -1
  13. data/lib/generated/azure_mgmt_service_bus/models/check_name_availability_result.rb +1 -1
  14. data/lib/generated/azure_mgmt_service_bus/models/correlation_filter.rb +1 -1
  15. data/lib/generated/azure_mgmt_service_bus/models/destination.rb +1 -1
  16. data/lib/generated/azure_mgmt_service_bus/models/encoding_capture_description.rb +1 -1
  17. data/lib/generated/azure_mgmt_service_bus/models/entity_status.rb +1 -1
  18. data/lib/generated/azure_mgmt_service_bus/models/error_response.rb +1 -1
  19. data/lib/generated/azure_mgmt_service_bus/models/event_hub_list_result.rb +1 -1
  20. data/lib/generated/azure_mgmt_service_bus/models/eventhub.rb +1 -1
  21. data/lib/generated/azure_mgmt_service_bus/models/filter_type.rb +1 -1
  22. data/lib/generated/azure_mgmt_service_bus/models/key_type.rb +1 -1
  23. data/lib/generated/azure_mgmt_service_bus/models/message_count_details.rb +1 -1
  24. data/lib/generated/azure_mgmt_service_bus/models/operation.rb +1 -1
  25. data/lib/generated/azure_mgmt_service_bus/models/operation_display.rb +1 -1
  26. data/lib/generated/azure_mgmt_service_bus/models/operation_list_result.rb +1 -1
  27. data/lib/generated/azure_mgmt_service_bus/models/premium_messaging_regions.rb +1 -1
  28. data/lib/generated/azure_mgmt_service_bus/models/premium_messaging_regions_list_result.rb +1 -1
  29. data/lib/generated/azure_mgmt_service_bus/models/premium_messaging_regions_properties.rb +1 -1
  30. data/lib/generated/azure_mgmt_service_bus/models/provisioning_state_dr.rb +17 -0
  31. data/lib/generated/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb +1 -1
  32. data/lib/generated/azure_mgmt_service_bus/models/resource_namespace_patch.rb +1 -1
  33. data/lib/generated/azure_mgmt_service_bus/models/role_disaster_recovery.rb +17 -0
  34. data/lib/generated/azure_mgmt_service_bus/models/rule.rb +1 -1
  35. data/lib/generated/azure_mgmt_service_bus/models/rule_list_result.rb +1 -1
  36. data/lib/generated/azure_mgmt_service_bus/models/sbauthorization_rule.rb +1 -1
  37. data/lib/generated/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb +1 -1
  38. data/lib/generated/azure_mgmt_service_bus/models/sbnamespace.rb +1 -1
  39. data/lib/generated/azure_mgmt_service_bus/models/sbnamespace_list_result.rb +1 -1
  40. data/lib/generated/azure_mgmt_service_bus/models/sbnamespace_update_parameters.rb +1 -1
  41. data/lib/generated/azure_mgmt_service_bus/models/sbqueue.rb +1 -1
  42. data/lib/generated/azure_mgmt_service_bus/models/sbqueue_list_result.rb +1 -1
  43. data/lib/generated/azure_mgmt_service_bus/models/sbsku.rb +1 -1
  44. data/lib/generated/azure_mgmt_service_bus/models/sbsubscription.rb +1 -1
  45. data/lib/generated/azure_mgmt_service_bus/models/sbsubscription_list_result.rb +1 -1
  46. data/lib/generated/azure_mgmt_service_bus/models/sbtopic.rb +1 -1
  47. data/lib/generated/azure_mgmt_service_bus/models/sbtopic_list_result.rb +1 -1
  48. data/lib/generated/azure_mgmt_service_bus/models/sku_name.rb +1 -1
  49. data/lib/generated/azure_mgmt_service_bus/models/sku_tier.rb +1 -1
  50. data/lib/generated/azure_mgmt_service_bus/models/sql_filter.rb +1 -1
  51. data/lib/generated/azure_mgmt_service_bus/models/sql_rule_action.rb +1 -1
  52. data/lib/generated/azure_mgmt_service_bus/models/tracked_resource.rb +1 -1
  53. data/lib/generated/azure_mgmt_service_bus/models/unavailable_reason.rb +1 -1
  54. data/lib/generated/azure_mgmt_service_bus/module_definition.rb +1 -1
  55. data/lib/generated/azure_mgmt_service_bus/namespaces.rb +1 -1
  56. data/lib/generated/azure_mgmt_service_bus/operations.rb +1 -1
  57. data/lib/generated/azure_mgmt_service_bus/premium_messaging_regions_operations.rb +1 -1
  58. data/lib/generated/azure_mgmt_service_bus/queues.rb +1 -1
  59. data/lib/generated/azure_mgmt_service_bus/regions.rb +1 -1
  60. data/lib/generated/azure_mgmt_service_bus/rules.rb +1 -1
  61. data/lib/generated/azure_mgmt_service_bus/service_bus_management_client.rb +5 -1
  62. data/lib/generated/azure_mgmt_service_bus/subscriptions.rb +1 -1
  63. data/lib/generated/azure_mgmt_service_bus/topics.rb +1 -1
  64. data/lib/generated/azure_mgmt_service_bus/version.rb +2 -2
  65. metadata +7 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f69464686232baf3be7a3541e38410f3c3cfac05
4
- data.tar.gz: 4dda3ba1b54f809ee76d2e4ce911367f9a250a58
3
+ metadata.gz: 8f40702857522c666dfbdaf1278b392572bf2ad0
4
+ data.tar.gz: 785ec3f4873209d33159596d84bb7fc7a3c19ee8
5
5
  SHA512:
6
- metadata.gz: 703b239738744d9367a001a722df0e6f54fa2c56e1e00e5676cde13bd3b462e319407bce2920b15db77ea55d63b2191acce2ddfe6ade8d075b251e9ae9d192de
7
- data.tar.gz: bfbeee5eebe626b6589ad48ccaa79cf1a045cab1d5b191de37b048dcaeb9463da89dfe048364f7528d3bf70833efb78598bf3b8cafa8a6f90cfcba8c93d19ea2
6
+ metadata.gz: ac3cc24f4c049a3876babf2e27dd45c9a6a6f2f16b5ba0bad0fb6cc6de2ae2631d2df99f33b0678f06cbb81ee6aac71bea07d3c370b1d579cf94dc159cd7d805
7
+ data.tar.gz: 884b8c222d0f54c21666742167ed175686163ba91304f4c00d92f279a97ffe86f7e62c8635f2a3f1345c1450656642c633db980c07aff275ad8681872cac1afd
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
- # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
3
  # Changes may cause incorrect behavior and will be lost if the code is
4
4
  # regenerated.
5
5
 
@@ -22,6 +22,7 @@ require 'ms_rest_azure'
22
22
  module Azure::ARM::ServiceBus
23
23
  autoload :Operations, 'generated/azure_mgmt_service_bus/operations.rb'
24
24
  autoload :Namespaces, 'generated/azure_mgmt_service_bus/namespaces.rb'
25
+ autoload :DisasterRecoveryConfigs, 'generated/azure_mgmt_service_bus/disaster_recovery_configs.rb'
25
26
  autoload :Queues, 'generated/azure_mgmt_service_bus/queues.rb'
26
27
  autoload :Topics, 'generated/azure_mgmt_service_bus/topics.rb'
27
28
  autoload :Subscriptions, 'generated/azure_mgmt_service_bus/subscriptions.rb'
@@ -32,31 +33,32 @@ module Azure::ARM::ServiceBus
32
33
  autoload :ServiceBusManagementClient, 'generated/azure_mgmt_service_bus/service_bus_management_client.rb'
33
34
 
34
35
  module Models
35
- autoload :CheckNameAvailability, 'generated/azure_mgmt_service_bus/models/check_name_availability.rb'
36
- autoload :PremiumMessagingRegionsListResult, 'generated/azure_mgmt_service_bus/models/premium_messaging_regions_list_result.rb'
36
+ autoload :CheckNameAvailabilityResult, 'generated/azure_mgmt_service_bus/models/check_name_availability_result.rb'
37
37
  autoload :SBQueueListResult, 'generated/azure_mgmt_service_bus/models/sbqueue_list_result.rb'
38
- autoload :PremiumMessagingRegionsProperties, 'generated/azure_mgmt_service_bus/models/premium_messaging_regions_properties.rb'
39
- autoload :EventHubListResult, 'generated/azure_mgmt_service_bus/models/event_hub_list_result.rb'
38
+ autoload :PremiumMessagingRegionsListResult, 'generated/azure_mgmt_service_bus/models/premium_messaging_regions_list_result.rb'
39
+ autoload :SBSku, 'generated/azure_mgmt_service_bus/models/sbsku.rb'
40
40
  autoload :SBTopicListResult, 'generated/azure_mgmt_service_bus/models/sbtopic_list_result.rb'
41
+ autoload :SBNamespaceListResult, 'generated/azure_mgmt_service_bus/models/sbnamespace_list_result.rb'
42
+ autoload :PremiumMessagingRegionsProperties, 'generated/azure_mgmt_service_bus/models/premium_messaging_regions_properties.rb'
41
43
  autoload :CaptureDescription, 'generated/azure_mgmt_service_bus/models/capture_description.rb'
42
- autoload :RuleListResult, 'generated/azure_mgmt_service_bus/models/rule_list_result.rb'
43
- autoload :SBAuthorizationRuleListResult, 'generated/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb'
44
44
  autoload :SBSubscriptionListResult, 'generated/azure_mgmt_service_bus/models/sbsubscription_list_result.rb'
45
- autoload :AccessKeys, 'generated/azure_mgmt_service_bus/models/access_keys.rb'
46
- autoload :CorrelationFilter, 'generated/azure_mgmt_service_bus/models/correlation_filter.rb'
47
- autoload :MessageCountDetails, 'generated/azure_mgmt_service_bus/models/message_count_details.rb'
48
- autoload :CheckNameAvailabilityResult, 'generated/azure_mgmt_service_bus/models/check_name_availability_result.rb'
49
- autoload :SBSku, 'generated/azure_mgmt_service_bus/models/sbsku.rb'
50
- autoload :OperationDisplay, 'generated/azure_mgmt_service_bus/models/operation_display.rb'
45
+ autoload :AuthorizationRuleProperties, 'generated/azure_mgmt_service_bus/models/authorization_rule_properties.rb'
46
+ autoload :CheckNameAvailability, 'generated/azure_mgmt_service_bus/models/check_name_availability.rb'
47
+ autoload :RegenerateAccessKeyParameters, 'generated/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb'
48
+ autoload :RuleListResult, 'generated/azure_mgmt_service_bus/models/rule_list_result.rb'
51
49
  autoload :Destination, 'generated/azure_mgmt_service_bus/models/destination.rb'
50
+ autoload :OperationDisplay, 'generated/azure_mgmt_service_bus/models/operation_display.rb'
51
+ autoload :ArmDisasterRecoveryListResult, 'generated/azure_mgmt_service_bus/models/arm_disaster_recovery_list_result.rb'
52
52
  autoload :Operation, 'generated/azure_mgmt_service_bus/models/operation.rb'
53
- autoload :RegenerateAccessKeyParameters, 'generated/azure_mgmt_service_bus/models/regenerate_access_key_parameters.rb'
53
+ autoload :SBAuthorizationRuleListResult, 'generated/azure_mgmt_service_bus/models/sbauthorization_rule_list_result.rb'
54
54
  autoload :OperationListResult, 'generated/azure_mgmt_service_bus/models/operation_list_result.rb'
55
- autoload :SBNamespaceListResult, 'generated/azure_mgmt_service_bus/models/sbnamespace_list_result.rb'
55
+ autoload :MessageCountDetails, 'generated/azure_mgmt_service_bus/models/message_count_details.rb'
56
56
  autoload :ErrorResponse, 'generated/azure_mgmt_service_bus/models/error_response.rb'
57
+ autoload :EventHubListResult, 'generated/azure_mgmt_service_bus/models/event_hub_list_result.rb'
57
58
  autoload :Action, 'generated/azure_mgmt_service_bus/models/action.rb'
58
- autoload :AuthorizationRuleProperties, 'generated/azure_mgmt_service_bus/models/authorization_rule_properties.rb'
59
59
  autoload :SqlFilter, 'generated/azure_mgmt_service_bus/models/sql_filter.rb'
60
+ autoload :AccessKeys, 'generated/azure_mgmt_service_bus/models/access_keys.rb'
61
+ autoload :CorrelationFilter, 'generated/azure_mgmt_service_bus/models/correlation_filter.rb'
60
62
  autoload :TrackedResource, 'generated/azure_mgmt_service_bus/models/tracked_resource.rb'
61
63
  autoload :ResourceNamespacePatch, 'generated/azure_mgmt_service_bus/models/resource_namespace_patch.rb'
62
64
  autoload :SBNamespace, 'generated/azure_mgmt_service_bus/models/sbnamespace.rb'
@@ -69,6 +71,7 @@ module Azure::ARM::ServiceBus
69
71
  autoload :SqlRuleAction, 'generated/azure_mgmt_service_bus/models/sql_rule_action.rb'
70
72
  autoload :PremiumMessagingRegions, 'generated/azure_mgmt_service_bus/models/premium_messaging_regions.rb'
71
73
  autoload :Eventhub, 'generated/azure_mgmt_service_bus/models/eventhub.rb'
74
+ autoload :ArmDisasterRecovery, 'generated/azure_mgmt_service_bus/models/arm_disaster_recovery.rb'
72
75
  autoload :SkuName, 'generated/azure_mgmt_service_bus/models/sku_name.rb'
73
76
  autoload :SkuTier, 'generated/azure_mgmt_service_bus/models/sku_tier.rb'
74
77
  autoload :AccessRights, 'generated/azure_mgmt_service_bus/models/access_rights.rb'
@@ -77,5 +80,7 @@ module Azure::ARM::ServiceBus
77
80
  autoload :UnavailableReason, 'generated/azure_mgmt_service_bus/models/unavailable_reason.rb'
78
81
  autoload :FilterType, 'generated/azure_mgmt_service_bus/models/filter_type.rb'
79
82
  autoload :EncodingCaptureDescription, 'generated/azure_mgmt_service_bus/models/encoding_capture_description.rb'
83
+ autoload :ProvisioningStateDR, 'generated/azure_mgmt_service_bus/models/provisioning_state_dr.rb'
84
+ autoload :RoleDisasterRecovery, 'generated/azure_mgmt_service_bus/models/role_disaster_recovery.rb'
80
85
  end
81
86
  end
@@ -0,0 +1,711 @@
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::ARM::ServiceBus
7
+ #
8
+ # Azure Service Bus client
9
+ #
10
+ class DisasterRecoveryConfigs
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the DisasterRecoveryConfigs class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ServiceBusManagementClient] reference to the ServiceBusManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets all Alias(Disaster Recovery configurations)
26
+ #
27
+ # @param resource_group_name [String] Name of the Resource group within the
28
+ # Azure subscription.
29
+ # @param namespace_name [String] The namespace name
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<ArmDisasterRecovery>] operation results.
34
+ #
35
+ def list(resource_group_name, namespace_name, custom_headers = nil)
36
+ first_page = list_as_lazy(resource_group_name, namespace_name, custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Gets all Alias(Disaster Recovery configurations)
42
+ #
43
+ # @param resource_group_name [String] Name of the Resource group within the
44
+ # Azure subscription.
45
+ # @param namespace_name [String] The namespace name
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(resource_group_name, namespace_name, custom_headers = nil)
52
+ list_async(resource_group_name, namespace_name, custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets all Alias(Disaster Recovery configurations)
57
+ #
58
+ # @param resource_group_name [String] Name of the Resource group within the
59
+ # Azure subscription.
60
+ # @param namespace_name [String] The namespace name
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(resource_group_name, namespace_name, custom_headers = nil)
67
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
68
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
69
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+
72
+
73
+ request_headers = {}
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs'
79
+
80
+ request_url = @base_url || @client.base_url
81
+
82
+ options = {
83
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
84
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
85
+ query_params: {'api-version' => @client.api_version},
86
+ headers: request_headers.merge(custom_headers || {}),
87
+ base_url: request_url
88
+ }
89
+ promise = @client.make_request_async(:get, path_template, options)
90
+
91
+ promise = promise.then do |result|
92
+ http_response = result.response
93
+ status_code = http_response.status
94
+ response_content = http_response.body
95
+ unless status_code == 200
96
+ error_model = JSON.load(response_content)
97
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
98
+ end
99
+
100
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
+ # Deserialize Response
102
+ if status_code == 200
103
+ begin
104
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
105
+ result_mapper = Azure::ARM::ServiceBus::Models::ArmDisasterRecoveryListResult.mapper()
106
+ result.body = @client.deserialize(result_mapper, parsed_response)
107
+ rescue Exception => e
108
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
109
+ end
110
+ end
111
+
112
+ result
113
+ end
114
+
115
+ promise.execute
116
+ end
117
+
118
+ #
119
+ # Creates or updates a new Alias(Disaster Recovery configuration)
120
+ #
121
+ # @param resource_group_name [String] Name of the Resource group within the
122
+ # Azure subscription.
123
+ # @param namespace_name [String] The namespace name
124
+ # @param alias_parameter [String] The Disaster Recovery configuration name
125
+ # @param parameters [ArmDisasterRecovery] Parameters required to create an
126
+ # Alias(Disaster Recovery configuration)
127
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
128
+ # will be added to the HTTP request.
129
+ #
130
+ # @return [ArmDisasterRecovery] operation results.
131
+ #
132
+ def create_or_update(resource_group_name, namespace_name, alias_parameter, parameters, custom_headers = nil)
133
+ response = create_or_update_async(resource_group_name, namespace_name, alias_parameter, parameters, custom_headers).value!
134
+ response.body unless response.nil?
135
+ end
136
+
137
+ #
138
+ # Creates or updates a new Alias(Disaster Recovery configuration)
139
+ #
140
+ # @param resource_group_name [String] Name of the Resource group within the
141
+ # Azure subscription.
142
+ # @param namespace_name [String] The namespace name
143
+ # @param alias_parameter [String] The Disaster Recovery configuration name
144
+ # @param parameters [ArmDisasterRecovery] Parameters required to create an
145
+ # Alias(Disaster Recovery configuration)
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
150
+ #
151
+ def create_or_update_with_http_info(resource_group_name, namespace_name, alias_parameter, parameters, custom_headers = nil)
152
+ create_or_update_async(resource_group_name, namespace_name, alias_parameter, parameters, custom_headers).value!
153
+ end
154
+
155
+ #
156
+ # Creates or updates a new Alias(Disaster Recovery configuration)
157
+ #
158
+ # @param resource_group_name [String] Name of the Resource group within the
159
+ # Azure subscription.
160
+ # @param namespace_name [String] The namespace name
161
+ # @param alias_parameter [String] The Disaster Recovery configuration name
162
+ # @param parameters [ArmDisasterRecovery] Parameters required to create an
163
+ # Alias(Disaster Recovery configuration)
164
+ # @param [Hash{String => String}] A hash of custom headers that will be added
165
+ # to the HTTP request.
166
+ #
167
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
168
+ #
169
+ def create_or_update_async(resource_group_name, namespace_name, alias_parameter, parameters, custom_headers = nil)
170
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
171
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
172
+ fail ArgumentError, 'alias_parameter is nil' if alias_parameter.nil?
173
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
174
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
175
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
176
+
177
+
178
+ request_headers = {}
179
+
180
+ # Set Headers
181
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
182
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
183
+
184
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
185
+
186
+ # Serialize Request
187
+ request_mapper = Azure::ARM::ServiceBus::Models::ArmDisasterRecovery.mapper()
188
+ request_content = @client.serialize(request_mapper, parameters)
189
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
190
+
191
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'
192
+
193
+ request_url = @base_url || @client.base_url
194
+
195
+ options = {
196
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
197
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'alias' => alias_parameter,'subscriptionId' => @client.subscription_id},
198
+ query_params: {'api-version' => @client.api_version},
199
+ body: request_content,
200
+ headers: request_headers.merge(custom_headers || {}),
201
+ base_url: request_url
202
+ }
203
+ promise = @client.make_request_async(:put, path_template, options)
204
+
205
+ promise = promise.then do |result|
206
+ http_response = result.response
207
+ status_code = http_response.status
208
+ response_content = http_response.body
209
+ unless status_code == 200 || status_code == 201
210
+ error_model = JSON.load(response_content)
211
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
212
+ end
213
+
214
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
215
+ # Deserialize Response
216
+ if status_code == 200
217
+ begin
218
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
219
+ result_mapper = Azure::ARM::ServiceBus::Models::ArmDisasterRecovery.mapper()
220
+ result.body = @client.deserialize(result_mapper, parsed_response)
221
+ rescue Exception => e
222
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
223
+ end
224
+ end
225
+
226
+ result
227
+ end
228
+
229
+ promise.execute
230
+ end
231
+
232
+ #
233
+ # Deletes an Alias(Disaster Recovery configuration)
234
+ #
235
+ # @param resource_group_name [String] Name of the Resource group within the
236
+ # Azure subscription.
237
+ # @param namespace_name [String] The namespace name
238
+ # @param alias_parameter [String] The Disaster Recovery configuration name
239
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
240
+ # will be added to the HTTP request.
241
+ #
242
+ #
243
+ def delete(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
244
+ response = delete_async(resource_group_name, namespace_name, alias_parameter, custom_headers).value!
245
+ nil
246
+ end
247
+
248
+ #
249
+ # Deletes an Alias(Disaster Recovery configuration)
250
+ #
251
+ # @param resource_group_name [String] Name of the Resource group within the
252
+ # Azure subscription.
253
+ # @param namespace_name [String] The namespace name
254
+ # @param alias_parameter [String] The Disaster Recovery configuration name
255
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
256
+ # will be added to the HTTP request.
257
+ #
258
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
259
+ #
260
+ def delete_with_http_info(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
261
+ delete_async(resource_group_name, namespace_name, alias_parameter, custom_headers).value!
262
+ end
263
+
264
+ #
265
+ # Deletes an Alias(Disaster Recovery configuration)
266
+ #
267
+ # @param resource_group_name [String] Name of the Resource group within the
268
+ # Azure subscription.
269
+ # @param namespace_name [String] The namespace name
270
+ # @param alias_parameter [String] The Disaster Recovery configuration name
271
+ # @param [Hash{String => String}] A hash of custom headers that will be added
272
+ # to the HTTP request.
273
+ #
274
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
275
+ #
276
+ def delete_async(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
277
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
278
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
279
+ fail ArgumentError, 'alias_parameter is nil' if alias_parameter.nil?
280
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
281
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
282
+
283
+
284
+ request_headers = {}
285
+
286
+ # Set Headers
287
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
288
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
289
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'
290
+
291
+ request_url = @base_url || @client.base_url
292
+
293
+ options = {
294
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
295
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'alias' => alias_parameter,'subscriptionId' => @client.subscription_id},
296
+ query_params: {'api-version' => @client.api_version},
297
+ headers: request_headers.merge(custom_headers || {}),
298
+ base_url: request_url
299
+ }
300
+ promise = @client.make_request_async(:delete, path_template, options)
301
+
302
+ promise = promise.then do |result|
303
+ http_response = result.response
304
+ status_code = http_response.status
305
+ response_content = http_response.body
306
+ unless status_code == 200
307
+ error_model = JSON.load(response_content)
308
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
309
+ end
310
+
311
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
312
+
313
+ result
314
+ end
315
+
316
+ promise.execute
317
+ end
318
+
319
+ #
320
+ # Retrieves Alias(Disaster Recovery configuration) for primary or secondary
321
+ # namespace
322
+ #
323
+ # @param resource_group_name [String] Name of the Resource group within the
324
+ # Azure subscription.
325
+ # @param namespace_name [String] The namespace name
326
+ # @param alias_parameter [String] The Disaster Recovery configuration name
327
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
328
+ # will be added to the HTTP request.
329
+ #
330
+ # @return [ArmDisasterRecovery] operation results.
331
+ #
332
+ def get(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
333
+ response = get_async(resource_group_name, namespace_name, alias_parameter, custom_headers).value!
334
+ response.body unless response.nil?
335
+ end
336
+
337
+ #
338
+ # Retrieves Alias(Disaster Recovery configuration) for primary or secondary
339
+ # namespace
340
+ #
341
+ # @param resource_group_name [String] Name of the Resource group within the
342
+ # Azure subscription.
343
+ # @param namespace_name [String] The namespace name
344
+ # @param alias_parameter [String] The Disaster Recovery configuration name
345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
346
+ # will be added to the HTTP request.
347
+ #
348
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
349
+ #
350
+ def get_with_http_info(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
351
+ get_async(resource_group_name, namespace_name, alias_parameter, custom_headers).value!
352
+ end
353
+
354
+ #
355
+ # Retrieves Alias(Disaster Recovery configuration) for primary or secondary
356
+ # namespace
357
+ #
358
+ # @param resource_group_name [String] Name of the Resource group within the
359
+ # Azure subscription.
360
+ # @param namespace_name [String] The namespace name
361
+ # @param alias_parameter [String] The Disaster Recovery configuration name
362
+ # @param [Hash{String => String}] A hash of custom headers that will be added
363
+ # to the HTTP request.
364
+ #
365
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
366
+ #
367
+ def get_async(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
368
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
369
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
370
+ fail ArgumentError, 'alias_parameter is nil' if alias_parameter.nil?
371
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
372
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
373
+
374
+
375
+ request_headers = {}
376
+
377
+ # Set Headers
378
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
379
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
380
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}'
381
+
382
+ request_url = @base_url || @client.base_url
383
+
384
+ options = {
385
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
386
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'alias' => alias_parameter,'subscriptionId' => @client.subscription_id},
387
+ query_params: {'api-version' => @client.api_version},
388
+ headers: request_headers.merge(custom_headers || {}),
389
+ base_url: request_url
390
+ }
391
+ promise = @client.make_request_async(:get, path_template, options)
392
+
393
+ promise = promise.then do |result|
394
+ http_response = result.response
395
+ status_code = http_response.status
396
+ response_content = http_response.body
397
+ unless status_code == 200
398
+ error_model = JSON.load(response_content)
399
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
400
+ end
401
+
402
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
403
+ # Deserialize Response
404
+ if status_code == 200
405
+ begin
406
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
407
+ result_mapper = Azure::ARM::ServiceBus::Models::ArmDisasterRecovery.mapper()
408
+ result.body = @client.deserialize(result_mapper, parsed_response)
409
+ rescue Exception => e
410
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
411
+ end
412
+ end
413
+
414
+ result
415
+ end
416
+
417
+ promise.execute
418
+ end
419
+
420
+ #
421
+ # This operation disables the Disaster Recovery and stops replicating changes
422
+ # from primary to secondary namespaces
423
+ #
424
+ # @param resource_group_name [String] Name of the Resource group within the
425
+ # Azure subscription.
426
+ # @param namespace_name [String] The namespace name
427
+ # @param alias_parameter [String] The Disaster Recovery configuration name
428
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
429
+ # will be added to the HTTP request.
430
+ #
431
+ #
432
+ def break_pairing(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
433
+ response = break_pairing_async(resource_group_name, namespace_name, alias_parameter, custom_headers).value!
434
+ nil
435
+ end
436
+
437
+ #
438
+ # This operation disables the Disaster Recovery and stops replicating changes
439
+ # from primary to secondary namespaces
440
+ #
441
+ # @param resource_group_name [String] Name of the Resource group within the
442
+ # Azure subscription.
443
+ # @param namespace_name [String] The namespace name
444
+ # @param alias_parameter [String] The Disaster Recovery configuration name
445
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
446
+ # will be added to the HTTP request.
447
+ #
448
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
449
+ #
450
+ def break_pairing_with_http_info(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
451
+ break_pairing_async(resource_group_name, namespace_name, alias_parameter, custom_headers).value!
452
+ end
453
+
454
+ #
455
+ # This operation disables the Disaster Recovery and stops replicating changes
456
+ # from primary to secondary namespaces
457
+ #
458
+ # @param resource_group_name [String] Name of the Resource group within the
459
+ # Azure subscription.
460
+ # @param namespace_name [String] The namespace name
461
+ # @param alias_parameter [String] The Disaster Recovery configuration name
462
+ # @param [Hash{String => String}] A hash of custom headers that will be added
463
+ # to the HTTP request.
464
+ #
465
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
466
+ #
467
+ def break_pairing_async(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
468
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
469
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
470
+ fail ArgumentError, 'alias_parameter is nil' if alias_parameter.nil?
471
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
472
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
473
+
474
+
475
+ request_headers = {}
476
+
477
+ # Set Headers
478
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
479
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
480
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/breakPairing'
481
+
482
+ request_url = @base_url || @client.base_url
483
+
484
+ options = {
485
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
486
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'alias' => alias_parameter,'subscriptionId' => @client.subscription_id},
487
+ query_params: {'api-version' => @client.api_version},
488
+ headers: request_headers.merge(custom_headers || {}),
489
+ base_url: request_url
490
+ }
491
+ promise = @client.make_request_async(:post, path_template, options)
492
+
493
+ promise = promise.then do |result|
494
+ http_response = result.response
495
+ status_code = http_response.status
496
+ response_content = http_response.body
497
+ unless status_code == 200
498
+ error_model = JSON.load(response_content)
499
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
500
+ end
501
+
502
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
503
+
504
+ result
505
+ end
506
+
507
+ promise.execute
508
+ end
509
+
510
+ #
511
+ # envokes GEO DR failover and reconfigure the alias to point to the secondary
512
+ # namespace
513
+ #
514
+ # @param resource_group_name [String] Name of the Resource group within the
515
+ # Azure subscription.
516
+ # @param namespace_name [String] The namespace name
517
+ # @param alias_parameter [String] The Disaster Recovery configuration name
518
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
519
+ # will be added to the HTTP request.
520
+ #
521
+ #
522
+ def fail_over(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
523
+ response = fail_over_async(resource_group_name, namespace_name, alias_parameter, custom_headers).value!
524
+ nil
525
+ end
526
+
527
+ #
528
+ # envokes GEO DR failover and reconfigure the alias to point to the secondary
529
+ # namespace
530
+ #
531
+ # @param resource_group_name [String] Name of the Resource group within the
532
+ # Azure subscription.
533
+ # @param namespace_name [String] The namespace name
534
+ # @param alias_parameter [String] The Disaster Recovery configuration name
535
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
536
+ # will be added to the HTTP request.
537
+ #
538
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
539
+ #
540
+ def fail_over_with_http_info(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
541
+ fail_over_async(resource_group_name, namespace_name, alias_parameter, custom_headers).value!
542
+ end
543
+
544
+ #
545
+ # envokes GEO DR failover and reconfigure the alias to point to the secondary
546
+ # namespace
547
+ #
548
+ # @param resource_group_name [String] Name of the Resource group within the
549
+ # Azure subscription.
550
+ # @param namespace_name [String] The namespace name
551
+ # @param alias_parameter [String] The Disaster Recovery configuration name
552
+ # @param [Hash{String => String}] A hash of custom headers that will be added
553
+ # to the HTTP request.
554
+ #
555
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
556
+ #
557
+ def fail_over_async(resource_group_name, namespace_name, alias_parameter, custom_headers = nil)
558
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
559
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
560
+ fail ArgumentError, 'alias_parameter is nil' if alias_parameter.nil?
561
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
562
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
563
+
564
+
565
+ request_headers = {}
566
+
567
+ # Set Headers
568
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
569
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
570
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/disasterRecoveryConfigs/{alias}/failover'
571
+
572
+ request_url = @base_url || @client.base_url
573
+
574
+ options = {
575
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
576
+ path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'alias' => alias_parameter,'subscriptionId' => @client.subscription_id},
577
+ query_params: {'api-version' => @client.api_version},
578
+ headers: request_headers.merge(custom_headers || {}),
579
+ base_url: request_url
580
+ }
581
+ promise = @client.make_request_async(:post, path_template, options)
582
+
583
+ promise = promise.then do |result|
584
+ http_response = result.response
585
+ status_code = http_response.status
586
+ response_content = http_response.body
587
+ unless status_code == 200
588
+ error_model = JSON.load(response_content)
589
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
590
+ end
591
+
592
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
593
+
594
+ result
595
+ end
596
+
597
+ promise.execute
598
+ end
599
+
600
+ #
601
+ # Gets all Alias(Disaster Recovery configurations)
602
+ #
603
+ # @param next_page_link [String] The NextLink from the previous successful call
604
+ # to List operation.
605
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
606
+ # will be added to the HTTP request.
607
+ #
608
+ # @return [ArmDisasterRecoveryListResult] operation results.
609
+ #
610
+ def list_next(next_page_link, custom_headers = nil)
611
+ response = list_next_async(next_page_link, custom_headers).value!
612
+ response.body unless response.nil?
613
+ end
614
+
615
+ #
616
+ # Gets all Alias(Disaster Recovery configurations)
617
+ #
618
+ # @param next_page_link [String] The NextLink from the previous successful call
619
+ # to List operation.
620
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
621
+ # will be added to the HTTP request.
622
+ #
623
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
624
+ #
625
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
626
+ list_next_async(next_page_link, custom_headers).value!
627
+ end
628
+
629
+ #
630
+ # Gets all Alias(Disaster Recovery configurations)
631
+ #
632
+ # @param next_page_link [String] The NextLink from the previous successful call
633
+ # to List operation.
634
+ # @param [Hash{String => String}] A hash of custom headers that will be added
635
+ # to the HTTP request.
636
+ #
637
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
638
+ #
639
+ def list_next_async(next_page_link, custom_headers = nil)
640
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
641
+
642
+
643
+ request_headers = {}
644
+
645
+ # Set Headers
646
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
647
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
648
+ path_template = '{nextLink}'
649
+
650
+ request_url = @base_url || @client.base_url
651
+
652
+ options = {
653
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
654
+ skip_encoding_path_params: {'nextLink' => next_page_link},
655
+ headers: request_headers.merge(custom_headers || {}),
656
+ base_url: request_url
657
+ }
658
+ promise = @client.make_request_async(:get, path_template, options)
659
+
660
+ promise = promise.then do |result|
661
+ http_response = result.response
662
+ status_code = http_response.status
663
+ response_content = http_response.body
664
+ unless status_code == 200
665
+ error_model = JSON.load(response_content)
666
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
667
+ end
668
+
669
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
670
+ # Deserialize Response
671
+ if status_code == 200
672
+ begin
673
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
674
+ result_mapper = Azure::ARM::ServiceBus::Models::ArmDisasterRecoveryListResult.mapper()
675
+ result.body = @client.deserialize(result_mapper, parsed_response)
676
+ rescue Exception => e
677
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
678
+ end
679
+ end
680
+
681
+ result
682
+ end
683
+
684
+ promise.execute
685
+ end
686
+
687
+ #
688
+ # Gets all Alias(Disaster Recovery configurations)
689
+ #
690
+ # @param resource_group_name [String] Name of the Resource group within the
691
+ # Azure subscription.
692
+ # @param namespace_name [String] The namespace name
693
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
694
+ # will be added to the HTTP request.
695
+ #
696
+ # @return [ArmDisasterRecoveryListResult] which provide lazy access to pages of
697
+ # the response.
698
+ #
699
+ def list_as_lazy(resource_group_name, namespace_name, custom_headers = nil)
700
+ response = list_async(resource_group_name, namespace_name, custom_headers).value!
701
+ unless response.nil?
702
+ page = response.body
703
+ page.next_method = Proc.new do |next_page_link|
704
+ list_next_async(next_page_link, custom_headers)
705
+ end
706
+ page
707
+ end
708
+ end
709
+
710
+ end
711
+ end