azure_mgmt_event_hub 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/2014-09-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +1 -1
- data/lib/2015-08-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +1 -1
- data/lib/2017-04-01/generated/azure_mgmt_event_hub.rb +15 -28
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/consumer_groups.rb +5 -5
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/disaster_recovery_configs.rb +239 -239
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/event_hub_management_client.rb +5 -5
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/event_hubs.rb +278 -272
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/error_response.rb +1 -1
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/messaging_regions.rb +1 -1
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/messaging_regions_properties.rb +1 -2
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/resource.rb +4 -4
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/tracked_resource.rb +3 -3
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/namespaces.rb +198 -1678
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub.rb +24 -18
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/clusters.rb +74 -56
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/configuration.rb +7 -7
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/{event_hub2018preview_management_client.rb → event_hub_management_client.rb} +18 -14
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/cluster.rb +6 -6
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/{operation.rb → connection_state.rb} +16 -16
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/ehnamespace.rb +12 -12
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/encryption.rb +11 -3
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/end_point_provisioning_state.rb +20 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/error_response.rb +1 -1
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/key_vault_properties.rb +11 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/network_rule_set.rb +12 -0
- data/lib/{2017-04-01/generated/azure_mgmt_event_hub/models/subnet.rb → 2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_endpoint.rb} +8 -8
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_endpoint_connection.rb +100 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/{operation_list_result.rb → private_endpoint_connection_list_result.rb} +13 -16
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_link_connection_status.rb +18 -0
- data/lib/{2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_set.rb → 2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_link_resource.rb} +55 -50
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/private_link_resources_list_result.rb +67 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/resource.rb +4 -4
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/tracked_resource.rb +3 -3
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb +395 -395
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/private_endpoint_connections.rb +625 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/private_link_resources.rb +127 -0
- data/lib/azure_mgmt_event_hub.rb +2 -2
- data/lib/profiles/latest/modules/eventhub_profile_module.rb +211 -63
- data/lib/version.rb +1 -1
- metadata +14 -21
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/default_action.rb +0 -16
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/ehnamespace.rb +0 -200
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/ehnamespace_list_result.rb +0 -99
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/messaging_plan.rb +0 -134
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_ipaction.rb +0 -15
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/network_rule_set_list_result.rb +0 -100
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/nwrule_set_ip_rules.rb +0 -59
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/nwrule_set_virtual_network_rules.rb +0 -59
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/sku.rb +0 -75
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/sku_name.rb +0 -16
- data/lib/2017-04-01/generated/azure_mgmt_event_hub/models/sku_tier.rb +0 -16
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/models/operation_display.rb +0 -72
- data/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/operations.rb +0 -220
@@ -6,7 +6,7 @@
|
|
6
6
|
module Azure::EventHub::Mgmt::V2017_04_01
|
7
7
|
module Models
|
8
8
|
#
|
9
|
-
# Error response indicates
|
9
|
+
# Error response indicates Event Hub service is not able to process the
|
10
10
|
# incoming request. The reason is provided in the error message.
|
11
11
|
#
|
12
12
|
class ErrorResponse
|
@@ -6,19 +6,19 @@
|
|
6
6
|
module Azure::EventHub::Mgmt::V2017_04_01
|
7
7
|
module Models
|
8
8
|
#
|
9
|
-
# The
|
9
|
+
# The resource definition.
|
10
10
|
#
|
11
11
|
class Resource
|
12
12
|
|
13
13
|
include MsRestAzure
|
14
14
|
|
15
|
-
# @return [String] Resource
|
15
|
+
# @return [String] Resource ID.
|
16
16
|
attr_accessor :id
|
17
17
|
|
18
|
-
# @return [String] Resource name
|
18
|
+
# @return [String] Resource name.
|
19
19
|
attr_accessor :name
|
20
20
|
|
21
|
-
# @return [String] Resource type
|
21
|
+
# @return [String] Resource type.
|
22
22
|
attr_accessor :type
|
23
23
|
|
24
24
|
|
@@ -6,16 +6,16 @@
|
|
6
6
|
module Azure::EventHub::Mgmt::V2017_04_01
|
7
7
|
module Models
|
8
8
|
#
|
9
|
-
# Definition of
|
9
|
+
# Definition of resource.
|
10
10
|
#
|
11
11
|
class TrackedResource < Resource
|
12
12
|
|
13
13
|
include MsRestAzure
|
14
14
|
|
15
|
-
# @return [String] Resource location
|
15
|
+
# @return [String] Resource location.
|
16
16
|
attr_accessor :location
|
17
17
|
|
18
|
-
# @return [Hash{String => String}] Resource tags
|
18
|
+
# @return [Hash{String => String}] Resource tags.
|
19
19
|
attr_accessor :tags
|
20
20
|
|
21
21
|
|
@@ -22,48 +22,56 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
22
22
|
attr_reader :client
|
23
23
|
|
24
24
|
#
|
25
|
-
#
|
25
|
+
# Gets a list of authorization rules for a Namespace.
|
26
26
|
#
|
27
|
-
# @param
|
28
|
-
#
|
27
|
+
# @param resource_group_name [String] Name of the resource group within the
|
28
|
+
# azure subscription.
|
29
|
+
# @param namespace_name [String] The Namespace name
|
29
30
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
30
31
|
# will be added to the HTTP request.
|
31
32
|
#
|
32
|
-
# @return [
|
33
|
+
# @return [Array<AuthorizationRule>] operation results.
|
33
34
|
#
|
34
|
-
def
|
35
|
-
|
36
|
-
|
35
|
+
def list_authorization_rules(resource_group_name, namespace_name, custom_headers:nil)
|
36
|
+
first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
|
37
|
+
first_page.get_all_items
|
37
38
|
end
|
38
39
|
|
39
40
|
#
|
40
|
-
#
|
41
|
+
# Gets a list of authorization rules for a Namespace.
|
41
42
|
#
|
42
|
-
# @param
|
43
|
-
#
|
43
|
+
# @param resource_group_name [String] Name of the resource group within the
|
44
|
+
# azure subscription.
|
45
|
+
# @param namespace_name [String] The Namespace name
|
44
46
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
45
47
|
# will be added to the HTTP request.
|
46
48
|
#
|
47
49
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
48
50
|
#
|
49
|
-
def
|
50
|
-
|
51
|
+
def list_authorization_rules_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
|
52
|
+
list_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
51
53
|
end
|
52
54
|
|
53
55
|
#
|
54
|
-
#
|
56
|
+
# Gets a list of authorization rules for a Namespace.
|
55
57
|
#
|
56
|
-
# @param
|
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
|
58
61
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
59
62
|
# to the HTTP request.
|
60
63
|
#
|
61
64
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
62
65
|
#
|
63
|
-
def
|
66
|
+
def list_authorization_rules_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, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
69
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
70
|
+
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
71
|
+
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
72
|
+
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
64
73
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
65
74
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
66
|
-
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
67
75
|
|
68
76
|
|
69
77
|
request_headers = {}
|
@@ -72,25 +80,18 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
72
80
|
# Set Headers
|
73
81
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
74
82
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
75
|
-
|
76
|
-
# Serialize Request
|
77
|
-
request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::CheckNameAvailabilityParameter.mapper()
|
78
|
-
request_content = @client.serialize(request_mapper, parameters)
|
79
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
80
|
-
|
81
|
-
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventHub/CheckNameAvailability'
|
83
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules'
|
82
84
|
|
83
85
|
request_url = @base_url || @client.base_url
|
84
86
|
|
85
87
|
options = {
|
86
88
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
87
|
-
path_params: {'subscriptionId' => @client.subscription_id},
|
89
|
+
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
88
90
|
query_params: {'api-version' => @client.api_version},
|
89
|
-
body: request_content,
|
90
91
|
headers: request_headers.merge(custom_headers || {}),
|
91
92
|
base_url: request_url
|
92
93
|
}
|
93
|
-
promise = @client.make_request_async(:
|
94
|
+
promise = @client.make_request_async(:get, path_template, options)
|
94
95
|
|
95
96
|
promise = promise.then do |result|
|
96
97
|
http_response = result.response
|
@@ -108,7 +109,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
108
109
|
if status_code == 200
|
109
110
|
begin
|
110
111
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
111
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::
|
112
|
+
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRuleListResult.mapper()
|
112
113
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
113
114
|
rescue Exception => e
|
114
115
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -122,42 +123,63 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
122
123
|
end
|
123
124
|
|
124
125
|
#
|
125
|
-
#
|
126
|
-
# resource groups.
|
126
|
+
# Creates or updates an AuthorizationRule for a Namespace.
|
127
127
|
#
|
128
|
+
# @param resource_group_name [String] Name of the resource group within the
|
129
|
+
# azure subscription.
|
130
|
+
# @param namespace_name [String] The Namespace name
|
131
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
132
|
+
# @param parameters [AuthorizationRule] The shared access AuthorizationRule.
|
128
133
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
129
134
|
# will be added to the HTTP request.
|
130
135
|
#
|
131
|
-
# @return [
|
136
|
+
# @return [AuthorizationRule] operation results.
|
132
137
|
#
|
133
|
-
def
|
134
|
-
|
135
|
-
|
138
|
+
def create_or_update_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
139
|
+
response = create_or_update_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
|
140
|
+
response.body unless response.nil?
|
136
141
|
end
|
137
142
|
|
138
143
|
#
|
139
|
-
#
|
140
|
-
# resource groups.
|
144
|
+
# Creates or updates an AuthorizationRule for a Namespace.
|
141
145
|
#
|
146
|
+
# @param resource_group_name [String] Name of the resource group within the
|
147
|
+
# azure subscription.
|
148
|
+
# @param namespace_name [String] The Namespace name
|
149
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
150
|
+
# @param parameters [AuthorizationRule] The shared access AuthorizationRule.
|
142
151
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
143
152
|
# will be added to the HTTP request.
|
144
153
|
#
|
145
154
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
146
155
|
#
|
147
|
-
def
|
148
|
-
|
156
|
+
def create_or_update_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
157
|
+
create_or_update_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
|
149
158
|
end
|
150
159
|
|
151
160
|
#
|
152
|
-
#
|
153
|
-
# resource groups.
|
161
|
+
# Creates or updates an AuthorizationRule for a Namespace.
|
154
162
|
#
|
163
|
+
# @param resource_group_name [String] Name of the resource group within the
|
164
|
+
# azure subscription.
|
165
|
+
# @param namespace_name [String] The Namespace name
|
166
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
167
|
+
# @param parameters [AuthorizationRule] The shared access AuthorizationRule.
|
155
168
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
156
169
|
# to the HTTP request.
|
157
170
|
#
|
158
171
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
159
172
|
#
|
160
|
-
def
|
173
|
+
def create_or_update_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
174
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
175
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
176
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
177
|
+
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
178
|
+
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
179
|
+
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
180
|
+
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
181
|
+
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
182
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
161
183
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
162
184
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
163
185
|
|
@@ -168,18 +190,25 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
168
190
|
# Set Headers
|
169
191
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
170
192
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
171
|
-
|
193
|
+
|
194
|
+
# Serialize Request
|
195
|
+
request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
|
196
|
+
request_content = @client.serialize(request_mapper, parameters)
|
197
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
198
|
+
|
199
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'
|
172
200
|
|
173
201
|
request_url = @base_url || @client.base_url
|
174
202
|
|
175
203
|
options = {
|
176
204
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
177
|
-
path_params: {'subscriptionId' => @client.subscription_id},
|
205
|
+
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
178
206
|
query_params: {'api-version' => @client.api_version},
|
207
|
+
body: request_content,
|
179
208
|
headers: request_headers.merge(custom_headers || {}),
|
180
209
|
base_url: request_url
|
181
210
|
}
|
182
|
-
promise = @client.make_request_async(:
|
211
|
+
promise = @client.make_request_async(:put, path_template, options)
|
183
212
|
|
184
213
|
promise = promise.then do |result|
|
185
214
|
http_response = result.response
|
@@ -197,7 +226,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
197
226
|
if status_code == 200
|
198
227
|
begin
|
199
228
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
200
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::
|
229
|
+
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
|
201
230
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
202
231
|
rescue Exception => e
|
203
232
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -211,48 +240,58 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
211
240
|
end
|
212
241
|
|
213
242
|
#
|
214
|
-
#
|
243
|
+
# Deletes an AuthorizationRule for a Namespace.
|
215
244
|
#
|
216
245
|
# @param resource_group_name [String] Name of the resource group within the
|
217
246
|
# azure subscription.
|
247
|
+
# @param namespace_name [String] The Namespace name
|
248
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
218
249
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
219
250
|
# will be added to the HTTP request.
|
220
251
|
#
|
221
|
-
# @return [Array<EHNamespace>] operation results.
|
222
252
|
#
|
223
|
-
def
|
224
|
-
|
225
|
-
|
253
|
+
def delete_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
254
|
+
response = delete_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
255
|
+
nil
|
226
256
|
end
|
227
257
|
|
228
258
|
#
|
229
|
-
#
|
259
|
+
# Deletes an AuthorizationRule for a Namespace.
|
230
260
|
#
|
231
261
|
# @param resource_group_name [String] Name of the resource group within the
|
232
262
|
# azure subscription.
|
263
|
+
# @param namespace_name [String] The Namespace name
|
264
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
233
265
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
234
266
|
# will be added to the HTTP request.
|
235
267
|
#
|
236
268
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
237
269
|
#
|
238
|
-
def
|
239
|
-
|
270
|
+
def delete_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
271
|
+
delete_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
240
272
|
end
|
241
273
|
|
242
274
|
#
|
243
|
-
#
|
275
|
+
# Deletes an AuthorizationRule for a Namespace.
|
244
276
|
#
|
245
277
|
# @param resource_group_name [String] Name of the resource group within the
|
246
278
|
# azure subscription.
|
279
|
+
# @param namespace_name [String] The Namespace name
|
280
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
247
281
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
248
282
|
# to the HTTP request.
|
249
283
|
#
|
250
284
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
251
285
|
#
|
252
|
-
def
|
286
|
+
def delete_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
253
287
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
254
288
|
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
255
289
|
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
290
|
+
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
291
|
+
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
292
|
+
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
293
|
+
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
294
|
+
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
256
295
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
257
296
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
258
297
|
|
@@ -263,24 +302,24 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
263
302
|
# Set Headers
|
264
303
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
265
304
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
266
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces'
|
305
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'
|
267
306
|
|
268
307
|
request_url = @base_url || @client.base_url
|
269
308
|
|
270
309
|
options = {
|
271
310
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
272
|
-
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
311
|
+
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
273
312
|
query_params: {'api-version' => @client.api_version},
|
274
313
|
headers: request_headers.merge(custom_headers || {}),
|
275
314
|
base_url: request_url
|
276
315
|
}
|
277
|
-
promise = @client.make_request_async(:
|
316
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
278
317
|
|
279
318
|
promise = promise.then do |result|
|
280
319
|
http_response = result.response
|
281
320
|
status_code = http_response.status
|
282
321
|
response_content = http_response.body
|
283
|
-
unless status_code == 200
|
322
|
+
unless status_code == 200 || status_code == 204
|
284
323
|
error_model = JSON.load(response_content)
|
285
324
|
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
286
325
|
end
|
@@ -288,16 +327,6 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
288
327
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
289
328
|
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
290
329
|
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
291
|
-
# Deserialize Response
|
292
|
-
if status_code == 200
|
293
|
-
begin
|
294
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
295
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EHNamespaceListResult.mapper()
|
296
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
297
|
-
rescue Exception => e
|
298
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
299
|
-
end
|
300
|
-
end
|
301
330
|
|
302
331
|
result
|
303
332
|
end
|
@@ -306,142 +335,59 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
306
335
|
end
|
307
336
|
|
308
337
|
#
|
309
|
-
#
|
310
|
-
# manifest is immutable. This operation is idempotent.
|
311
|
-
#
|
312
|
-
# @param resource_group_name [String] Name of the resource group within the
|
313
|
-
# azure subscription.
|
314
|
-
# @param namespace_name [String] The Namespace name
|
315
|
-
# @param parameters [EHNamespace] Parameters for creating a namespace resource.
|
316
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
317
|
-
# will be added to the HTTP request.
|
318
|
-
#
|
319
|
-
# @return [EHNamespace] operation results.
|
320
|
-
#
|
321
|
-
def create_or_update(resource_group_name, namespace_name, parameters, custom_headers:nil)
|
322
|
-
response = create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
|
323
|
-
response.body unless response.nil?
|
324
|
-
end
|
325
|
-
|
326
|
-
#
|
327
|
-
# @param resource_group_name [String] Name of the resource group within the
|
328
|
-
# azure subscription.
|
329
|
-
# @param namespace_name [String] The Namespace name
|
330
|
-
# @param parameters [EHNamespace] Parameters for creating a namespace resource.
|
331
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
332
|
-
# will be added to the HTTP request.
|
333
|
-
#
|
334
|
-
# @return [Concurrent::Promise] promise which provides async access to http
|
335
|
-
# response.
|
336
|
-
#
|
337
|
-
def create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
|
338
|
-
# Send request
|
339
|
-
promise = begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers)
|
340
|
-
|
341
|
-
promise = promise.then do |response|
|
342
|
-
# Defining deserialization method.
|
343
|
-
deserialize_method = lambda do |parsed_response|
|
344
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EHNamespace.mapper()
|
345
|
-
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
346
|
-
end
|
347
|
-
|
348
|
-
# Waiting for response.
|
349
|
-
@client.get_long_running_operation_result(response, deserialize_method)
|
350
|
-
end
|
351
|
-
|
352
|
-
promise
|
353
|
-
end
|
354
|
-
|
355
|
-
#
|
356
|
-
# Deletes an existing namespace. This operation also removes all associated
|
357
|
-
# resources under the namespace.
|
358
|
-
#
|
359
|
-
# @param resource_group_name [String] Name of the resource group within the
|
360
|
-
# azure subscription.
|
361
|
-
# @param namespace_name [String] The Namespace name
|
362
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
363
|
-
# will be added to the HTTP request.
|
364
|
-
#
|
365
|
-
def delete(resource_group_name, namespace_name, custom_headers:nil)
|
366
|
-
response = delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
367
|
-
nil
|
368
|
-
end
|
369
|
-
|
370
|
-
#
|
371
|
-
# @param resource_group_name [String] Name of the resource group within the
|
372
|
-
# azure subscription.
|
373
|
-
# @param namespace_name [String] The Namespace name
|
374
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
375
|
-
# will be added to the HTTP request.
|
376
|
-
#
|
377
|
-
# @return [Concurrent::Promise] promise which provides async access to http
|
378
|
-
# response.
|
379
|
-
#
|
380
|
-
def delete_async(resource_group_name, namespace_name, custom_headers:nil)
|
381
|
-
# Send request
|
382
|
-
promise = begin_delete_async(resource_group_name, namespace_name, custom_headers:custom_headers)
|
383
|
-
|
384
|
-
promise = promise.then do |response|
|
385
|
-
# Defining deserialization method.
|
386
|
-
deserialize_method = lambda do |parsed_response|
|
387
|
-
end
|
388
|
-
|
389
|
-
# Waiting for response.
|
390
|
-
@client.get_long_running_operation_result(response, deserialize_method)
|
391
|
-
end
|
392
|
-
|
393
|
-
promise
|
394
|
-
end
|
395
|
-
|
396
|
-
#
|
397
|
-
# Gets the description of the specified namespace.
|
338
|
+
# Gets an AuthorizationRule for a Namespace by rule name.
|
398
339
|
#
|
399
340
|
# @param resource_group_name [String] Name of the resource group within the
|
400
341
|
# azure subscription.
|
401
342
|
# @param namespace_name [String] The Namespace name
|
343
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
402
344
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
403
345
|
# will be added to the HTTP request.
|
404
346
|
#
|
405
|
-
# @return [
|
347
|
+
# @return [AuthorizationRule] operation results.
|
406
348
|
#
|
407
|
-
def
|
408
|
-
response =
|
349
|
+
def get_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
350
|
+
response = get_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
409
351
|
response.body unless response.nil?
|
410
352
|
end
|
411
353
|
|
412
354
|
#
|
413
|
-
# Gets
|
355
|
+
# Gets an AuthorizationRule for a Namespace by rule name.
|
414
356
|
#
|
415
357
|
# @param resource_group_name [String] Name of the resource group within the
|
416
358
|
# azure subscription.
|
417
359
|
# @param namespace_name [String] The Namespace name
|
360
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
418
361
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
419
362
|
# will be added to the HTTP request.
|
420
363
|
#
|
421
364
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
422
365
|
#
|
423
|
-
def
|
424
|
-
|
366
|
+
def get_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
367
|
+
get_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
425
368
|
end
|
426
369
|
|
427
370
|
#
|
428
|
-
# Gets
|
371
|
+
# Gets an AuthorizationRule for a Namespace by rule name.
|
429
372
|
#
|
430
373
|
# @param resource_group_name [String] Name of the resource group within the
|
431
374
|
# azure subscription.
|
432
375
|
# @param namespace_name [String] The Namespace name
|
376
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
433
377
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
434
378
|
# to the HTTP request.
|
435
379
|
#
|
436
380
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
437
381
|
#
|
438
|
-
def
|
382
|
+
def get_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
439
383
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
440
384
|
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
441
385
|
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
442
386
|
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
443
387
|
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
444
388
|
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
389
|
+
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
390
|
+
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
445
391
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
446
392
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
447
393
|
|
@@ -452,13 +398,13 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
452
398
|
# Set Headers
|
453
399
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
454
400
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
455
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'
|
401
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}'
|
456
402
|
|
457
403
|
request_url = @base_url || @client.base_url
|
458
404
|
|
459
405
|
options = {
|
460
406
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
461
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
407
|
+
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
462
408
|
query_params: {'api-version' => @client.api_version},
|
463
409
|
headers: request_headers.merge(custom_headers || {}),
|
464
410
|
base_url: request_url
|
@@ -469,7 +415,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
469
415
|
http_response = result.response
|
470
416
|
status_code = http_response.status
|
471
417
|
response_content = http_response.body
|
472
|
-
unless status_code == 200
|
418
|
+
unless status_code == 200
|
473
419
|
error_model = JSON.load(response_content)
|
474
420
|
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
475
421
|
end
|
@@ -481,17 +427,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
481
427
|
if status_code == 200
|
482
428
|
begin
|
483
429
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
484
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::
|
485
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
486
|
-
rescue Exception => e
|
487
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
488
|
-
end
|
489
|
-
end
|
490
|
-
# Deserialize Response
|
491
|
-
if status_code == 201
|
492
|
-
begin
|
493
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
494
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EHNamespace.mapper()
|
430
|
+
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
|
495
431
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
496
432
|
rescue Exception => e
|
497
433
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -505,61 +441,59 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
505
441
|
end
|
506
442
|
|
507
443
|
#
|
508
|
-
#
|
509
|
-
# manifest is immutable. This operation is idempotent.
|
444
|
+
# Gets the primary and secondary connection strings for the Namespace.
|
510
445
|
#
|
511
446
|
# @param resource_group_name [String] Name of the resource group within the
|
512
447
|
# azure subscription.
|
513
448
|
# @param namespace_name [String] The Namespace name
|
514
|
-
# @param
|
449
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
515
450
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
516
451
|
# will be added to the HTTP request.
|
517
452
|
#
|
518
|
-
# @return [
|
453
|
+
# @return [AccessKeys] operation results.
|
519
454
|
#
|
520
|
-
def
|
521
|
-
response =
|
455
|
+
def list_keys(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
456
|
+
response = list_keys_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
522
457
|
response.body unless response.nil?
|
523
458
|
end
|
524
459
|
|
525
460
|
#
|
526
|
-
#
|
527
|
-
# manifest is immutable. This operation is idempotent.
|
461
|
+
# Gets the primary and secondary connection strings for the Namespace.
|
528
462
|
#
|
529
463
|
# @param resource_group_name [String] Name of the resource group within the
|
530
464
|
# azure subscription.
|
531
465
|
# @param namespace_name [String] The Namespace name
|
532
|
-
# @param
|
466
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
533
467
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
534
468
|
# will be added to the HTTP request.
|
535
469
|
#
|
536
470
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
537
471
|
#
|
538
|
-
def
|
539
|
-
|
472
|
+
def list_keys_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
473
|
+
list_keys_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
540
474
|
end
|
541
475
|
|
542
476
|
#
|
543
|
-
#
|
544
|
-
# manifest is immutable. This operation is idempotent.
|
477
|
+
# Gets the primary and secondary connection strings for the Namespace.
|
545
478
|
#
|
546
479
|
# @param resource_group_name [String] Name of the resource group within the
|
547
480
|
# azure subscription.
|
548
481
|
# @param namespace_name [String] The Namespace name
|
549
|
-
# @param
|
482
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
550
483
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
551
484
|
# to the HTTP request.
|
552
485
|
#
|
553
486
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
554
487
|
#
|
555
|
-
def
|
488
|
+
def list_keys_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
556
489
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
557
490
|
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
558
491
|
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
559
492
|
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
560
493
|
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
561
494
|
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
562
|
-
fail ArgumentError, '
|
495
|
+
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
496
|
+
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
563
497
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
564
498
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
565
499
|
|
@@ -570,31 +504,24 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
570
504
|
# Set Headers
|
571
505
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
572
506
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
573
|
-
|
574
|
-
# Serialize Request
|
575
|
-
request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EHNamespace.mapper()
|
576
|
-
request_content = @client.serialize(request_mapper, parameters)
|
577
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
578
|
-
|
579
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'
|
507
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys'
|
580
508
|
|
581
509
|
request_url = @base_url || @client.base_url
|
582
510
|
|
583
511
|
options = {
|
584
512
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
585
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
513
|
+
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
586
514
|
query_params: {'api-version' => @client.api_version},
|
587
|
-
body: request_content,
|
588
515
|
headers: request_headers.merge(custom_headers || {}),
|
589
516
|
base_url: request_url
|
590
517
|
}
|
591
|
-
promise = @client.make_request_async(:
|
518
|
+
promise = @client.make_request_async(:post, path_template, options)
|
592
519
|
|
593
520
|
promise = promise.then do |result|
|
594
521
|
http_response = result.response
|
595
522
|
status_code = http_response.status
|
596
523
|
response_content = http_response.body
|
597
|
-
unless status_code ==
|
524
|
+
unless status_code == 200
|
598
525
|
error_model = JSON.load(response_content)
|
599
526
|
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
600
527
|
end
|
@@ -603,20 +530,10 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
603
530
|
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
604
531
|
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
605
532
|
# Deserialize Response
|
606
|
-
if status_code == 201
|
607
|
-
begin
|
608
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
609
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EHNamespace.mapper()
|
610
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
611
|
-
rescue Exception => e
|
612
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
613
|
-
end
|
614
|
-
end
|
615
|
-
# Deserialize Response
|
616
533
|
if status_code == 200
|
617
534
|
begin
|
618
535
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
619
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::
|
536
|
+
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AccessKeys.mapper()
|
620
537
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
621
538
|
rescue Exception => e
|
622
539
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -630,1244 +547,69 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
630
547
|
end
|
631
548
|
|
632
549
|
#
|
633
|
-
#
|
550
|
+
# Regenerates the primary or secondary connection strings for the specified
|
551
|
+
# Namespace.
|
634
552
|
#
|
635
553
|
# @param resource_group_name [String] Name of the resource group within the
|
636
554
|
# azure subscription.
|
637
555
|
# @param namespace_name [String] The Namespace name
|
556
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
557
|
+
# @param parameters [RegenerateAccessKeyParameters] Parameters required to
|
558
|
+
# regenerate the connection string.
|
638
559
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
639
560
|
# will be added to the HTTP request.
|
640
561
|
#
|
641
|
-
# @return [
|
562
|
+
# @return [AccessKeys] operation results.
|
642
563
|
#
|
643
|
-
def
|
644
|
-
response =
|
645
|
-
response.body unless response.nil?
|
646
|
-
end
|
647
|
-
|
648
|
-
#
|
649
|
-
# Gets messaging plan for specified namespace.
|
650
|
-
#
|
651
|
-
# @param resource_group_name [String] Name of the resource group within the
|
652
|
-
# azure subscription.
|
653
|
-
# @param namespace_name [String] The Namespace name
|
654
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
655
|
-
# will be added to the HTTP request.
|
656
|
-
#
|
657
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
658
|
-
#
|
659
|
-
def get_messaging_plan_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
|
660
|
-
get_messaging_plan_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
661
|
-
end
|
662
|
-
|
663
|
-
#
|
664
|
-
# Gets messaging plan for specified namespace.
|
665
|
-
#
|
666
|
-
# @param resource_group_name [String] Name of the resource group within the
|
667
|
-
# azure subscription.
|
668
|
-
# @param namespace_name [String] The Namespace name
|
669
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
670
|
-
# to the HTTP request.
|
671
|
-
#
|
672
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
673
|
-
#
|
674
|
-
def get_messaging_plan_async(resource_group_name, namespace_name, custom_headers:nil)
|
675
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
676
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
677
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
678
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
679
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
680
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
681
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
682
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
683
|
-
|
684
|
-
|
685
|
-
request_headers = {}
|
686
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
687
|
-
|
688
|
-
# Set Headers
|
689
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
690
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
691
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/messagingplan'
|
692
|
-
|
693
|
-
request_url = @base_url || @client.base_url
|
694
|
-
|
695
|
-
options = {
|
696
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
697
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
698
|
-
query_params: {'api-version' => @client.api_version},
|
699
|
-
headers: request_headers.merge(custom_headers || {}),
|
700
|
-
base_url: request_url
|
701
|
-
}
|
702
|
-
promise = @client.make_request_async(:get, path_template, options)
|
703
|
-
|
704
|
-
promise = promise.then do |result|
|
705
|
-
http_response = result.response
|
706
|
-
status_code = http_response.status
|
707
|
-
response_content = http_response.body
|
708
|
-
unless status_code == 200
|
709
|
-
error_model = JSON.load(response_content)
|
710
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
711
|
-
end
|
712
|
-
|
713
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
714
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
715
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
716
|
-
# Deserialize Response
|
717
|
-
if status_code == 200
|
718
|
-
begin
|
719
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
720
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::MessagingPlan.mapper()
|
721
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
722
|
-
rescue Exception => e
|
723
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
724
|
-
end
|
725
|
-
end
|
726
|
-
|
727
|
-
result
|
728
|
-
end
|
729
|
-
|
730
|
-
promise.execute
|
731
|
-
end
|
732
|
-
|
733
|
-
#
|
734
|
-
# Gets a list of authorization rules for a Namespace.
|
735
|
-
#
|
736
|
-
# @param resource_group_name [String] Name of the resource group within the
|
737
|
-
# azure subscription.
|
738
|
-
# @param namespace_name [String] The Namespace name
|
739
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
740
|
-
# will be added to the HTTP request.
|
741
|
-
#
|
742
|
-
# @return [Array<AuthorizationRule>] operation results.
|
743
|
-
#
|
744
|
-
def list_authorization_rules(resource_group_name, namespace_name, custom_headers:nil)
|
745
|
-
first_page = list_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
|
746
|
-
first_page.get_all_items
|
747
|
-
end
|
748
|
-
|
749
|
-
#
|
750
|
-
# Gets a list of authorization rules for a Namespace.
|
751
|
-
#
|
752
|
-
# @param resource_group_name [String] Name of the resource group within the
|
753
|
-
# azure subscription.
|
754
|
-
# @param namespace_name [String] The Namespace name
|
755
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
756
|
-
# will be added to the HTTP request.
|
757
|
-
#
|
758
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
759
|
-
#
|
760
|
-
def list_authorization_rules_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
|
761
|
-
list_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
762
|
-
end
|
763
|
-
|
764
|
-
#
|
765
|
-
# Gets a list of authorization rules for a Namespace.
|
766
|
-
#
|
767
|
-
# @param resource_group_name [String] Name of the resource group within the
|
768
|
-
# azure subscription.
|
769
|
-
# @param namespace_name [String] The Namespace name
|
770
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
771
|
-
# to the HTTP request.
|
772
|
-
#
|
773
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
774
|
-
#
|
775
|
-
def list_authorization_rules_async(resource_group_name, namespace_name, custom_headers:nil)
|
776
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
777
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
778
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
779
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
780
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
781
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
782
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
783
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
784
|
-
|
785
|
-
|
786
|
-
request_headers = {}
|
787
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
788
|
-
|
789
|
-
# Set Headers
|
790
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
791
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
792
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules'
|
793
|
-
|
794
|
-
request_url = @base_url || @client.base_url
|
795
|
-
|
796
|
-
options = {
|
797
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
798
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
799
|
-
query_params: {'api-version' => @client.api_version},
|
800
|
-
headers: request_headers.merge(custom_headers || {}),
|
801
|
-
base_url: request_url
|
802
|
-
}
|
803
|
-
promise = @client.make_request_async(:get, path_template, options)
|
804
|
-
|
805
|
-
promise = promise.then do |result|
|
806
|
-
http_response = result.response
|
807
|
-
status_code = http_response.status
|
808
|
-
response_content = http_response.body
|
809
|
-
unless status_code == 200
|
810
|
-
error_model = JSON.load(response_content)
|
811
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
812
|
-
end
|
813
|
-
|
814
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
815
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
816
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
817
|
-
# Deserialize Response
|
818
|
-
if status_code == 200
|
819
|
-
begin
|
820
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
821
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRuleListResult.mapper()
|
822
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
823
|
-
rescue Exception => e
|
824
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
825
|
-
end
|
826
|
-
end
|
827
|
-
|
828
|
-
result
|
829
|
-
end
|
830
|
-
|
831
|
-
promise.execute
|
832
|
-
end
|
833
|
-
|
834
|
-
#
|
835
|
-
# Creates or updates an AuthorizationRule for a Namespace.
|
836
|
-
#
|
837
|
-
# @param resource_group_name [String] Name of the resource group within the
|
838
|
-
# azure subscription.
|
839
|
-
# @param namespace_name [String] The Namespace name
|
840
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
841
|
-
# @param parameters [AuthorizationRule] The shared access AuthorizationRule.
|
842
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
843
|
-
# will be added to the HTTP request.
|
844
|
-
#
|
845
|
-
# @return [AuthorizationRule] operation results.
|
846
|
-
#
|
847
|
-
def create_or_update_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
848
|
-
response = create_or_update_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
|
564
|
+
def regenerate_keys(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
565
|
+
response = regenerate_keys_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
|
849
566
|
response.body unless response.nil?
|
850
567
|
end
|
851
568
|
|
852
569
|
#
|
853
|
-
#
|
570
|
+
# Regenerates the primary or secondary connection strings for the specified
|
571
|
+
# Namespace.
|
854
572
|
#
|
855
573
|
# @param resource_group_name [String] Name of the resource group within the
|
856
574
|
# azure subscription.
|
857
575
|
# @param namespace_name [String] The Namespace name
|
858
576
|
# @param authorization_rule_name [String] The authorization rule name.
|
859
|
-
# @param parameters [
|
577
|
+
# @param parameters [RegenerateAccessKeyParameters] Parameters required to
|
578
|
+
# regenerate the connection string.
|
860
579
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
861
580
|
# will be added to the HTTP request.
|
862
581
|
#
|
863
582
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
864
583
|
#
|
865
|
-
def
|
866
|
-
|
867
|
-
end
|
868
|
-
|
869
|
-
#
|
870
|
-
# Creates or updates an AuthorizationRule for a Namespace.
|
871
|
-
#
|
872
|
-
# @param resource_group_name [String] Name of the resource group within the
|
873
|
-
# azure subscription.
|
874
|
-
# @param namespace_name [String] The Namespace name
|
875
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
876
|
-
# @param parameters [AuthorizationRule] The shared access AuthorizationRule.
|
877
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
878
|
-
# to the HTTP request.
|
879
|
-
#
|
880
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
881
|
-
#
|
882
|
-
def create_or_update_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
883
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
884
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
885
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
886
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
887
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
888
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
889
|
-
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
890
|
-
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
891
|
-
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
892
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
893
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
894
|
-
|
895
|
-
|
896
|
-
request_headers = {}
|
897
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
898
|
-
|
899
|
-
# Set Headers
|
900
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
901
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
902
|
-
|
903
|
-
# Serialize Request
|
904
|
-
request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
|
905
|
-
request_content = @client.serialize(request_mapper, parameters)
|
906
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
907
|
-
|
908
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
|
909
|
-
|
910
|
-
request_url = @base_url || @client.base_url
|
911
|
-
|
912
|
-
options = {
|
913
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
914
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
915
|
-
query_params: {'api-version' => @client.api_version},
|
916
|
-
body: request_content,
|
917
|
-
headers: request_headers.merge(custom_headers || {}),
|
918
|
-
base_url: request_url
|
919
|
-
}
|
920
|
-
promise = @client.make_request_async(:put, path_template, options)
|
921
|
-
|
922
|
-
promise = promise.then do |result|
|
923
|
-
http_response = result.response
|
924
|
-
status_code = http_response.status
|
925
|
-
response_content = http_response.body
|
926
|
-
unless status_code == 200
|
927
|
-
error_model = JSON.load(response_content)
|
928
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
929
|
-
end
|
930
|
-
|
931
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
932
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
933
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
934
|
-
# Deserialize Response
|
935
|
-
if status_code == 200
|
936
|
-
begin
|
937
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
938
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
|
939
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
940
|
-
rescue Exception => e
|
941
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
942
|
-
end
|
943
|
-
end
|
944
|
-
|
945
|
-
result
|
946
|
-
end
|
947
|
-
|
948
|
-
promise.execute
|
949
|
-
end
|
950
|
-
|
951
|
-
#
|
952
|
-
# Deletes an AuthorizationRule for a Namespace.
|
953
|
-
#
|
954
|
-
# @param resource_group_name [String] Name of the resource group within the
|
955
|
-
# azure subscription.
|
956
|
-
# @param namespace_name [String] The Namespace name
|
957
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
958
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
959
|
-
# will be added to the HTTP request.
|
960
|
-
#
|
961
|
-
#
|
962
|
-
def delete_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
963
|
-
response = delete_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
964
|
-
nil
|
965
|
-
end
|
966
|
-
|
967
|
-
#
|
968
|
-
# Deletes an AuthorizationRule for a Namespace.
|
969
|
-
#
|
970
|
-
# @param resource_group_name [String] Name of the resource group within the
|
971
|
-
# azure subscription.
|
972
|
-
# @param namespace_name [String] The Namespace name
|
973
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
974
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
975
|
-
# will be added to the HTTP request.
|
976
|
-
#
|
977
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
978
|
-
#
|
979
|
-
def delete_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
980
|
-
delete_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
981
|
-
end
|
982
|
-
|
983
|
-
#
|
984
|
-
# Deletes an AuthorizationRule for a Namespace.
|
985
|
-
#
|
986
|
-
# @param resource_group_name [String] Name of the resource group within the
|
987
|
-
# azure subscription.
|
988
|
-
# @param namespace_name [String] The Namespace name
|
989
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
990
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
991
|
-
# to the HTTP request.
|
992
|
-
#
|
993
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
994
|
-
#
|
995
|
-
def delete_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
996
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
997
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
998
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
999
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
1000
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
1001
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
1002
|
-
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
1003
|
-
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
1004
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1005
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1006
|
-
|
1007
|
-
|
1008
|
-
request_headers = {}
|
1009
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1010
|
-
|
1011
|
-
# Set Headers
|
1012
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1013
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1014
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
|
1015
|
-
|
1016
|
-
request_url = @base_url || @client.base_url
|
1017
|
-
|
1018
|
-
options = {
|
1019
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1020
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
1021
|
-
query_params: {'api-version' => @client.api_version},
|
1022
|
-
headers: request_headers.merge(custom_headers || {}),
|
1023
|
-
base_url: request_url
|
1024
|
-
}
|
1025
|
-
promise = @client.make_request_async(:delete, path_template, options)
|
1026
|
-
|
1027
|
-
promise = promise.then do |result|
|
1028
|
-
http_response = result.response
|
1029
|
-
status_code = http_response.status
|
1030
|
-
response_content = http_response.body
|
1031
|
-
unless status_code == 204 || status_code == 200
|
1032
|
-
error_model = JSON.load(response_content)
|
1033
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1034
|
-
end
|
1035
|
-
|
1036
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1037
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1038
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1039
|
-
|
1040
|
-
result
|
1041
|
-
end
|
1042
|
-
|
1043
|
-
promise.execute
|
1044
|
-
end
|
1045
|
-
|
1046
|
-
#
|
1047
|
-
# Gets an AuthorizationRule for a Namespace by rule name.
|
1048
|
-
#
|
1049
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1050
|
-
# azure subscription.
|
1051
|
-
# @param namespace_name [String] The Namespace name
|
1052
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
1053
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1054
|
-
# will be added to the HTTP request.
|
1055
|
-
#
|
1056
|
-
# @return [AuthorizationRule] operation results.
|
1057
|
-
#
|
1058
|
-
def get_authorization_rule(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
1059
|
-
response = get_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
1060
|
-
response.body unless response.nil?
|
1061
|
-
end
|
1062
|
-
|
1063
|
-
#
|
1064
|
-
# Gets an AuthorizationRule for a Namespace by rule name.
|
1065
|
-
#
|
1066
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1067
|
-
# azure subscription.
|
1068
|
-
# @param namespace_name [String] The Namespace name
|
1069
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
1070
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1071
|
-
# will be added to the HTTP request.
|
1072
|
-
#
|
1073
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1074
|
-
#
|
1075
|
-
def get_authorization_rule_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
1076
|
-
get_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
1077
|
-
end
|
1078
|
-
|
1079
|
-
#
|
1080
|
-
# Gets an AuthorizationRule for a Namespace by rule name.
|
1081
|
-
#
|
1082
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1083
|
-
# azure subscription.
|
1084
|
-
# @param namespace_name [String] The Namespace name
|
1085
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
1086
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1087
|
-
# to the HTTP request.
|
1088
|
-
#
|
1089
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1090
|
-
#
|
1091
|
-
def get_authorization_rule_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
1092
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1093
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
1094
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1095
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
1096
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
1097
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
1098
|
-
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
1099
|
-
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
1100
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1101
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1102
|
-
|
1103
|
-
|
1104
|
-
request_headers = {}
|
1105
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1106
|
-
|
1107
|
-
# Set Headers
|
1108
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1109
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1110
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}'
|
1111
|
-
|
1112
|
-
request_url = @base_url || @client.base_url
|
1113
|
-
|
1114
|
-
options = {
|
1115
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1116
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
1117
|
-
query_params: {'api-version' => @client.api_version},
|
1118
|
-
headers: request_headers.merge(custom_headers || {}),
|
1119
|
-
base_url: request_url
|
1120
|
-
}
|
1121
|
-
promise = @client.make_request_async(:get, path_template, options)
|
1122
|
-
|
1123
|
-
promise = promise.then do |result|
|
1124
|
-
http_response = result.response
|
1125
|
-
status_code = http_response.status
|
1126
|
-
response_content = http_response.body
|
1127
|
-
unless status_code == 200
|
1128
|
-
error_model = JSON.load(response_content)
|
1129
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1130
|
-
end
|
1131
|
-
|
1132
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1133
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1134
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1135
|
-
# Deserialize Response
|
1136
|
-
if status_code == 200
|
1137
|
-
begin
|
1138
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1139
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AuthorizationRule.mapper()
|
1140
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
1141
|
-
rescue Exception => e
|
1142
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1143
|
-
end
|
1144
|
-
end
|
1145
|
-
|
1146
|
-
result
|
1147
|
-
end
|
1148
|
-
|
1149
|
-
promise.execute
|
1150
|
-
end
|
1151
|
-
|
1152
|
-
#
|
1153
|
-
# Gets the primary and secondary connection strings for the Namespace.
|
1154
|
-
#
|
1155
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1156
|
-
# azure subscription.
|
1157
|
-
# @param namespace_name [String] The Namespace name
|
1158
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
1159
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1160
|
-
# will be added to the HTTP request.
|
1161
|
-
#
|
1162
|
-
# @return [AccessKeys] operation results.
|
1163
|
-
#
|
1164
|
-
def list_keys(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
1165
|
-
response = list_keys_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
1166
|
-
response.body unless response.nil?
|
1167
|
-
end
|
1168
|
-
|
1169
|
-
#
|
1170
|
-
# Gets the primary and secondary connection strings for the Namespace.
|
1171
|
-
#
|
1172
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1173
|
-
# azure subscription.
|
1174
|
-
# @param namespace_name [String] The Namespace name
|
1175
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
1176
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1177
|
-
# will be added to the HTTP request.
|
1178
|
-
#
|
1179
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1180
|
-
#
|
1181
|
-
def list_keys_with_http_info(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
1182
|
-
list_keys_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:custom_headers).value!
|
1183
|
-
end
|
1184
|
-
|
1185
|
-
#
|
1186
|
-
# Gets the primary and secondary connection strings for the Namespace.
|
1187
|
-
#
|
1188
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1189
|
-
# azure subscription.
|
1190
|
-
# @param namespace_name [String] The Namespace name
|
1191
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
1192
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1193
|
-
# to the HTTP request.
|
1194
|
-
#
|
1195
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1196
|
-
#
|
1197
|
-
def list_keys_async(resource_group_name, namespace_name, authorization_rule_name, custom_headers:nil)
|
1198
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1199
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
1200
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1201
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
1202
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
1203
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
1204
|
-
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
1205
|
-
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
1206
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1207
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1208
|
-
|
1209
|
-
|
1210
|
-
request_headers = {}
|
1211
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1212
|
-
|
1213
|
-
# Set Headers
|
1214
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1215
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1216
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys'
|
1217
|
-
|
1218
|
-
request_url = @base_url || @client.base_url
|
1219
|
-
|
1220
|
-
options = {
|
1221
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1222
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
1223
|
-
query_params: {'api-version' => @client.api_version},
|
1224
|
-
headers: request_headers.merge(custom_headers || {}),
|
1225
|
-
base_url: request_url
|
1226
|
-
}
|
1227
|
-
promise = @client.make_request_async(:post, path_template, options)
|
1228
|
-
|
1229
|
-
promise = promise.then do |result|
|
1230
|
-
http_response = result.response
|
1231
|
-
status_code = http_response.status
|
1232
|
-
response_content = http_response.body
|
1233
|
-
unless status_code == 200
|
1234
|
-
error_model = JSON.load(response_content)
|
1235
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1236
|
-
end
|
1237
|
-
|
1238
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1239
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1240
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1241
|
-
# Deserialize Response
|
1242
|
-
if status_code == 200
|
1243
|
-
begin
|
1244
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1245
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AccessKeys.mapper()
|
1246
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
1247
|
-
rescue Exception => e
|
1248
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1249
|
-
end
|
1250
|
-
end
|
1251
|
-
|
1252
|
-
result
|
1253
|
-
end
|
1254
|
-
|
1255
|
-
promise.execute
|
1256
|
-
end
|
1257
|
-
|
1258
|
-
#
|
1259
|
-
# Regenerates the primary or secondary connection strings for the specified
|
1260
|
-
# Namespace.
|
1261
|
-
#
|
1262
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1263
|
-
# azure subscription.
|
1264
|
-
# @param namespace_name [String] The Namespace name
|
1265
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
1266
|
-
# @param parameters [RegenerateAccessKeyParameters] Parameters required to
|
1267
|
-
# regenerate the connection string.
|
1268
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1269
|
-
# will be added to the HTTP request.
|
1270
|
-
#
|
1271
|
-
# @return [AccessKeys] operation results.
|
1272
|
-
#
|
1273
|
-
def regenerate_keys(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
1274
|
-
response = regenerate_keys_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
|
1275
|
-
response.body unless response.nil?
|
1276
|
-
end
|
1277
|
-
|
1278
|
-
#
|
1279
|
-
# Regenerates the primary or secondary connection strings for the specified
|
1280
|
-
# Namespace.
|
1281
|
-
#
|
1282
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1283
|
-
# azure subscription.
|
1284
|
-
# @param namespace_name [String] The Namespace name
|
1285
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
1286
|
-
# @param parameters [RegenerateAccessKeyParameters] Parameters required to
|
1287
|
-
# regenerate the connection string.
|
1288
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1289
|
-
# will be added to the HTTP request.
|
1290
|
-
#
|
1291
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1292
|
-
#
|
1293
|
-
def regenerate_keys_with_http_info(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
1294
|
-
regenerate_keys_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
|
1295
|
-
end
|
1296
|
-
|
1297
|
-
#
|
1298
|
-
# Regenerates the primary or secondary connection strings for the specified
|
1299
|
-
# Namespace.
|
1300
|
-
#
|
1301
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1302
|
-
# azure subscription.
|
1303
|
-
# @param namespace_name [String] The Namespace name
|
1304
|
-
# @param authorization_rule_name [String] The authorization rule name.
|
1305
|
-
# @param parameters [RegenerateAccessKeyParameters] Parameters required to
|
1306
|
-
# regenerate the connection string.
|
1307
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1308
|
-
# to the HTTP request.
|
1309
|
-
#
|
1310
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1311
|
-
#
|
1312
|
-
def regenerate_keys_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
1313
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1314
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
1315
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1316
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
1317
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
1318
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
1319
|
-
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
1320
|
-
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
1321
|
-
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1322
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1323
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1324
|
-
|
1325
|
-
|
1326
|
-
request_headers = {}
|
1327
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1328
|
-
|
1329
|
-
# Set Headers
|
1330
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1331
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1332
|
-
|
1333
|
-
# Serialize Request
|
1334
|
-
request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::RegenerateAccessKeyParameters.mapper()
|
1335
|
-
request_content = @client.serialize(request_mapper, parameters)
|
1336
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1337
|
-
|
1338
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'
|
1339
|
-
|
1340
|
-
request_url = @base_url || @client.base_url
|
1341
|
-
|
1342
|
-
options = {
|
1343
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1344
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
1345
|
-
query_params: {'api-version' => @client.api_version},
|
1346
|
-
body: request_content,
|
1347
|
-
headers: request_headers.merge(custom_headers || {}),
|
1348
|
-
base_url: request_url
|
1349
|
-
}
|
1350
|
-
promise = @client.make_request_async(:post, path_template, options)
|
1351
|
-
|
1352
|
-
promise = promise.then do |result|
|
1353
|
-
http_response = result.response
|
1354
|
-
status_code = http_response.status
|
1355
|
-
response_content = http_response.body
|
1356
|
-
unless status_code == 200
|
1357
|
-
error_model = JSON.load(response_content)
|
1358
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1359
|
-
end
|
1360
|
-
|
1361
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1362
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1363
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1364
|
-
# Deserialize Response
|
1365
|
-
if status_code == 200
|
1366
|
-
begin
|
1367
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1368
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AccessKeys.mapper()
|
1369
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
1370
|
-
rescue Exception => e
|
1371
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1372
|
-
end
|
1373
|
-
end
|
1374
|
-
|
1375
|
-
result
|
1376
|
-
end
|
1377
|
-
|
1378
|
-
promise.execute
|
1379
|
-
end
|
1380
|
-
|
1381
|
-
#
|
1382
|
-
# Create or update NetworkRuleSet for a Namespace.
|
1383
|
-
#
|
1384
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1385
|
-
# azure subscription.
|
1386
|
-
# @param namespace_name [String] The Namespace name
|
1387
|
-
# @param parameters [NetworkRuleSet] The Namespace IpFilterRule.
|
1388
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1389
|
-
# will be added to the HTTP request.
|
1390
|
-
#
|
1391
|
-
# @return [NetworkRuleSet] operation results.
|
1392
|
-
#
|
1393
|
-
def create_or_update_network_rule_set(resource_group_name, namespace_name, parameters, custom_headers:nil)
|
1394
|
-
response = create_or_update_network_rule_set_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
|
1395
|
-
response.body unless response.nil?
|
1396
|
-
end
|
1397
|
-
|
1398
|
-
#
|
1399
|
-
# Create or update NetworkRuleSet for a Namespace.
|
1400
|
-
#
|
1401
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1402
|
-
# azure subscription.
|
1403
|
-
# @param namespace_name [String] The Namespace name
|
1404
|
-
# @param parameters [NetworkRuleSet] The Namespace IpFilterRule.
|
1405
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1406
|
-
# will be added to the HTTP request.
|
1407
|
-
#
|
1408
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1409
|
-
#
|
1410
|
-
def create_or_update_network_rule_set_with_http_info(resource_group_name, namespace_name, parameters, custom_headers:nil)
|
1411
|
-
create_or_update_network_rule_set_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
|
1412
|
-
end
|
1413
|
-
|
1414
|
-
#
|
1415
|
-
# Create or update NetworkRuleSet for a Namespace.
|
1416
|
-
#
|
1417
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1418
|
-
# azure subscription.
|
1419
|
-
# @param namespace_name [String] The Namespace name
|
1420
|
-
# @param parameters [NetworkRuleSet] The Namespace IpFilterRule.
|
1421
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1422
|
-
# to the HTTP request.
|
1423
|
-
#
|
1424
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1425
|
-
#
|
1426
|
-
def create_or_update_network_rule_set_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
|
1427
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1428
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
1429
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1430
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
1431
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
1432
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
1433
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1434
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1435
|
-
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1436
|
-
|
1437
|
-
|
1438
|
-
request_headers = {}
|
1439
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1440
|
-
|
1441
|
-
# Set Headers
|
1442
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1443
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1444
|
-
|
1445
|
-
# Serialize Request
|
1446
|
-
request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::NetworkRuleSet.mapper()
|
1447
|
-
request_content = @client.serialize(request_mapper, parameters)
|
1448
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1449
|
-
|
1450
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default'
|
1451
|
-
|
1452
|
-
request_url = @base_url || @client.base_url
|
1453
|
-
|
1454
|
-
options = {
|
1455
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1456
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
1457
|
-
query_params: {'api-version' => @client.api_version},
|
1458
|
-
body: request_content,
|
1459
|
-
headers: request_headers.merge(custom_headers || {}),
|
1460
|
-
base_url: request_url
|
1461
|
-
}
|
1462
|
-
promise = @client.make_request_async(:put, path_template, options)
|
1463
|
-
|
1464
|
-
promise = promise.then do |result|
|
1465
|
-
http_response = result.response
|
1466
|
-
status_code = http_response.status
|
1467
|
-
response_content = http_response.body
|
1468
|
-
unless status_code == 200
|
1469
|
-
error_model = JSON.load(response_content)
|
1470
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1471
|
-
end
|
1472
|
-
|
1473
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1474
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1475
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1476
|
-
# Deserialize Response
|
1477
|
-
if status_code == 200
|
1478
|
-
begin
|
1479
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1480
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::NetworkRuleSet.mapper()
|
1481
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
1482
|
-
rescue Exception => e
|
1483
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1484
|
-
end
|
1485
|
-
end
|
1486
|
-
|
1487
|
-
result
|
1488
|
-
end
|
1489
|
-
|
1490
|
-
promise.execute
|
1491
|
-
end
|
1492
|
-
|
1493
|
-
#
|
1494
|
-
# Gets NetworkRuleSet for a Namespace.
|
1495
|
-
#
|
1496
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1497
|
-
# azure subscription.
|
1498
|
-
# @param namespace_name [String] The Namespace name
|
1499
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1500
|
-
# will be added to the HTTP request.
|
1501
|
-
#
|
1502
|
-
# @return [NetworkRuleSet] operation results.
|
1503
|
-
#
|
1504
|
-
def get_network_rule_set(resource_group_name, namespace_name, custom_headers:nil)
|
1505
|
-
response = get_network_rule_set_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
1506
|
-
response.body unless response.nil?
|
1507
|
-
end
|
1508
|
-
|
1509
|
-
#
|
1510
|
-
# Gets NetworkRuleSet for a Namespace.
|
1511
|
-
#
|
1512
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1513
|
-
# azure subscription.
|
1514
|
-
# @param namespace_name [String] The Namespace name
|
1515
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1516
|
-
# will be added to the HTTP request.
|
1517
|
-
#
|
1518
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1519
|
-
#
|
1520
|
-
def get_network_rule_set_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
|
1521
|
-
get_network_rule_set_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
1522
|
-
end
|
1523
|
-
|
1524
|
-
#
|
1525
|
-
# Gets NetworkRuleSet for a Namespace.
|
1526
|
-
#
|
1527
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1528
|
-
# azure subscription.
|
1529
|
-
# @param namespace_name [String] The Namespace name
|
1530
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1531
|
-
# to the HTTP request.
|
1532
|
-
#
|
1533
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1534
|
-
#
|
1535
|
-
def get_network_rule_set_async(resource_group_name, namespace_name, custom_headers:nil)
|
1536
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1537
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
1538
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1539
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
1540
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
1541
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
1542
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1543
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1544
|
-
|
1545
|
-
|
1546
|
-
request_headers = {}
|
1547
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1548
|
-
|
1549
|
-
# Set Headers
|
1550
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1551
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1552
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets/default'
|
1553
|
-
|
1554
|
-
request_url = @base_url || @client.base_url
|
1555
|
-
|
1556
|
-
options = {
|
1557
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1558
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
1559
|
-
query_params: {'api-version' => @client.api_version},
|
1560
|
-
headers: request_headers.merge(custom_headers || {}),
|
1561
|
-
base_url: request_url
|
1562
|
-
}
|
1563
|
-
promise = @client.make_request_async(:get, path_template, options)
|
1564
|
-
|
1565
|
-
promise = promise.then do |result|
|
1566
|
-
http_response = result.response
|
1567
|
-
status_code = http_response.status
|
1568
|
-
response_content = http_response.body
|
1569
|
-
unless status_code == 200
|
1570
|
-
error_model = JSON.load(response_content)
|
1571
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1572
|
-
end
|
1573
|
-
|
1574
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1575
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1576
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1577
|
-
# Deserialize Response
|
1578
|
-
if status_code == 200
|
1579
|
-
begin
|
1580
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1581
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::NetworkRuleSet.mapper()
|
1582
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
1583
|
-
rescue Exception => e
|
1584
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1585
|
-
end
|
1586
|
-
end
|
1587
|
-
|
1588
|
-
result
|
1589
|
-
end
|
1590
|
-
|
1591
|
-
promise.execute
|
1592
|
-
end
|
1593
|
-
|
1594
|
-
#
|
1595
|
-
# Gets list of NetworkRuleSet for a Namespace.
|
1596
|
-
#
|
1597
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1598
|
-
# azure subscription.
|
1599
|
-
# @param namespace_name [String] The Namespace name
|
1600
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1601
|
-
# will be added to the HTTP request.
|
1602
|
-
#
|
1603
|
-
# @return [Array<NetworkRuleSet>] operation results.
|
1604
|
-
#
|
1605
|
-
def list_network_rule_sets(resource_group_name, namespace_name, custom_headers:nil)
|
1606
|
-
first_page = list_network_rule_sets_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
|
1607
|
-
first_page.get_all_items
|
1608
|
-
end
|
1609
|
-
|
1610
|
-
#
|
1611
|
-
# Gets list of NetworkRuleSet for a Namespace.
|
1612
|
-
#
|
1613
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1614
|
-
# azure subscription.
|
1615
|
-
# @param namespace_name [String] The Namespace name
|
1616
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1617
|
-
# will be added to the HTTP request.
|
1618
|
-
#
|
1619
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1620
|
-
#
|
1621
|
-
def list_network_rule_sets_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
|
1622
|
-
list_network_rule_sets_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
1623
|
-
end
|
1624
|
-
|
1625
|
-
#
|
1626
|
-
# Gets list of NetworkRuleSet for a Namespace.
|
1627
|
-
#
|
1628
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1629
|
-
# azure subscription.
|
1630
|
-
# @param namespace_name [String] The Namespace name
|
1631
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1632
|
-
# to the HTTP request.
|
1633
|
-
#
|
1634
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1635
|
-
#
|
1636
|
-
def list_network_rule_sets_async(resource_group_name, namespace_name, custom_headers:nil)
|
1637
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1638
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
1639
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1640
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
1641
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
1642
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
1643
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1644
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1645
|
-
|
1646
|
-
|
1647
|
-
request_headers = {}
|
1648
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1649
|
-
|
1650
|
-
# Set Headers
|
1651
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1652
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1653
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkRuleSets'
|
1654
|
-
|
1655
|
-
request_url = @base_url || @client.base_url
|
1656
|
-
|
1657
|
-
options = {
|
1658
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1659
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
1660
|
-
query_params: {'api-version' => @client.api_version},
|
1661
|
-
headers: request_headers.merge(custom_headers || {}),
|
1662
|
-
base_url: request_url
|
1663
|
-
}
|
1664
|
-
promise = @client.make_request_async(:get, path_template, options)
|
1665
|
-
|
1666
|
-
promise = promise.then do |result|
|
1667
|
-
http_response = result.response
|
1668
|
-
status_code = http_response.status
|
1669
|
-
response_content = http_response.body
|
1670
|
-
unless status_code == 200
|
1671
|
-
error_model = JSON.load(response_content)
|
1672
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1673
|
-
end
|
1674
|
-
|
1675
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1676
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1677
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1678
|
-
# Deserialize Response
|
1679
|
-
if status_code == 200
|
1680
|
-
begin
|
1681
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1682
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::NetworkRuleSetListResult.mapper()
|
1683
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
1684
|
-
rescue Exception => e
|
1685
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1686
|
-
end
|
1687
|
-
end
|
1688
|
-
|
1689
|
-
result
|
1690
|
-
end
|
1691
|
-
|
1692
|
-
promise.execute
|
1693
|
-
end
|
1694
|
-
|
1695
|
-
#
|
1696
|
-
# Creates or updates a namespace. Once created, this namespace's resource
|
1697
|
-
# manifest is immutable. This operation is idempotent.
|
1698
|
-
#
|
1699
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1700
|
-
# azure subscription.
|
1701
|
-
# @param namespace_name [String] The Namespace name
|
1702
|
-
# @param parameters [EHNamespace] Parameters for creating a namespace resource.
|
1703
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1704
|
-
# will be added to the HTTP request.
|
1705
|
-
#
|
1706
|
-
# @return [EHNamespace] operation results.
|
1707
|
-
#
|
1708
|
-
def begin_create_or_update(resource_group_name, namespace_name, parameters, custom_headers:nil)
|
1709
|
-
response = begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
|
1710
|
-
response.body unless response.nil?
|
1711
|
-
end
|
1712
|
-
|
1713
|
-
#
|
1714
|
-
# Creates or updates a namespace. Once created, this namespace's resource
|
1715
|
-
# manifest is immutable. This operation is idempotent.
|
1716
|
-
#
|
1717
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1718
|
-
# azure subscription.
|
1719
|
-
# @param namespace_name [String] The Namespace name
|
1720
|
-
# @param parameters [EHNamespace] Parameters for creating a namespace resource.
|
1721
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1722
|
-
# will be added to the HTTP request.
|
1723
|
-
#
|
1724
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1725
|
-
#
|
1726
|
-
def begin_create_or_update_with_http_info(resource_group_name, namespace_name, parameters, custom_headers:nil)
|
1727
|
-
begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
|
1728
|
-
end
|
1729
|
-
|
1730
|
-
#
|
1731
|
-
# Creates or updates a namespace. Once created, this namespace's resource
|
1732
|
-
# manifest is immutable. This operation is idempotent.
|
1733
|
-
#
|
1734
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1735
|
-
# azure subscription.
|
1736
|
-
# @param namespace_name [String] The Namespace name
|
1737
|
-
# @param parameters [EHNamespace] Parameters for creating a namespace resource.
|
1738
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1739
|
-
# to the HTTP request.
|
1740
|
-
#
|
1741
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1742
|
-
#
|
1743
|
-
def begin_create_or_update_async(resource_group_name, namespace_name, parameters, custom_headers:nil)
|
1744
|
-
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1745
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
1746
|
-
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1747
|
-
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
1748
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
1749
|
-
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
1750
|
-
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1751
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1752
|
-
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1753
|
-
|
1754
|
-
|
1755
|
-
request_headers = {}
|
1756
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1757
|
-
|
1758
|
-
# Set Headers
|
1759
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1760
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1761
|
-
|
1762
|
-
# Serialize Request
|
1763
|
-
request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EHNamespace.mapper()
|
1764
|
-
request_content = @client.serialize(request_mapper, parameters)
|
1765
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1766
|
-
|
1767
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'
|
1768
|
-
|
1769
|
-
request_url = @base_url || @client.base_url
|
1770
|
-
|
1771
|
-
options = {
|
1772
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1773
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
1774
|
-
query_params: {'api-version' => @client.api_version},
|
1775
|
-
body: request_content,
|
1776
|
-
headers: request_headers.merge(custom_headers || {}),
|
1777
|
-
base_url: request_url
|
1778
|
-
}
|
1779
|
-
promise = @client.make_request_async(:put, path_template, options)
|
1780
|
-
|
1781
|
-
promise = promise.then do |result|
|
1782
|
-
http_response = result.response
|
1783
|
-
status_code = http_response.status
|
1784
|
-
response_content = http_response.body
|
1785
|
-
unless status_code == 201 || status_code == 200 || status_code == 202
|
1786
|
-
error_model = JSON.load(response_content)
|
1787
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1788
|
-
end
|
1789
|
-
|
1790
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1791
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1792
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1793
|
-
# Deserialize Response
|
1794
|
-
if status_code == 201
|
1795
|
-
begin
|
1796
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1797
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EHNamespace.mapper()
|
1798
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
1799
|
-
rescue Exception => e
|
1800
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1801
|
-
end
|
1802
|
-
end
|
1803
|
-
# Deserialize Response
|
1804
|
-
if status_code == 200
|
1805
|
-
begin
|
1806
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1807
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::EHNamespace.mapper()
|
1808
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
1809
|
-
rescue Exception => e
|
1810
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1811
|
-
end
|
1812
|
-
end
|
1813
|
-
|
1814
|
-
result
|
1815
|
-
end
|
1816
|
-
|
1817
|
-
promise.execute
|
1818
|
-
end
|
1819
|
-
|
1820
|
-
#
|
1821
|
-
# Deletes an existing namespace. This operation also removes all associated
|
1822
|
-
# resources under the namespace.
|
1823
|
-
#
|
1824
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1825
|
-
# azure subscription.
|
1826
|
-
# @param namespace_name [String] The Namespace name
|
1827
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1828
|
-
# will be added to the HTTP request.
|
1829
|
-
#
|
1830
|
-
#
|
1831
|
-
def begin_delete(resource_group_name, namespace_name, custom_headers:nil)
|
1832
|
-
response = begin_delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
1833
|
-
nil
|
1834
|
-
end
|
1835
|
-
|
1836
|
-
#
|
1837
|
-
# Deletes an existing namespace. This operation also removes all associated
|
1838
|
-
# resources under the namespace.
|
1839
|
-
#
|
1840
|
-
# @param resource_group_name [String] Name of the resource group within the
|
1841
|
-
# azure subscription.
|
1842
|
-
# @param namespace_name [String] The Namespace name
|
1843
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1844
|
-
# will be added to the HTTP request.
|
1845
|
-
#
|
1846
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1847
|
-
#
|
1848
|
-
def begin_delete_with_http_info(resource_group_name, namespace_name, custom_headers:nil)
|
1849
|
-
begin_delete_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
584
|
+
def regenerate_keys_with_http_info(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
585
|
+
regenerate_keys_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:custom_headers).value!
|
1850
586
|
end
|
1851
587
|
|
1852
588
|
#
|
1853
|
-
#
|
1854
|
-
#
|
589
|
+
# Regenerates the primary or secondary connection strings for the specified
|
590
|
+
# Namespace.
|
1855
591
|
#
|
1856
592
|
# @param resource_group_name [String] Name of the resource group within the
|
1857
593
|
# azure subscription.
|
1858
594
|
# @param namespace_name [String] The Namespace name
|
595
|
+
# @param authorization_rule_name [String] The authorization rule name.
|
596
|
+
# @param parameters [RegenerateAccessKeyParameters] Parameters required to
|
597
|
+
# regenerate the connection string.
|
1859
598
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1860
599
|
# to the HTTP request.
|
1861
600
|
#
|
1862
601
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1863
602
|
#
|
1864
|
-
def
|
603
|
+
def regenerate_keys_async(resource_group_name, namespace_name, authorization_rule_name, parameters, custom_headers:nil)
|
1865
604
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1866
605
|
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
1867
606
|
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
1868
607
|
fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
|
1869
608
|
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MaxLength': '50'" if !namespace_name.nil? && namespace_name.length > 50
|
1870
609
|
fail ArgumentError, "'namespace_name' should satisfy the constraint - 'MinLength': '6'" if !namespace_name.nil? && namespace_name.length < 6
|
610
|
+
fail ArgumentError, 'authorization_rule_name is nil' if authorization_rule_name.nil?
|
611
|
+
fail ArgumentError, "'authorization_rule_name' should satisfy the constraint - 'MinLength': '1'" if !authorization_rule_name.nil? && authorization_rule_name.length < 1
|
612
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1871
613
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
1872
614
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1873
615
|
|
@@ -1878,101 +620,25 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
1878
620
|
# Set Headers
|
1879
621
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1880
622
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1881
|
-
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}'
|
1882
|
-
|
1883
|
-
request_url = @base_url || @client.base_url
|
1884
|
-
|
1885
|
-
options = {
|
1886
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1887
|
-
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'subscriptionId' => @client.subscription_id},
|
1888
|
-
query_params: {'api-version' => @client.api_version},
|
1889
|
-
headers: request_headers.merge(custom_headers || {}),
|
1890
|
-
base_url: request_url
|
1891
|
-
}
|
1892
|
-
promise = @client.make_request_async(:delete, path_template, options)
|
1893
|
-
|
1894
|
-
promise = promise.then do |result|
|
1895
|
-
http_response = result.response
|
1896
|
-
status_code = http_response.status
|
1897
|
-
response_content = http_response.body
|
1898
|
-
unless status_code == 204 || status_code == 200 || status_code == 202
|
1899
|
-
error_model = JSON.load(response_content)
|
1900
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1901
|
-
end
|
1902
|
-
|
1903
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1904
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1905
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
1906
|
-
|
1907
|
-
result
|
1908
|
-
end
|
1909
|
-
|
1910
|
-
promise.execute
|
1911
|
-
end
|
1912
|
-
|
1913
|
-
#
|
1914
|
-
# Lists all the available Namespaces within a subscription, irrespective of the
|
1915
|
-
# resource groups.
|
1916
|
-
#
|
1917
|
-
# @param next_page_link [String] The NextLink from the previous successful call
|
1918
|
-
# to List operation.
|
1919
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1920
|
-
# will be added to the HTTP request.
|
1921
|
-
#
|
1922
|
-
# @return [EHNamespaceListResult] operation results.
|
1923
|
-
#
|
1924
|
-
def list_next(next_page_link, custom_headers:nil)
|
1925
|
-
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
1926
|
-
response.body unless response.nil?
|
1927
|
-
end
|
1928
|
-
|
1929
|
-
#
|
1930
|
-
# Lists all the available Namespaces within a subscription, irrespective of the
|
1931
|
-
# resource groups.
|
1932
|
-
#
|
1933
|
-
# @param next_page_link [String] The NextLink from the previous successful call
|
1934
|
-
# to List operation.
|
1935
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1936
|
-
# will be added to the HTTP request.
|
1937
|
-
#
|
1938
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1939
|
-
#
|
1940
|
-
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
1941
|
-
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
1942
|
-
end
|
1943
|
-
|
1944
|
-
#
|
1945
|
-
# Lists all the available Namespaces within a subscription, irrespective of the
|
1946
|
-
# resource groups.
|
1947
|
-
#
|
1948
|
-
# @param next_page_link [String] The NextLink from the previous successful call
|
1949
|
-
# to List operation.
|
1950
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1951
|
-
# to the HTTP request.
|
1952
|
-
#
|
1953
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1954
|
-
#
|
1955
|
-
def list_next_async(next_page_link, custom_headers:nil)
|
1956
|
-
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1957
623
|
|
624
|
+
# Serialize Request
|
625
|
+
request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::RegenerateAccessKeyParameters.mapper()
|
626
|
+
request_content = @client.serialize(request_mapper, parameters)
|
627
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1958
628
|
|
1959
|
-
|
1960
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1961
|
-
|
1962
|
-
# Set Headers
|
1963
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1964
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1965
|
-
path_template = '{nextLink}'
|
629
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys'
|
1966
630
|
|
1967
631
|
request_url = @base_url || @client.base_url
|
1968
632
|
|
1969
633
|
options = {
|
1970
634
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1971
|
-
|
635
|
+
path_params: {'resourceGroupName' => resource_group_name,'namespaceName' => namespace_name,'authorizationRuleName' => authorization_rule_name,'subscriptionId' => @client.subscription_id},
|
636
|
+
query_params: {'api-version' => @client.api_version},
|
637
|
+
body: request_content,
|
1972
638
|
headers: request_headers.merge(custom_headers || {}),
|
1973
639
|
base_url: request_url
|
1974
640
|
}
|
1975
|
-
promise = @client.make_request_async(:
|
641
|
+
promise = @client.make_request_async(:post, path_template, options)
|
1976
642
|
|
1977
643
|
promise = promise.then do |result|
|
1978
644
|
http_response = result.response
|
@@ -1990,7 +656,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
1990
656
|
if status_code == 200
|
1991
657
|
begin
|
1992
658
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1993
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::
|
659
|
+
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::AccessKeys.mapper()
|
1994
660
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
1995
661
|
rescue Exception => e
|
1996
662
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -2004,46 +670,48 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
2004
670
|
end
|
2005
671
|
|
2006
672
|
#
|
2007
|
-
#
|
673
|
+
# Check the give Namespace name availability.
|
2008
674
|
#
|
2009
|
-
# @param
|
2010
|
-
#
|
675
|
+
# @param parameters [CheckNameAvailabilityParameter] Parameters to check
|
676
|
+
# availability of the given Namespace name
|
2011
677
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
2012
678
|
# will be added to the HTTP request.
|
2013
679
|
#
|
2014
|
-
# @return [
|
680
|
+
# @return [CheckNameAvailabilityResult] operation results.
|
2015
681
|
#
|
2016
|
-
def
|
2017
|
-
response =
|
682
|
+
def check_name_availability(parameters, custom_headers:nil)
|
683
|
+
response = check_name_availability_async(parameters, custom_headers:custom_headers).value!
|
2018
684
|
response.body unless response.nil?
|
2019
685
|
end
|
2020
686
|
|
2021
687
|
#
|
2022
|
-
#
|
688
|
+
# Check the give Namespace name availability.
|
2023
689
|
#
|
2024
|
-
# @param
|
2025
|
-
#
|
690
|
+
# @param parameters [CheckNameAvailabilityParameter] Parameters to check
|
691
|
+
# availability of the given Namespace name
|
2026
692
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
2027
693
|
# will be added to the HTTP request.
|
2028
694
|
#
|
2029
695
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
2030
696
|
#
|
2031
|
-
def
|
2032
|
-
|
697
|
+
def check_name_availability_with_http_info(parameters, custom_headers:nil)
|
698
|
+
check_name_availability_async(parameters, custom_headers:custom_headers).value!
|
2033
699
|
end
|
2034
700
|
|
2035
701
|
#
|
2036
|
-
#
|
702
|
+
# Check the give Namespace name availability.
|
2037
703
|
#
|
2038
|
-
# @param
|
2039
|
-
#
|
704
|
+
# @param parameters [CheckNameAvailabilityParameter] Parameters to check
|
705
|
+
# availability of the given Namespace name
|
2040
706
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
2041
707
|
# to the HTTP request.
|
2042
708
|
#
|
2043
709
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
2044
710
|
#
|
2045
|
-
def
|
2046
|
-
fail ArgumentError, '
|
711
|
+
def check_name_availability_async(parameters, custom_headers:nil)
|
712
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
713
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
714
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
2047
715
|
|
2048
716
|
|
2049
717
|
request_headers = {}
|
@@ -2052,17 +720,25 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
2052
720
|
# Set Headers
|
2053
721
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
2054
722
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
2055
|
-
|
723
|
+
|
724
|
+
# Serialize Request
|
725
|
+
request_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::CheckNameAvailabilityParameter.mapper()
|
726
|
+
request_content = @client.serialize(request_mapper, parameters)
|
727
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
728
|
+
|
729
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.EventHub/checkNameAvailability'
|
2056
730
|
|
2057
731
|
request_url = @base_url || @client.base_url
|
2058
732
|
|
2059
733
|
options = {
|
2060
734
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
2061
|
-
|
735
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
736
|
+
query_params: {'api-version' => @client.api_version},
|
737
|
+
body: request_content,
|
2062
738
|
headers: request_headers.merge(custom_headers || {}),
|
2063
739
|
base_url: request_url
|
2064
740
|
}
|
2065
|
-
promise = @client.make_request_async(:
|
741
|
+
promise = @client.make_request_async(:post, path_template, options)
|
2066
742
|
|
2067
743
|
promise = promise.then do |result|
|
2068
744
|
http_response = result.response
|
@@ -2080,7 +756,7 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
2080
756
|
if status_code == 200
|
2081
757
|
begin
|
2082
758
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
2083
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::
|
759
|
+
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::CheckNameAvailabilityResult.mapper()
|
2084
760
|
result.body = @client.deserialize(result_mapper, parsed_response)
|
2085
761
|
rescue Exception => e
|
2086
762
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -2183,139 +859,6 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
2183
859
|
promise.execute
|
2184
860
|
end
|
2185
861
|
|
2186
|
-
#
|
2187
|
-
# Gets list of NetworkRuleSet for a Namespace.
|
2188
|
-
#
|
2189
|
-
# @param next_page_link [String] The NextLink from the previous successful call
|
2190
|
-
# to List operation.
|
2191
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
2192
|
-
# will be added to the HTTP request.
|
2193
|
-
#
|
2194
|
-
# @return [NetworkRuleSetListResult] operation results.
|
2195
|
-
#
|
2196
|
-
def list_network_rule_sets_next(next_page_link, custom_headers:nil)
|
2197
|
-
response = list_network_rule_sets_next_async(next_page_link, custom_headers:custom_headers).value!
|
2198
|
-
response.body unless response.nil?
|
2199
|
-
end
|
2200
|
-
|
2201
|
-
#
|
2202
|
-
# Gets list of NetworkRuleSet for a Namespace.
|
2203
|
-
#
|
2204
|
-
# @param next_page_link [String] The NextLink from the previous successful call
|
2205
|
-
# to List operation.
|
2206
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
2207
|
-
# will be added to the HTTP request.
|
2208
|
-
#
|
2209
|
-
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
2210
|
-
#
|
2211
|
-
def list_network_rule_sets_next_with_http_info(next_page_link, custom_headers:nil)
|
2212
|
-
list_network_rule_sets_next_async(next_page_link, custom_headers:custom_headers).value!
|
2213
|
-
end
|
2214
|
-
|
2215
|
-
#
|
2216
|
-
# Gets list of NetworkRuleSet for a Namespace.
|
2217
|
-
#
|
2218
|
-
# @param next_page_link [String] The NextLink from the previous successful call
|
2219
|
-
# to List operation.
|
2220
|
-
# @param [Hash{String => String}] A hash of custom headers that will be added
|
2221
|
-
# to the HTTP request.
|
2222
|
-
#
|
2223
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
2224
|
-
#
|
2225
|
-
def list_network_rule_sets_next_async(next_page_link, custom_headers:nil)
|
2226
|
-
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
2227
|
-
|
2228
|
-
|
2229
|
-
request_headers = {}
|
2230
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
2231
|
-
|
2232
|
-
# Set Headers
|
2233
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
2234
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
2235
|
-
path_template = '{nextLink}'
|
2236
|
-
|
2237
|
-
request_url = @base_url || @client.base_url
|
2238
|
-
|
2239
|
-
options = {
|
2240
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
2241
|
-
skip_encoding_path_params: {'nextLink' => next_page_link},
|
2242
|
-
headers: request_headers.merge(custom_headers || {}),
|
2243
|
-
base_url: request_url
|
2244
|
-
}
|
2245
|
-
promise = @client.make_request_async(:get, path_template, options)
|
2246
|
-
|
2247
|
-
promise = promise.then do |result|
|
2248
|
-
http_response = result.response
|
2249
|
-
status_code = http_response.status
|
2250
|
-
response_content = http_response.body
|
2251
|
-
unless status_code == 200
|
2252
|
-
error_model = JSON.load(response_content)
|
2253
|
-
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
2254
|
-
end
|
2255
|
-
|
2256
|
-
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
2257
|
-
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
2258
|
-
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
2259
|
-
# Deserialize Response
|
2260
|
-
if status_code == 200
|
2261
|
-
begin
|
2262
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
2263
|
-
result_mapper = Azure::EventHub::Mgmt::V2017_04_01::Models::NetworkRuleSetListResult.mapper()
|
2264
|
-
result.body = @client.deserialize(result_mapper, parsed_response)
|
2265
|
-
rescue Exception => e
|
2266
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
2267
|
-
end
|
2268
|
-
end
|
2269
|
-
|
2270
|
-
result
|
2271
|
-
end
|
2272
|
-
|
2273
|
-
promise.execute
|
2274
|
-
end
|
2275
|
-
|
2276
|
-
#
|
2277
|
-
# Lists all the available Namespaces within a subscription, irrespective of the
|
2278
|
-
# resource groups.
|
2279
|
-
#
|
2280
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
2281
|
-
# will be added to the HTTP request.
|
2282
|
-
#
|
2283
|
-
# @return [EHNamespaceListResult] which provide lazy access to pages of the
|
2284
|
-
# response.
|
2285
|
-
#
|
2286
|
-
def list_as_lazy(custom_headers:nil)
|
2287
|
-
response = list_async(custom_headers:custom_headers).value!
|
2288
|
-
unless response.nil?
|
2289
|
-
page = response.body
|
2290
|
-
page.next_method = Proc.new do |next_page_link|
|
2291
|
-
list_next_async(next_page_link, custom_headers:custom_headers)
|
2292
|
-
end
|
2293
|
-
page
|
2294
|
-
end
|
2295
|
-
end
|
2296
|
-
|
2297
|
-
#
|
2298
|
-
# Lists the available Namespaces within a resource group.
|
2299
|
-
#
|
2300
|
-
# @param resource_group_name [String] Name of the resource group within the
|
2301
|
-
# azure subscription.
|
2302
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
2303
|
-
# will be added to the HTTP request.
|
2304
|
-
#
|
2305
|
-
# @return [EHNamespaceListResult] which provide lazy access to pages of the
|
2306
|
-
# response.
|
2307
|
-
#
|
2308
|
-
def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
|
2309
|
-
response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
|
2310
|
-
unless response.nil?
|
2311
|
-
page = response.body
|
2312
|
-
page.next_method = Proc.new do |next_page_link|
|
2313
|
-
list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
|
2314
|
-
end
|
2315
|
-
page
|
2316
|
-
end
|
2317
|
-
end
|
2318
|
-
|
2319
862
|
#
|
2320
863
|
# Gets a list of authorization rules for a Namespace.
|
2321
864
|
#
|
@@ -2339,28 +882,5 @@ module Azure::EventHub::Mgmt::V2017_04_01
|
|
2339
882
|
end
|
2340
883
|
end
|
2341
884
|
|
2342
|
-
#
|
2343
|
-
# Gets list of NetworkRuleSet for a Namespace.
|
2344
|
-
#
|
2345
|
-
# @param resource_group_name [String] Name of the resource group within the
|
2346
|
-
# azure subscription.
|
2347
|
-
# @param namespace_name [String] The Namespace name
|
2348
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
2349
|
-
# will be added to the HTTP request.
|
2350
|
-
#
|
2351
|
-
# @return [NetworkRuleSetListResult] which provide lazy access to pages of the
|
2352
|
-
# response.
|
2353
|
-
#
|
2354
|
-
def list_network_rule_sets_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
|
2355
|
-
response = list_network_rule_sets_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
|
2356
|
-
unless response.nil?
|
2357
|
-
page = response.body
|
2358
|
-
page.next_method = Proc.new do |next_page_link|
|
2359
|
-
list_network_rule_sets_next_async(next_page_link, custom_headers:custom_headers)
|
2360
|
-
end
|
2361
|
-
page
|
2362
|
-
end
|
2363
|
-
end
|
2364
|
-
|
2365
885
|
end
|
2366
886
|
end
|