azure_mgmt_network 0.19.0 → 0.19.1
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/2015-05-01-preview/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2015-06-15/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2016-03-30/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2016-06-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2016-12-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2017-03-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2017-03-30/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2017-09-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2017-10-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2017-11-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2018-01-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2018-02-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2018-04-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2018-06-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2018-07-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
- data/lib/2018-07-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2018-08-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
- data/lib/2018-08-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2018-10-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
- data/lib/2018-10-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2018-11-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
- data/lib/2018-11-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2018-12-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
- data/lib/2018-12-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2019-02-01/generated/azure_mgmt_network.rb +93 -93
- data/lib/2019-02-01/generated/azure_mgmt_network/models/application_gateway_on_demand_probe.rb +14 -12
- data/lib/2019-02-01/generated/azure_mgmt_network/models/public_ipprefix.rb +16 -2
- data/lib/2019-02-01/generated/azure_mgmt_network/models/public_ipprefix_sku.rb +1 -1
- data/lib/2019-02-01/generated/azure_mgmt_network/models/referenced_public_ip_address.rb +1 -1
- data/lib/2019-02-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2019-04-01/generated/azure_mgmt_network.rb +120 -120
- data/lib/2019-04-01/generated/azure_mgmt_network/models/application_gateway_on_demand_probe.rb +14 -12
- data/lib/2019-04-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
- data/lib/2019-04-01/generated/azure_mgmt_network/network_management_client.rb +1 -1
- data/lib/2019-04-01/generated/azure_mgmt_network/service_tags.rb +12 -3
- data/lib/2019-06-01/generated/azure_mgmt_network.rb +202 -180
- data/lib/2019-06-01/generated/azure_mgmt_network/firewall_policies.rb +918 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/firewall_policy_rule_groups.rb +626 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/application_gateway_on_demand_probe.rb +14 -12
- data/lib/2019-06-01/generated/azure_mgmt_network/models/application_rule_condition.rb +164 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/azure_firewall.rb +38 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/azure_firewall_public_ipaddress.rb +46 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy.rb +201 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_filter_rule.rb +106 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_filter_rule_action.rb +47 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_filter_rule_action_type.rb +17 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_list_result.rb +99 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_nat_rule.rb +120 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_nat_rule_action.rb +47 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_nat_rule_action_type.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule.rb +73 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_condition.rb +69 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_condition_application_protocol.rb +64 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_condition_application_protocol_type.rb +16 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_condition_network_protocol.rb +18 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_group.rb +129 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/firewall_policy_rule_group_list_result.rb +99 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/hub_ipaddresses.rb +67 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/network_rule_condition.rb +144 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/private_endpoint.rb +5 -5
- data/lib/2019-06-01/generated/azure_mgmt_network/models/private_endpoint_connection.rb +38 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/private_link_service.rb +5 -5
- data/lib/2019-06-01/generated/azure_mgmt_network/models/private_link_service_connection.rb +38 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/private_link_service_ip_configuration.rb +42 -9
- data/lib/2019-06-01/generated/azure_mgmt_network/models/public_ipprefix.rb +14 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/models/unprepare_network_policies_request.rb +47 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/network_management_client.rb +19 -11
- data/lib/2019-06-01/generated/azure_mgmt_network/service_tags.rb +12 -3
- data/lib/2019-06-01/generated/azure_mgmt_network/subnets.rb +150 -0
- data/lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateway_connections.rb +1 -1
- data/lib/2019-06-01/generated/azure_mgmt_network/virtual_network_gateways.rb +1 -1
- data/lib/profiles/latest/modules/network_profile_module.rb +638 -554
- data/lib/version.rb +1 -1
- metadata +24 -2
|
@@ -0,0 +1,918 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
|
4
|
+
# regenerated.
|
|
5
|
+
|
|
6
|
+
module Azure::Network::Mgmt::V2019_06_01
|
|
7
|
+
#
|
|
8
|
+
# FirewallPolicies
|
|
9
|
+
#
|
|
10
|
+
class FirewallPolicies
|
|
11
|
+
include MsRestAzure
|
|
12
|
+
|
|
13
|
+
#
|
|
14
|
+
# Creates and initializes a new instance of the FirewallPolicies class.
|
|
15
|
+
# @param client service class for accessing basic functionality.
|
|
16
|
+
#
|
|
17
|
+
def initialize(client)
|
|
18
|
+
@client = client
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# @return [NetworkManagementClient] reference to the NetworkManagementClient
|
|
22
|
+
attr_reader :client
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# Deletes the specified Firewall Policy.
|
|
26
|
+
#
|
|
27
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
28
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
29
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
30
|
+
# will be added to the HTTP request.
|
|
31
|
+
#
|
|
32
|
+
def delete(resource_group_name, firewall_policy_name, custom_headers:nil)
|
|
33
|
+
response = delete_async(resource_group_name, firewall_policy_name, custom_headers:custom_headers).value!
|
|
34
|
+
nil
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
#
|
|
38
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
39
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
40
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
41
|
+
# will be added to the HTTP request.
|
|
42
|
+
#
|
|
43
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
44
|
+
# response.
|
|
45
|
+
#
|
|
46
|
+
def delete_async(resource_group_name, firewall_policy_name, custom_headers:nil)
|
|
47
|
+
# Send request
|
|
48
|
+
promise = begin_delete_async(resource_group_name, firewall_policy_name, custom_headers:custom_headers)
|
|
49
|
+
|
|
50
|
+
promise = promise.then do |response|
|
|
51
|
+
# Defining deserialization method.
|
|
52
|
+
deserialize_method = lambda do |parsed_response|
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Waiting for response.
|
|
56
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
promise
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
#
|
|
63
|
+
# Gets the specified Firewall Policy.
|
|
64
|
+
#
|
|
65
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
66
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
67
|
+
# @param expand [String] Expands referenced resources.
|
|
68
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
69
|
+
# will be added to the HTTP request.
|
|
70
|
+
#
|
|
71
|
+
# @return [FirewallPolicy] operation results.
|
|
72
|
+
#
|
|
73
|
+
def get(resource_group_name, firewall_policy_name, expand:nil, custom_headers:nil)
|
|
74
|
+
response = get_async(resource_group_name, firewall_policy_name, expand:expand, custom_headers:custom_headers).value!
|
|
75
|
+
response.body unless response.nil?
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
#
|
|
79
|
+
# Gets the specified Firewall Policy.
|
|
80
|
+
#
|
|
81
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
82
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
83
|
+
# @param expand [String] Expands referenced resources.
|
|
84
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
85
|
+
# will be added to the HTTP request.
|
|
86
|
+
#
|
|
87
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
88
|
+
#
|
|
89
|
+
def get_with_http_info(resource_group_name, firewall_policy_name, expand:nil, custom_headers:nil)
|
|
90
|
+
get_async(resource_group_name, firewall_policy_name, expand:expand, custom_headers:custom_headers).value!
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
#
|
|
94
|
+
# Gets the specified Firewall Policy.
|
|
95
|
+
#
|
|
96
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
97
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
98
|
+
# @param expand [String] Expands referenced resources.
|
|
99
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
100
|
+
# to the HTTP request.
|
|
101
|
+
#
|
|
102
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
103
|
+
#
|
|
104
|
+
def get_async(resource_group_name, firewall_policy_name, expand:nil, custom_headers:nil)
|
|
105
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
106
|
+
fail ArgumentError, 'firewall_policy_name is nil' if firewall_policy_name.nil?
|
|
107
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
108
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
request_headers = {}
|
|
112
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
113
|
+
|
|
114
|
+
# Set Headers
|
|
115
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
116
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
117
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'
|
|
118
|
+
|
|
119
|
+
request_url = @base_url || @client.base_url
|
|
120
|
+
|
|
121
|
+
options = {
|
|
122
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
123
|
+
path_params: {'resourceGroupName' => resource_group_name,'firewallPolicyName' => firewall_policy_name,'subscriptionId' => @client.subscription_id},
|
|
124
|
+
query_params: {'api-version' => @client.api_version,'$expand' => expand},
|
|
125
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
126
|
+
base_url: request_url
|
|
127
|
+
}
|
|
128
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
129
|
+
|
|
130
|
+
promise = promise.then do |result|
|
|
131
|
+
http_response = result.response
|
|
132
|
+
status_code = http_response.status
|
|
133
|
+
response_content = http_response.body
|
|
134
|
+
unless status_code == 200
|
|
135
|
+
error_model = JSON.load(response_content)
|
|
136
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
140
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
141
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
142
|
+
# Deserialize Response
|
|
143
|
+
if status_code == 200
|
|
144
|
+
begin
|
|
145
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
146
|
+
result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicy.mapper()
|
|
147
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
148
|
+
rescue Exception => e
|
|
149
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
result
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
promise.execute
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
#
|
|
160
|
+
# Updates a Firewall Policy Tags.
|
|
161
|
+
#
|
|
162
|
+
# @param resource_group_name [String] The resource group name of the Firewall
|
|
163
|
+
# Policy.
|
|
164
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy being
|
|
165
|
+
# updated.
|
|
166
|
+
# @param firewall_policy_parameters [TagsObject] Parameters supplied to Update
|
|
167
|
+
# Firewall Policy tags.
|
|
168
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
169
|
+
# will be added to the HTTP request.
|
|
170
|
+
#
|
|
171
|
+
# @return [FirewallPolicy] operation results.
|
|
172
|
+
#
|
|
173
|
+
def update_tags(resource_group_name, firewall_policy_name, firewall_policy_parameters, custom_headers:nil)
|
|
174
|
+
response = update_tags_async(resource_group_name, firewall_policy_name, firewall_policy_parameters, custom_headers:custom_headers).value!
|
|
175
|
+
response.body unless response.nil?
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
#
|
|
179
|
+
# Updates a Firewall Policy Tags.
|
|
180
|
+
#
|
|
181
|
+
# @param resource_group_name [String] The resource group name of the Firewall
|
|
182
|
+
# Policy.
|
|
183
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy being
|
|
184
|
+
# updated.
|
|
185
|
+
# @param firewall_policy_parameters [TagsObject] Parameters supplied to Update
|
|
186
|
+
# Firewall Policy tags.
|
|
187
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
188
|
+
# will be added to the HTTP request.
|
|
189
|
+
#
|
|
190
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
191
|
+
#
|
|
192
|
+
def update_tags_with_http_info(resource_group_name, firewall_policy_name, firewall_policy_parameters, custom_headers:nil)
|
|
193
|
+
update_tags_async(resource_group_name, firewall_policy_name, firewall_policy_parameters, custom_headers:custom_headers).value!
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
#
|
|
197
|
+
# Updates a Firewall Policy Tags.
|
|
198
|
+
#
|
|
199
|
+
# @param resource_group_name [String] The resource group name of the Firewall
|
|
200
|
+
# Policy.
|
|
201
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy being
|
|
202
|
+
# updated.
|
|
203
|
+
# @param firewall_policy_parameters [TagsObject] Parameters supplied to Update
|
|
204
|
+
# Firewall Policy tags.
|
|
205
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
206
|
+
# to the HTTP request.
|
|
207
|
+
#
|
|
208
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
209
|
+
#
|
|
210
|
+
def update_tags_async(resource_group_name, firewall_policy_name, firewall_policy_parameters, custom_headers:nil)
|
|
211
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
212
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
213
|
+
fail ArgumentError, 'firewall_policy_name is nil' if firewall_policy_name.nil?
|
|
214
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
215
|
+
fail ArgumentError, 'firewall_policy_parameters is nil' if firewall_policy_parameters.nil?
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
request_headers = {}
|
|
219
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
220
|
+
|
|
221
|
+
# Set Headers
|
|
222
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
223
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
224
|
+
|
|
225
|
+
# Serialize Request
|
|
226
|
+
request_mapper = Azure::Network::Mgmt::V2019_06_01::Models::TagsObject.mapper()
|
|
227
|
+
request_content = @client.serialize(request_mapper, firewall_policy_parameters)
|
|
228
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
229
|
+
|
|
230
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'
|
|
231
|
+
|
|
232
|
+
request_url = @base_url || @client.base_url
|
|
233
|
+
|
|
234
|
+
options = {
|
|
235
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
236
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'firewallPolicyName' => firewall_policy_name},
|
|
237
|
+
query_params: {'api-version' => @client.api_version},
|
|
238
|
+
body: request_content,
|
|
239
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
240
|
+
base_url: request_url
|
|
241
|
+
}
|
|
242
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
|
243
|
+
|
|
244
|
+
promise = promise.then do |result|
|
|
245
|
+
http_response = result.response
|
|
246
|
+
status_code = http_response.status
|
|
247
|
+
response_content = http_response.body
|
|
248
|
+
unless status_code == 200
|
|
249
|
+
error_model = JSON.load(response_content)
|
|
250
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
254
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
255
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
256
|
+
# Deserialize Response
|
|
257
|
+
if status_code == 200
|
|
258
|
+
begin
|
|
259
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
260
|
+
result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicy.mapper()
|
|
261
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
262
|
+
rescue Exception => e
|
|
263
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
result
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
promise.execute
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
#
|
|
274
|
+
# Creates or updates the specified Firewall Policy.
|
|
275
|
+
#
|
|
276
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
277
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
278
|
+
# @param parameters [FirewallPolicy] Parameters supplied to the create or
|
|
279
|
+
# update Firewall Policy operation.
|
|
280
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
281
|
+
# will be added to the HTTP request.
|
|
282
|
+
#
|
|
283
|
+
# @return [FirewallPolicy] operation results.
|
|
284
|
+
#
|
|
285
|
+
def create_or_update(resource_group_name, firewall_policy_name, parameters, custom_headers:nil)
|
|
286
|
+
response = create_or_update_async(resource_group_name, firewall_policy_name, parameters, custom_headers:custom_headers).value!
|
|
287
|
+
response.body unless response.nil?
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
#
|
|
291
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
292
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
293
|
+
# @param parameters [FirewallPolicy] Parameters supplied to the create or
|
|
294
|
+
# update Firewall Policy operation.
|
|
295
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
296
|
+
# will be added to the HTTP request.
|
|
297
|
+
#
|
|
298
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
299
|
+
# response.
|
|
300
|
+
#
|
|
301
|
+
def create_or_update_async(resource_group_name, firewall_policy_name, parameters, custom_headers:nil)
|
|
302
|
+
# Send request
|
|
303
|
+
promise = begin_create_or_update_async(resource_group_name, firewall_policy_name, parameters, custom_headers:custom_headers)
|
|
304
|
+
|
|
305
|
+
promise = promise.then do |response|
|
|
306
|
+
# Defining deserialization method.
|
|
307
|
+
deserialize_method = lambda do |parsed_response|
|
|
308
|
+
result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicy.mapper()
|
|
309
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Waiting for response.
|
|
313
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
promise
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
#
|
|
320
|
+
# Lists all Firewall Policies in a resource group.
|
|
321
|
+
#
|
|
322
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
323
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
324
|
+
# will be added to the HTTP request.
|
|
325
|
+
#
|
|
326
|
+
# @return [Array<FirewallPolicy>] operation results.
|
|
327
|
+
#
|
|
328
|
+
def list(resource_group_name, custom_headers:nil)
|
|
329
|
+
first_page = list_as_lazy(resource_group_name, custom_headers:custom_headers)
|
|
330
|
+
first_page.get_all_items
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
#
|
|
334
|
+
# Lists all Firewall Policies in a resource group.
|
|
335
|
+
#
|
|
336
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
337
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
338
|
+
# will be added to the HTTP request.
|
|
339
|
+
#
|
|
340
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
341
|
+
#
|
|
342
|
+
def list_with_http_info(resource_group_name, custom_headers:nil)
|
|
343
|
+
list_async(resource_group_name, custom_headers:custom_headers).value!
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
#
|
|
347
|
+
# Lists all Firewall Policies in a resource group.
|
|
348
|
+
#
|
|
349
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
350
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
351
|
+
# to the HTTP request.
|
|
352
|
+
#
|
|
353
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
354
|
+
#
|
|
355
|
+
def list_async(resource_group_name, custom_headers:nil)
|
|
356
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
357
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
358
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
request_headers = {}
|
|
362
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
363
|
+
|
|
364
|
+
# Set Headers
|
|
365
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
366
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
367
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies'
|
|
368
|
+
|
|
369
|
+
request_url = @base_url || @client.base_url
|
|
370
|
+
|
|
371
|
+
options = {
|
|
372
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
373
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
|
374
|
+
query_params: {'api-version' => @client.api_version},
|
|
375
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
376
|
+
base_url: request_url
|
|
377
|
+
}
|
|
378
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
379
|
+
|
|
380
|
+
promise = promise.then do |result|
|
|
381
|
+
http_response = result.response
|
|
382
|
+
status_code = http_response.status
|
|
383
|
+
response_content = http_response.body
|
|
384
|
+
unless status_code == 200
|
|
385
|
+
error_model = JSON.load(response_content)
|
|
386
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
390
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
391
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
392
|
+
# Deserialize Response
|
|
393
|
+
if status_code == 200
|
|
394
|
+
begin
|
|
395
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
396
|
+
result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyListResult.mapper()
|
|
397
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
398
|
+
rescue Exception => e
|
|
399
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
400
|
+
end
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
result
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
promise.execute
|
|
407
|
+
end
|
|
408
|
+
|
|
409
|
+
#
|
|
410
|
+
# Gets all the Firewall Policies in a subscription.
|
|
411
|
+
#
|
|
412
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
413
|
+
# will be added to the HTTP request.
|
|
414
|
+
#
|
|
415
|
+
# @return [Array<FirewallPolicy>] operation results.
|
|
416
|
+
#
|
|
417
|
+
def list_all(custom_headers:nil)
|
|
418
|
+
first_page = list_all_as_lazy(custom_headers:custom_headers)
|
|
419
|
+
first_page.get_all_items
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
#
|
|
423
|
+
# Gets all the Firewall Policies in a subscription.
|
|
424
|
+
#
|
|
425
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
426
|
+
# will be added to the HTTP request.
|
|
427
|
+
#
|
|
428
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
429
|
+
#
|
|
430
|
+
def list_all_with_http_info(custom_headers:nil)
|
|
431
|
+
list_all_async(custom_headers:custom_headers).value!
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
#
|
|
435
|
+
# Gets all the Firewall Policies in a subscription.
|
|
436
|
+
#
|
|
437
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
438
|
+
# to the HTTP request.
|
|
439
|
+
#
|
|
440
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
441
|
+
#
|
|
442
|
+
def list_all_async(custom_headers:nil)
|
|
443
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
444
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
request_headers = {}
|
|
448
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
449
|
+
|
|
450
|
+
# Set Headers
|
|
451
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
452
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
453
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Network/firewallPolicies'
|
|
454
|
+
|
|
455
|
+
request_url = @base_url || @client.base_url
|
|
456
|
+
|
|
457
|
+
options = {
|
|
458
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
459
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
|
460
|
+
query_params: {'api-version' => @client.api_version},
|
|
461
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
462
|
+
base_url: request_url
|
|
463
|
+
}
|
|
464
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
465
|
+
|
|
466
|
+
promise = promise.then do |result|
|
|
467
|
+
http_response = result.response
|
|
468
|
+
status_code = http_response.status
|
|
469
|
+
response_content = http_response.body
|
|
470
|
+
unless status_code == 200
|
|
471
|
+
error_model = JSON.load(response_content)
|
|
472
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
473
|
+
end
|
|
474
|
+
|
|
475
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
476
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
477
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
478
|
+
# Deserialize Response
|
|
479
|
+
if status_code == 200
|
|
480
|
+
begin
|
|
481
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
482
|
+
result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyListResult.mapper()
|
|
483
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
484
|
+
rescue Exception => e
|
|
485
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
486
|
+
end
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
result
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
promise.execute
|
|
493
|
+
end
|
|
494
|
+
|
|
495
|
+
#
|
|
496
|
+
# Deletes the specified Firewall Policy.
|
|
497
|
+
#
|
|
498
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
499
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
500
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
501
|
+
# will be added to the HTTP request.
|
|
502
|
+
#
|
|
503
|
+
#
|
|
504
|
+
def begin_delete(resource_group_name, firewall_policy_name, custom_headers:nil)
|
|
505
|
+
response = begin_delete_async(resource_group_name, firewall_policy_name, custom_headers:custom_headers).value!
|
|
506
|
+
nil
|
|
507
|
+
end
|
|
508
|
+
|
|
509
|
+
#
|
|
510
|
+
# Deletes the specified Firewall Policy.
|
|
511
|
+
#
|
|
512
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
513
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
514
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
515
|
+
# will be added to the HTTP request.
|
|
516
|
+
#
|
|
517
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
518
|
+
#
|
|
519
|
+
def begin_delete_with_http_info(resource_group_name, firewall_policy_name, custom_headers:nil)
|
|
520
|
+
begin_delete_async(resource_group_name, firewall_policy_name, custom_headers:custom_headers).value!
|
|
521
|
+
end
|
|
522
|
+
|
|
523
|
+
#
|
|
524
|
+
# Deletes the specified Firewall Policy.
|
|
525
|
+
#
|
|
526
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
527
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
528
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
529
|
+
# to the HTTP request.
|
|
530
|
+
#
|
|
531
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
532
|
+
#
|
|
533
|
+
def begin_delete_async(resource_group_name, firewall_policy_name, custom_headers:nil)
|
|
534
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
535
|
+
fail ArgumentError, 'firewall_policy_name is nil' if firewall_policy_name.nil?
|
|
536
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
537
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
request_headers = {}
|
|
541
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
542
|
+
|
|
543
|
+
# Set Headers
|
|
544
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
545
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
546
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'
|
|
547
|
+
|
|
548
|
+
request_url = @base_url || @client.base_url
|
|
549
|
+
|
|
550
|
+
options = {
|
|
551
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
552
|
+
path_params: {'resourceGroupName' => resource_group_name,'firewallPolicyName' => firewall_policy_name,'subscriptionId' => @client.subscription_id},
|
|
553
|
+
query_params: {'api-version' => @client.api_version},
|
|
554
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
555
|
+
base_url: request_url
|
|
556
|
+
}
|
|
557
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
|
558
|
+
|
|
559
|
+
promise = promise.then do |result|
|
|
560
|
+
http_response = result.response
|
|
561
|
+
status_code = http_response.status
|
|
562
|
+
response_content = http_response.body
|
|
563
|
+
unless status_code == 202 || status_code == 204 || status_code == 200
|
|
564
|
+
error_model = JSON.load(response_content)
|
|
565
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
566
|
+
end
|
|
567
|
+
|
|
568
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
569
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
570
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
571
|
+
|
|
572
|
+
result
|
|
573
|
+
end
|
|
574
|
+
|
|
575
|
+
promise.execute
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
#
|
|
579
|
+
# Creates or updates the specified Firewall Policy.
|
|
580
|
+
#
|
|
581
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
582
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
583
|
+
# @param parameters [FirewallPolicy] Parameters supplied to the create or
|
|
584
|
+
# update Firewall Policy operation.
|
|
585
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
586
|
+
# will be added to the HTTP request.
|
|
587
|
+
#
|
|
588
|
+
# @return [FirewallPolicy] operation results.
|
|
589
|
+
#
|
|
590
|
+
def begin_create_or_update(resource_group_name, firewall_policy_name, parameters, custom_headers:nil)
|
|
591
|
+
response = begin_create_or_update_async(resource_group_name, firewall_policy_name, parameters, custom_headers:custom_headers).value!
|
|
592
|
+
response.body unless response.nil?
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
#
|
|
596
|
+
# Creates or updates the specified Firewall Policy.
|
|
597
|
+
#
|
|
598
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
599
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
600
|
+
# @param parameters [FirewallPolicy] Parameters supplied to the create or
|
|
601
|
+
# update Firewall Policy operation.
|
|
602
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
603
|
+
# will be added to the HTTP request.
|
|
604
|
+
#
|
|
605
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
606
|
+
#
|
|
607
|
+
def begin_create_or_update_with_http_info(resource_group_name, firewall_policy_name, parameters, custom_headers:nil)
|
|
608
|
+
begin_create_or_update_async(resource_group_name, firewall_policy_name, parameters, custom_headers:custom_headers).value!
|
|
609
|
+
end
|
|
610
|
+
|
|
611
|
+
#
|
|
612
|
+
# Creates or updates the specified Firewall Policy.
|
|
613
|
+
#
|
|
614
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
615
|
+
# @param firewall_policy_name [String] The name of the Firewall Policy.
|
|
616
|
+
# @param parameters [FirewallPolicy] Parameters supplied to the create or
|
|
617
|
+
# update Firewall Policy operation.
|
|
618
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
619
|
+
# to the HTTP request.
|
|
620
|
+
#
|
|
621
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
622
|
+
#
|
|
623
|
+
def begin_create_or_update_async(resource_group_name, firewall_policy_name, parameters, custom_headers:nil)
|
|
624
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
625
|
+
fail ArgumentError, 'firewall_policy_name is nil' if firewall_policy_name.nil?
|
|
626
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
627
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
628
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
request_headers = {}
|
|
632
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
633
|
+
|
|
634
|
+
# Set Headers
|
|
635
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
636
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
637
|
+
|
|
638
|
+
# Serialize Request
|
|
639
|
+
request_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicy.mapper()
|
|
640
|
+
request_content = @client.serialize(request_mapper, parameters)
|
|
641
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
642
|
+
|
|
643
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/firewallPolicies/{firewallPolicyName}'
|
|
644
|
+
|
|
645
|
+
request_url = @base_url || @client.base_url
|
|
646
|
+
|
|
647
|
+
options = {
|
|
648
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
649
|
+
path_params: {'resourceGroupName' => resource_group_name,'firewallPolicyName' => firewall_policy_name,'subscriptionId' => @client.subscription_id},
|
|
650
|
+
query_params: {'api-version' => @client.api_version},
|
|
651
|
+
body: request_content,
|
|
652
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
653
|
+
base_url: request_url
|
|
654
|
+
}
|
|
655
|
+
promise = @client.make_request_async(:put, path_template, options)
|
|
656
|
+
|
|
657
|
+
promise = promise.then do |result|
|
|
658
|
+
http_response = result.response
|
|
659
|
+
status_code = http_response.status
|
|
660
|
+
response_content = http_response.body
|
|
661
|
+
unless status_code == 201 || status_code == 200
|
|
662
|
+
error_model = JSON.load(response_content)
|
|
663
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
664
|
+
end
|
|
665
|
+
|
|
666
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
667
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
668
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
669
|
+
# Deserialize Response
|
|
670
|
+
if status_code == 201
|
|
671
|
+
begin
|
|
672
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
673
|
+
result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicy.mapper()
|
|
674
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
675
|
+
rescue Exception => e
|
|
676
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
677
|
+
end
|
|
678
|
+
end
|
|
679
|
+
# Deserialize Response
|
|
680
|
+
if status_code == 200
|
|
681
|
+
begin
|
|
682
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
683
|
+
result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicy.mapper()
|
|
684
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
685
|
+
rescue Exception => e
|
|
686
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
687
|
+
end
|
|
688
|
+
end
|
|
689
|
+
|
|
690
|
+
result
|
|
691
|
+
end
|
|
692
|
+
|
|
693
|
+
promise.execute
|
|
694
|
+
end
|
|
695
|
+
|
|
696
|
+
#
|
|
697
|
+
# Lists all Firewall Policies in a resource group.
|
|
698
|
+
#
|
|
699
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
700
|
+
# to List operation.
|
|
701
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
702
|
+
# will be added to the HTTP request.
|
|
703
|
+
#
|
|
704
|
+
# @return [FirewallPolicyListResult] operation results.
|
|
705
|
+
#
|
|
706
|
+
def list_next(next_page_link, custom_headers:nil)
|
|
707
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
708
|
+
response.body unless response.nil?
|
|
709
|
+
end
|
|
710
|
+
|
|
711
|
+
#
|
|
712
|
+
# Lists all Firewall Policies in a resource group.
|
|
713
|
+
#
|
|
714
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
715
|
+
# to List operation.
|
|
716
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
717
|
+
# will be added to the HTTP request.
|
|
718
|
+
#
|
|
719
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
720
|
+
#
|
|
721
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
|
722
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
723
|
+
end
|
|
724
|
+
|
|
725
|
+
#
|
|
726
|
+
# Lists all Firewall Policies in a resource group.
|
|
727
|
+
#
|
|
728
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
729
|
+
# to List operation.
|
|
730
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
731
|
+
# to the HTTP request.
|
|
732
|
+
#
|
|
733
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
734
|
+
#
|
|
735
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
|
736
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
request_headers = {}
|
|
740
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
741
|
+
|
|
742
|
+
# Set Headers
|
|
743
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
744
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
745
|
+
path_template = '{nextLink}'
|
|
746
|
+
|
|
747
|
+
request_url = @base_url || @client.base_url
|
|
748
|
+
|
|
749
|
+
options = {
|
|
750
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
751
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
752
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
753
|
+
base_url: request_url
|
|
754
|
+
}
|
|
755
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
756
|
+
|
|
757
|
+
promise = promise.then do |result|
|
|
758
|
+
http_response = result.response
|
|
759
|
+
status_code = http_response.status
|
|
760
|
+
response_content = http_response.body
|
|
761
|
+
unless status_code == 200
|
|
762
|
+
error_model = JSON.load(response_content)
|
|
763
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
764
|
+
end
|
|
765
|
+
|
|
766
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
767
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
768
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
769
|
+
# Deserialize Response
|
|
770
|
+
if status_code == 200
|
|
771
|
+
begin
|
|
772
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
773
|
+
result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyListResult.mapper()
|
|
774
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
775
|
+
rescue Exception => e
|
|
776
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
777
|
+
end
|
|
778
|
+
end
|
|
779
|
+
|
|
780
|
+
result
|
|
781
|
+
end
|
|
782
|
+
|
|
783
|
+
promise.execute
|
|
784
|
+
end
|
|
785
|
+
|
|
786
|
+
#
|
|
787
|
+
# Gets all the Firewall Policies in a subscription.
|
|
788
|
+
#
|
|
789
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
790
|
+
# to List operation.
|
|
791
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
792
|
+
# will be added to the HTTP request.
|
|
793
|
+
#
|
|
794
|
+
# @return [FirewallPolicyListResult] operation results.
|
|
795
|
+
#
|
|
796
|
+
def list_all_next(next_page_link, custom_headers:nil)
|
|
797
|
+
response = list_all_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
798
|
+
response.body unless response.nil?
|
|
799
|
+
end
|
|
800
|
+
|
|
801
|
+
#
|
|
802
|
+
# Gets all the Firewall Policies in a subscription.
|
|
803
|
+
#
|
|
804
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
805
|
+
# to List operation.
|
|
806
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
807
|
+
# will be added to the HTTP request.
|
|
808
|
+
#
|
|
809
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
810
|
+
#
|
|
811
|
+
def list_all_next_with_http_info(next_page_link, custom_headers:nil)
|
|
812
|
+
list_all_next_async(next_page_link, custom_headers:custom_headers).value!
|
|
813
|
+
end
|
|
814
|
+
|
|
815
|
+
#
|
|
816
|
+
# Gets all the Firewall Policies in a subscription.
|
|
817
|
+
#
|
|
818
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
819
|
+
# to List operation.
|
|
820
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
821
|
+
# to the HTTP request.
|
|
822
|
+
#
|
|
823
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
824
|
+
#
|
|
825
|
+
def list_all_next_async(next_page_link, custom_headers:nil)
|
|
826
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
request_headers = {}
|
|
830
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
831
|
+
|
|
832
|
+
# Set Headers
|
|
833
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
834
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
835
|
+
path_template = '{nextLink}'
|
|
836
|
+
|
|
837
|
+
request_url = @base_url || @client.base_url
|
|
838
|
+
|
|
839
|
+
options = {
|
|
840
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
841
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
842
|
+
headers: request_headers.merge(custom_headers || {}),
|
|
843
|
+
base_url: request_url
|
|
844
|
+
}
|
|
845
|
+
promise = @client.make_request_async(:get, path_template, options)
|
|
846
|
+
|
|
847
|
+
promise = promise.then do |result|
|
|
848
|
+
http_response = result.response
|
|
849
|
+
status_code = http_response.status
|
|
850
|
+
response_content = http_response.body
|
|
851
|
+
unless status_code == 200
|
|
852
|
+
error_model = JSON.load(response_content)
|
|
853
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
854
|
+
end
|
|
855
|
+
|
|
856
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
857
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
|
858
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
|
859
|
+
# Deserialize Response
|
|
860
|
+
if status_code == 200
|
|
861
|
+
begin
|
|
862
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
863
|
+
result_mapper = Azure::Network::Mgmt::V2019_06_01::Models::FirewallPolicyListResult.mapper()
|
|
864
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
|
865
|
+
rescue Exception => e
|
|
866
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
867
|
+
end
|
|
868
|
+
end
|
|
869
|
+
|
|
870
|
+
result
|
|
871
|
+
end
|
|
872
|
+
|
|
873
|
+
promise.execute
|
|
874
|
+
end
|
|
875
|
+
|
|
876
|
+
#
|
|
877
|
+
# Lists all Firewall Policies in a resource group.
|
|
878
|
+
#
|
|
879
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
880
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
881
|
+
# will be added to the HTTP request.
|
|
882
|
+
#
|
|
883
|
+
# @return [FirewallPolicyListResult] which provide lazy access to pages of the
|
|
884
|
+
# response.
|
|
885
|
+
#
|
|
886
|
+
def list_as_lazy(resource_group_name, custom_headers:nil)
|
|
887
|
+
response = list_async(resource_group_name, custom_headers:custom_headers).value!
|
|
888
|
+
unless response.nil?
|
|
889
|
+
page = response.body
|
|
890
|
+
page.next_method = Proc.new do |next_page_link|
|
|
891
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
|
892
|
+
end
|
|
893
|
+
page
|
|
894
|
+
end
|
|
895
|
+
end
|
|
896
|
+
|
|
897
|
+
#
|
|
898
|
+
# Gets all the Firewall Policies in a subscription.
|
|
899
|
+
#
|
|
900
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
901
|
+
# will be added to the HTTP request.
|
|
902
|
+
#
|
|
903
|
+
# @return [FirewallPolicyListResult] which provide lazy access to pages of the
|
|
904
|
+
# response.
|
|
905
|
+
#
|
|
906
|
+
def list_all_as_lazy(custom_headers:nil)
|
|
907
|
+
response = list_all_async(custom_headers:custom_headers).value!
|
|
908
|
+
unless response.nil?
|
|
909
|
+
page = response.body
|
|
910
|
+
page.next_method = Proc.new do |next_page_link|
|
|
911
|
+
list_all_next_async(next_page_link, custom_headers:custom_headers)
|
|
912
|
+
end
|
|
913
|
+
page
|
|
914
|
+
end
|
|
915
|
+
end
|
|
916
|
+
|
|
917
|
+
end
|
|
918
|
+
end
|