azure_mgmt_network 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/azure_mgmt_network.gemspec +4 -9
- data/lib/azure_mgmt_network.rb +100 -39
- data/lib/azure_mgmt_network/application_gateways.rb +175 -401
- data/lib/azure_mgmt_network/express_route_circuit_authorizations.rb +429 -0
- data/lib/azure_mgmt_network/express_route_circuit_peerings.rb +427 -0
- data/lib/azure_mgmt_network/express_route_circuits.rb +911 -0
- data/lib/azure_mgmt_network/express_route_service_providers.rb +149 -0
- data/lib/azure_mgmt_network/load_balancers.rb +139 -314
- data/lib/azure_mgmt_network/local_network_gateways.rb +102 -228
- data/lib/azure_mgmt_network/models/address_space.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway.rb +7 -9
- data/lib/azure_mgmt_network/models/application_gateway_backend_address.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway_backend_address_pool.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway_backend_address_pool_properties_format.rb +16 -18
- data/lib/azure_mgmt_network/models/application_gateway_backend_http_settings.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway_backend_http_settings_properties_format.rb +32 -8
- data/lib/azure_mgmt_network/models/application_gateway_cookie_based_affinity.rb +1 -1
- data/lib/azure_mgmt_network/models/{application_gateway_frontend_ip_configuration.rb → application_gateway_frontend_ipconfiguration.rb} +7 -9
- data/lib/azure_mgmt_network/models/{application_gateway_frontend_ip_configuration_properties_format.rb → application_gateway_frontend_ipconfiguration_properties_format.rb} +12 -15
- data/lib/azure_mgmt_network/models/application_gateway_frontend_port.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway_frontend_port_properties_format.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway_http_listener.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway_http_listener_properties_format.rb +34 -17
- data/lib/azure_mgmt_network/models/{application_gateway_ip_configuration.rb → application_gateway_ipconfiguration.rb} +7 -9
- data/lib/azure_mgmt_network/models/{application_gateway_ip_configuration_properties_format.rb → application_gateway_ipconfiguration_properties_format.rb} +6 -8
- data/lib/azure_mgmt_network/models/application_gateway_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/application_gateway_operational_state.rb +1 -1
- data/lib/azure_mgmt_network/models/application_gateway_path_rule.rb +88 -0
- data/lib/azure_mgmt_network/models/application_gateway_path_rule_properties_format.rb +101 -0
- data/lib/azure_mgmt_network/models/application_gateway_probe.rb +88 -0
- data/lib/azure_mgmt_network/models/application_gateway_probe_properties_format.rb +118 -0
- data/lib/azure_mgmt_network/models/application_gateway_properties_format.rb +151 -81
- data/lib/azure_mgmt_network/models/application_gateway_protocol.rb +1 -1
- data/lib/azure_mgmt_network/models/application_gateway_request_routing_rule.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway_request_routing_rule_properties_format.rb +26 -11
- data/lib/azure_mgmt_network/models/application_gateway_request_routing_rule_type.rb +2 -1
- data/lib/azure_mgmt_network/models/application_gateway_sku.rb +6 -8
- data/lib/azure_mgmt_network/models/application_gateway_sku_name.rb +1 -1
- data/lib/azure_mgmt_network/models/application_gateway_ssl_certificate.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway_ssl_certificate_properties_format.rb +1 -3
- data/lib/azure_mgmt_network/models/application_gateway_tier.rb +1 -1
- data/lib/azure_mgmt_network/models/application_gateway_url_path_map.rb +88 -0
- data/lib/azure_mgmt_network/models/application_gateway_url_path_map_properties_format.rb +122 -0
- data/lib/azure_mgmt_network/models/authorization_list_result.rb +87 -0
- data/lib/azure_mgmt_network/models/authorization_properties_format.rb +79 -0
- data/lib/azure_mgmt_network/models/authorization_use_status.rb +16 -0
- data/lib/azure_mgmt_network/models/azure_async_operation_result.rb +5 -7
- data/lib/azure_mgmt_network/models/backend_address_pool.rb +1 -3
- data/lib/azure_mgmt_network/models/backend_address_pool_properties_format.rb +30 -15
- data/lib/azure_mgmt_network/models/connection_reset_shared_key.rb +10 -16
- data/lib/azure_mgmt_network/models/connection_shared_key.rb +1 -3
- data/lib/azure_mgmt_network/models/{connection_reset_shared_key_properties_format.rb → connection_shared_key_result.rb} +11 -15
- data/lib/azure_mgmt_network/models/dhcp_options.rb +1 -3
- data/lib/azure_mgmt_network/models/dns_name_availability_result.rb +1 -3
- data/lib/azure_mgmt_network/models/error.rb +4 -6
- data/lib/azure_mgmt_network/models/error_details.rb +1 -3
- data/lib/azure_mgmt_network/models/express_route_circuit.rb +118 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_arp_table.rb +65 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_authorization.rb +88 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_list_result.rb +86 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_peering.rb +88 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_peering_advertised_public_prefix_state.rb +18 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_peering_config.rb +92 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_peering_list_result.rb +87 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_peering_properties_format.rb +194 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_peering_state.rb +16 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_peering_type.rb +17 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_properties_format.rb +179 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_routes_table.rb +89 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_service_provider_properties.rb +76 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_sku.rb +83 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_sku_family.rb +16 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_sku_tier.rb +16 -0
- data/lib/azure_mgmt_network/models/express_route_circuit_stats.rb +67 -0
- data/lib/azure_mgmt_network/models/express_route_circuits_arp_table_list_result.rb +85 -0
- data/lib/azure_mgmt_network/models/express_route_circuits_routes_table_list_result.rb +88 -0
- data/lib/azure_mgmt_network/models/express_route_circuits_stats_list_result.rb +85 -0
- data/lib/azure_mgmt_network/models/express_route_service_provider.rb +92 -0
- data/lib/azure_mgmt_network/models/express_route_service_provider_bandwidths_offered.rb +67 -0
- data/lib/azure_mgmt_network/models/express_route_service_provider_list_result.rb +86 -0
- data/lib/azure_mgmt_network/models/express_route_service_provider_properties_format.rb +97 -0
- data/lib/azure_mgmt_network/models/{frontend_ip_configuration.rb → frontend_ipconfiguration.rb} +7 -9
- data/lib/azure_mgmt_network/models/{frontend_ip_configuration_properties_format.rb → frontend_ipconfiguration_properties_format.rb} +133 -77
- data/lib/azure_mgmt_network/models/inbound_nat_pool.rb +88 -0
- data/lib/azure_mgmt_network/models/inbound_nat_pool_properties_format.rb +134 -0
- data/lib/azure_mgmt_network/models/inbound_nat_rule.rb +1 -3
- data/lib/azure_mgmt_network/models/inbound_nat_rule_properties_format.rb +11 -12
- data/lib/azure_mgmt_network/models/{ip_allocation_method.rb → ipallocation_method.rb} +3 -3
- data/lib/azure_mgmt_network/models/ipconfiguration.rb +88 -0
- data/lib/azure_mgmt_network/models/ipconfiguration_properties_format.rb +113 -0
- data/lib/azure_mgmt_network/models/load_balancer.rb +7 -9
- data/lib/azure_mgmt_network/models/load_balancer_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/load_balancer_properties_format.rb +103 -35
- data/lib/azure_mgmt_network/models/load_balancing_rule.rb +1 -3
- data/lib/azure_mgmt_network/models/load_balancing_rule_properties_format.rb +30 -30
- data/lib/azure_mgmt_network/models/load_distribution.rb +1 -1
- data/lib/azure_mgmt_network/models/local_network_gateway.rb +7 -9
- data/lib/azure_mgmt_network/models/local_network_gateway_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/local_network_gateway_properties_format.rb +11 -3
- data/lib/azure_mgmt_network/models/network_interface.rb +7 -9
- data/lib/azure_mgmt_network/models/network_interface_dns_settings.rb +1 -3
- data/lib/azure_mgmt_network/models/{network_interface_ip_configuration.rb → network_interface_ipconfiguration.rb} +7 -9
- data/lib/azure_mgmt_network/models/{network_interface_ip_configuration_properties_format.rb → network_interface_ipconfiguration_properties_format.rb} +70 -76
- data/lib/azure_mgmt_network/models/network_interface_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/network_interface_properties_format.rb +32 -14
- data/lib/azure_mgmt_network/models/{operation_status.rb → network_operation_status.rb} +3 -3
- data/lib/azure_mgmt_network/models/network_security_group.rb +7 -9
- data/lib/azure_mgmt_network/models/network_security_group_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/network_security_group_properties_format.rb +30 -22
- data/lib/azure_mgmt_network/models/outbound_nat_rule.rb +88 -0
- data/lib/azure_mgmt_network/models/outbound_nat_rule_properties_format.rb +117 -0
- data/lib/azure_mgmt_network/models/probe.rb +1 -3
- data/lib/azure_mgmt_network/models/probe_properties_format.rb +25 -26
- data/lib/azure_mgmt_network/models/probe_protocol.rb +1 -1
- data/lib/azure_mgmt_network/models/processor_architecture.rb +16 -0
- data/lib/azure_mgmt_network/models/{public_ip_address.rb → public_ipaddress.rb} +13 -15
- data/lib/azure_mgmt_network/models/{public_ip_address_dns_settings.rb → public_ipaddress_dns_settings.rb} +4 -6
- data/lib/azure_mgmt_network/models/{public_ip_address_list_result.rb → public_ipaddress_list_result.rb} +10 -12
- data/lib/azure_mgmt_network/models/{public_ip_address_properties_format.rb → public_ipaddress_properties_format.rb} +25 -19
- data/lib/azure_mgmt_network/models/route.rb +88 -0
- data/lib/azure_mgmt_network/models/route_list_result.rb +85 -0
- data/lib/azure_mgmt_network/models/route_next_hop_type.rb +19 -0
- data/lib/azure_mgmt_network/models/route_properties_format.rb +94 -0
- data/lib/azure_mgmt_network/models/route_table.rb +102 -0
- data/lib/azure_mgmt_network/models/route_table_list_result.rb +86 -0
- data/lib/azure_mgmt_network/models/route_table_properties_format.rb +116 -0
- data/lib/azure_mgmt_network/models/security_rule.rb +1 -3
- data/lib/azure_mgmt_network/models/security_rule_access.rb +1 -1
- data/lib/azure_mgmt_network/models/security_rule_direction.rb +1 -1
- data/lib/azure_mgmt_network/models/security_rule_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/security_rule_properties_format.rb +50 -48
- data/lib/azure_mgmt_network/models/security_rule_protocol.rb +1 -1
- data/lib/azure_mgmt_network/models/service_provider_provisioning_state.rb +18 -0
- data/lib/azure_mgmt_network/models/subnet.rb +1 -3
- data/lib/azure_mgmt_network/models/subnet_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/subnet_properties_format.rb +28 -13
- data/lib/azure_mgmt_network/models/transport_protocol.rb +1 -1
- data/lib/azure_mgmt_network/models/usage.rb +7 -5
- data/lib/azure_mgmt_network/models/usage_name.rb +1 -3
- data/lib/azure_mgmt_network/models/usage_unit.rb +1 -1
- data/lib/azure_mgmt_network/models/usages_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/virtual_network.rb +7 -9
- data/lib/azure_mgmt_network/models/virtual_network_gateway.rb +7 -9
- data/lib/azure_mgmt_network/models/virtual_network_gateway_connection.rb +7 -9
- data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_properties_format.rb +74 -6
- data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_status.rb +18 -0
- data/lib/azure_mgmt_network/models/virtual_network_gateway_connection_type.rb +1 -1
- data/lib/azure_mgmt_network/models/{virtual_network_gateway_ip_configuration.rb → virtual_network_gateway_ipconfiguration.rb} +7 -9
- data/lib/azure_mgmt_network/models/{virtual_network_gateway_ip_configuration_properties_format.rb → virtual_network_gateway_ipconfiguration_properties_format.rb} +14 -17
- data/lib/azure_mgmt_network/models/virtual_network_gateway_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/virtual_network_gateway_properties_format.rb +76 -13
- data/lib/azure_mgmt_network/models/virtual_network_gateway_sku.rb +86 -0
- data/lib/azure_mgmt_network/models/virtual_network_gateway_sku_name.rb +17 -0
- data/lib/azure_mgmt_network/models/virtual_network_gateway_sku_tier.rb +17 -0
- data/lib/azure_mgmt_network/models/virtual_network_gateway_type.rb +2 -1
- data/lib/azure_mgmt_network/models/virtual_network_list_result.rb +4 -6
- data/lib/azure_mgmt_network/models/virtual_network_properties_format.rb +14 -6
- data/lib/azure_mgmt_network/models/vpn_client_configuration.rb +125 -0
- data/lib/azure_mgmt_network/models/vpn_client_parameters.rb +60 -0
- data/lib/azure_mgmt_network/models/vpn_client_revoked_certificate.rb +88 -0
- data/lib/azure_mgmt_network/models/vpn_client_revoked_certificate_properties_format.rb +69 -0
- data/lib/azure_mgmt_network/models/vpn_client_root_certificate.rb +88 -0
- data/lib/azure_mgmt_network/models/vpn_client_root_certificate_properties_format.rb +66 -0
- data/lib/azure_mgmt_network/models/vpn_type.rb +1 -1
- data/lib/azure_mgmt_network/module_definition.rb +5 -3
- data/lib/azure_mgmt_network/network_interfaces.rb +451 -304
- data/lib/azure_mgmt_network/{network_resource_provider_client.rb → network_management_client.rb} +61 -57
- data/lib/azure_mgmt_network/network_security_groups.rb +139 -314
- data/lib/azure_mgmt_network/public_ipaddresses.rb +536 -0
- data/lib/azure_mgmt_network/route_tables.rb +532 -0
- data/lib/azure_mgmt_network/routes.rb +423 -0
- data/lib/azure_mgmt_network/security_rules.rb +102 -232
- data/lib/azure_mgmt_network/subnets.rb +104 -233
- data/lib/azure_mgmt_network/usages.rb +79 -43
- data/lib/azure_mgmt_network/version.rb +5 -3
- data/lib/azure_mgmt_network/virtual_network_gateway_connections.rb +262 -467
- data/lib/azure_mgmt_network/virtual_network_gateways.rb +204 -280
- data/lib/azure_mgmt_network/virtual_networks.rb +139 -314
- metadata +92 -106
- data/.gitignore +0 -10
- data/.travis.yml +0 -3
- data/Gemfile +0 -15
- data/lib/azure_mgmt_network/public_ip_addresses.rb +0 -711
@@ -1,11 +1,14 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 0.
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
4
4
|
# regenerated.
|
5
5
|
|
6
6
|
module Azure::ARM::Network
|
7
7
|
#
|
8
|
-
#
|
8
|
+
# The Microsoft Azure Network management API provides a RESTful set of web
|
9
|
+
# services that interact with Microsoft Azure Networks service to manage
|
10
|
+
# your network resrources. The API has entities that capture the
|
11
|
+
# relationship between an end user and the Microsoft Azure Networks service.
|
9
12
|
#
|
10
13
|
class LocalNetworkGateways
|
11
14
|
include Azure::ARM::Network::Models
|
@@ -19,12 +22,13 @@ module Azure::ARM::Network
|
|
19
22
|
@client = client
|
20
23
|
end
|
21
24
|
|
22
|
-
# @return reference to the
|
25
|
+
# @return reference to the NetworkManagementClient
|
23
26
|
attr_reader :client
|
24
27
|
|
25
28
|
#
|
26
29
|
# The Put LocalNetworkGateway operation creates/updates a local network
|
27
30
|
# gateway in the specified resource group through Network resource provider.
|
31
|
+
#
|
28
32
|
# @param resource_group_name [String] The name of the resource group.
|
29
33
|
# @param local_network_gateway_name [String] The name of the local network
|
30
34
|
# gateway.
|
@@ -54,7 +58,7 @@ module Azure::ARM::Network
|
|
54
58
|
end
|
55
59
|
|
56
60
|
# Waiting for response.
|
57
|
-
@client.get_put_operation_result(response,
|
61
|
+
@client.get_put_operation_result(response, deserialize_method)
|
58
62
|
end
|
59
63
|
|
60
64
|
promise
|
@@ -63,6 +67,7 @@ module Azure::ARM::Network
|
|
63
67
|
#
|
64
68
|
# The Put LocalNetworkGateway operation creates/updates a local network
|
65
69
|
# gateway in the specified resource group through Network resource provider.
|
70
|
+
#
|
66
71
|
# @param resource_group_name [String] The name of the resource group.
|
67
72
|
# @param local_network_gateway_name [String] The name of the local network
|
68
73
|
# gateway.
|
@@ -82,92 +87,64 @@ module Azure::ARM::Network
|
|
82
87
|
parameters.validate unless parameters.nil?
|
83
88
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
84
89
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
85
|
-
|
86
|
-
path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"
|
87
|
-
path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
|
88
|
-
path['{localNetworkGatewayName}'] = ERB::Util.url_encode(local_network_gateway_name) if path.include?('{localNetworkGatewayName}')
|
89
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
90
|
-
url = URI.join(@client.base_url, path)
|
91
|
-
properties = {}
|
92
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
93
|
-
unless url.query.nil?
|
94
|
-
url.query.split('&').each do |url_item|
|
95
|
-
url_items_parts = url_item.split('=')
|
96
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
97
|
-
end
|
98
|
-
end
|
99
|
-
properties.reject!{ |key, value| value.nil? }
|
100
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
101
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
102
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
103
|
-
url = URI.parse(corrected_url)
|
104
|
-
|
105
|
-
connection = Faraday.new(:url => url) do |faraday|
|
106
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
107
|
-
faraday.use :cookie_jar
|
108
|
-
faraday.adapter Faraday.default_adapter
|
109
|
-
end
|
110
|
-
request_headers = Hash.new
|
90
|
+
request_headers = {}
|
111
91
|
|
112
92
|
# Set Headers
|
113
93
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
114
|
-
request_headers[
|
115
|
-
|
116
|
-
unless custom_headers.nil?
|
117
|
-
custom_headers.each do |key, value|
|
118
|
-
request_headers[key] = value
|
119
|
-
end
|
120
|
-
end
|
94
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
121
95
|
|
122
96
|
# Serialize Request
|
123
|
-
request_headers['Content-Type'] = 'application/json'
|
97
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
124
98
|
unless parameters.nil?
|
125
99
|
parameters = LocalNetworkGateway.serialize_object(parameters)
|
126
100
|
end
|
127
101
|
request_content = JSON.generate(parameters, quirks_mode: true)
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
102
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'
|
103
|
+
options = {
|
104
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
105
|
+
path_params: {'resourceGroupName' => resource_group_name,'localNetworkGatewayName' => local_network_gateway_name,'subscriptionId' => @client.subscription_id},
|
106
|
+
query_params: {'api-version' => @client.api_version},
|
107
|
+
body: request_content,
|
108
|
+
headers: request_headers.merge(custom_headers || {})
|
109
|
+
}
|
110
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
|
111
|
+
promise = request.run_promise do |req|
|
112
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
136
113
|
end
|
137
114
|
|
138
115
|
promise = promise.then do |http_response|
|
139
116
|
status_code = http_response.status
|
140
117
|
response_content = http_response.body
|
141
|
-
unless
|
118
|
+
unless status_code == 201 || status_code == 200
|
142
119
|
error_model = JSON.load(response_content)
|
143
|
-
fail MsRestAzure::AzureOperationError.new(
|
120
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
144
121
|
end
|
145
122
|
|
146
123
|
# Create Result
|
147
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
124
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
148
125
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
149
126
|
# Deserialize Response
|
150
127
|
if status_code == 201
|
151
128
|
begin
|
152
|
-
parsed_response = JSON.load(response_content)
|
129
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
153
130
|
unless parsed_response.nil?
|
154
131
|
parsed_response = LocalNetworkGateway.deserialize_object(parsed_response)
|
155
132
|
end
|
156
133
|
result.body = parsed_response
|
157
134
|
rescue Exception => e
|
158
|
-
fail MsRest::DeserializationError.new(
|
135
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
159
136
|
end
|
160
137
|
end
|
161
138
|
# Deserialize Response
|
162
139
|
if status_code == 200
|
163
140
|
begin
|
164
|
-
parsed_response = JSON.load(response_content)
|
141
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
165
142
|
unless parsed_response.nil?
|
166
143
|
parsed_response = LocalNetworkGateway.deserialize_object(parsed_response)
|
167
144
|
end
|
168
145
|
result.body = parsed_response
|
169
146
|
rescue Exception => e
|
170
|
-
fail MsRest::DeserializationError.new(
|
147
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
171
148
|
end
|
172
149
|
end
|
173
150
|
|
@@ -180,6 +157,7 @@ module Azure::ARM::Network
|
|
180
157
|
#
|
181
158
|
# The Get LocalNetworkGateway operation retrieves information about the
|
182
159
|
# specified local network gateway through Network resource provider.
|
160
|
+
#
|
183
161
|
# @param resource_group_name [String] The name of the resource group.
|
184
162
|
# @param local_network_gateway_name [String] The name of the local network
|
185
163
|
# gateway.
|
@@ -194,72 +172,44 @@ module Azure::ARM::Network
|
|
194
172
|
fail ArgumentError, 'local_network_gateway_name is nil' if local_network_gateway_name.nil?
|
195
173
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
196
174
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
197
|
-
|
198
|
-
path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"
|
199
|
-
path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
|
200
|
-
path['{localNetworkGatewayName}'] = ERB::Util.url_encode(local_network_gateway_name) if path.include?('{localNetworkGatewayName}')
|
201
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
202
|
-
url = URI.join(@client.base_url, path)
|
203
|
-
properties = {}
|
204
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
205
|
-
unless url.query.nil?
|
206
|
-
url.query.split('&').each do |url_item|
|
207
|
-
url_items_parts = url_item.split('=')
|
208
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
209
|
-
end
|
210
|
-
end
|
211
|
-
properties.reject!{ |key, value| value.nil? }
|
212
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
213
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
214
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
215
|
-
url = URI.parse(corrected_url)
|
216
|
-
|
217
|
-
connection = Faraday.new(:url => url) do |faraday|
|
218
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
219
|
-
faraday.use :cookie_jar
|
220
|
-
faraday.adapter Faraday.default_adapter
|
221
|
-
end
|
222
|
-
request_headers = Hash.new
|
175
|
+
request_headers = {}
|
223
176
|
|
224
177
|
# Set Headers
|
225
178
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
226
|
-
request_headers[
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
promise =
|
236
|
-
|
237
|
-
request.headers = request_headers
|
238
|
-
@client.credentials.sign_request(request) unless @client.credentials.nil?
|
239
|
-
end
|
179
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
180
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'
|
181
|
+
options = {
|
182
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
183
|
+
path_params: {'resourceGroupName' => resource_group_name,'localNetworkGatewayName' => local_network_gateway_name,'subscriptionId' => @client.subscription_id},
|
184
|
+
query_params: {'api-version' => @client.api_version},
|
185
|
+
headers: request_headers.merge(custom_headers || {})
|
186
|
+
}
|
187
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
188
|
+
promise = request.run_promise do |req|
|
189
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
240
190
|
end
|
241
191
|
|
242
192
|
promise = promise.then do |http_response|
|
243
193
|
status_code = http_response.status
|
244
194
|
response_content = http_response.body
|
245
|
-
unless
|
195
|
+
unless status_code == 200
|
246
196
|
error_model = JSON.load(response_content)
|
247
|
-
fail MsRestAzure::AzureOperationError.new(
|
197
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
248
198
|
end
|
249
199
|
|
250
200
|
# Create Result
|
251
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
201
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
252
202
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
253
203
|
# Deserialize Response
|
254
204
|
if status_code == 200
|
255
205
|
begin
|
256
|
-
parsed_response = JSON.load(response_content)
|
206
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
257
207
|
unless parsed_response.nil?
|
258
208
|
parsed_response = LocalNetworkGateway.deserialize_object(parsed_response)
|
259
209
|
end
|
260
210
|
result.body = parsed_response
|
261
211
|
rescue Exception => e
|
262
|
-
fail MsRest::DeserializationError.new(
|
212
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
263
213
|
end
|
264
214
|
end
|
265
215
|
|
@@ -272,6 +222,7 @@ module Azure::ARM::Network
|
|
272
222
|
#
|
273
223
|
# The Delete LocalNetworkGateway operation deletes the specifed local network
|
274
224
|
# Gateway through Network resource provider.
|
225
|
+
#
|
275
226
|
# @param resource_group_name [String] The name of the resource group.
|
276
227
|
# @param local_network_gateway_name [String] The name of the local network
|
277
228
|
# gateway.
|
@@ -288,7 +239,7 @@ module Azure::ARM::Network
|
|
288
239
|
end
|
289
240
|
|
290
241
|
# Waiting for response.
|
291
|
-
@client.get_post_or_delete_operation_result(response,
|
242
|
+
@client.get_post_or_delete_operation_result(response, deserialize_method)
|
292
243
|
end
|
293
244
|
|
294
245
|
promise
|
@@ -297,6 +248,7 @@ module Azure::ARM::Network
|
|
297
248
|
#
|
298
249
|
# The Delete LocalNetworkGateway operation deletes the specifed local network
|
299
250
|
# Gateway through Network resource provider.
|
251
|
+
#
|
300
252
|
# @param resource_group_name [String] The name of the resource group.
|
301
253
|
# @param local_network_gateway_name [String] The name of the local network
|
302
254
|
# gateway.
|
@@ -311,60 +263,33 @@ module Azure::ARM::Network
|
|
311
263
|
fail ArgumentError, 'local_network_gateway_name is nil' if local_network_gateway_name.nil?
|
312
264
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
313
265
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
314
|
-
|
315
|
-
path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}/"
|
316
|
-
path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
|
317
|
-
path['{localNetworkGatewayName}'] = ERB::Util.url_encode(local_network_gateway_name) if path.include?('{localNetworkGatewayName}')
|
318
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
319
|
-
url = URI.join(@client.base_url, path)
|
320
|
-
properties = {}
|
321
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
322
|
-
unless url.query.nil?
|
323
|
-
url.query.split('&').each do |url_item|
|
324
|
-
url_items_parts = url_item.split('=')
|
325
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
326
|
-
end
|
327
|
-
end
|
328
|
-
properties.reject!{ |key, value| value.nil? }
|
329
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
330
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
331
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
332
|
-
url = URI.parse(corrected_url)
|
333
|
-
|
334
|
-
connection = Faraday.new(:url => url) do |faraday|
|
335
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
336
|
-
faraday.use :cookie_jar
|
337
|
-
faraday.adapter Faraday.default_adapter
|
338
|
-
end
|
339
|
-
request_headers = Hash.new
|
266
|
+
request_headers = {}
|
340
267
|
|
341
268
|
# Set Headers
|
342
269
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
343
|
-
request_headers[
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
promise =
|
353
|
-
|
354
|
-
request.headers = request_headers
|
355
|
-
@client.credentials.sign_request(request) unless @client.credentials.nil?
|
356
|
-
end
|
270
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
271
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}'
|
272
|
+
options = {
|
273
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
274
|
+
path_params: {'resourceGroupName' => resource_group_name,'localNetworkGatewayName' => local_network_gateway_name,'subscriptionId' => @client.subscription_id},
|
275
|
+
query_params: {'api-version' => @client.api_version},
|
276
|
+
headers: request_headers.merge(custom_headers || {})
|
277
|
+
}
|
278
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
|
279
|
+
promise = request.run_promise do |req|
|
280
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
357
281
|
end
|
358
282
|
|
359
283
|
promise = promise.then do |http_response|
|
360
284
|
status_code = http_response.status
|
361
285
|
response_content = http_response.body
|
362
|
-
unless
|
363
|
-
|
286
|
+
unless status_code == 204 || status_code == 200 || status_code == 202
|
287
|
+
error_model = JSON.load(response_content)
|
288
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
364
289
|
end
|
365
290
|
|
366
291
|
# Create Result
|
367
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
292
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
368
293
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
369
294
|
|
370
295
|
result
|
@@ -376,6 +301,7 @@ module Azure::ARM::Network
|
|
376
301
|
#
|
377
302
|
# The List LocalNetworkGateways opertion retrieves all the local network
|
378
303
|
# gateways stored.
|
304
|
+
#
|
379
305
|
# @param resource_group_name [String] The name of the resource group.
|
380
306
|
# @param [Hash{String => String}] The hash of custom headers need to be
|
381
307
|
# applied to HTTP request.
|
@@ -387,71 +313,44 @@ module Azure::ARM::Network
|
|
387
313
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
388
314
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
389
315
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
390
|
-
|
391
|
-
path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways"
|
392
|
-
path['{resourceGroupName}'] = ERB::Util.url_encode(resource_group_name) if path.include?('{resourceGroupName}')
|
393
|
-
path['{subscriptionId}'] = ERB::Util.url_encode(@client.subscription_id) if path.include?('{subscriptionId}')
|
394
|
-
url = URI.join(@client.base_url, path)
|
395
|
-
properties = {}
|
396
|
-
properties['api-version'] = ERB::Util.url_encode(@client.api_version.to_s) unless @client.api_version.nil?
|
397
|
-
unless url.query.nil?
|
398
|
-
url.query.split('&').each do |url_item|
|
399
|
-
url_items_parts = url_item.split('=')
|
400
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
401
|
-
end
|
402
|
-
end
|
403
|
-
properties.reject!{ |key, value| value.nil? }
|
404
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
405
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
406
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
407
|
-
url = URI.parse(corrected_url)
|
408
|
-
|
409
|
-
connection = Faraday.new(:url => url) do |faraday|
|
410
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
411
|
-
faraday.use :cookie_jar
|
412
|
-
faraday.adapter Faraday.default_adapter
|
413
|
-
end
|
414
|
-
request_headers = Hash.new
|
316
|
+
request_headers = {}
|
415
317
|
|
416
318
|
# Set Headers
|
417
319
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
418
|
-
request_headers[
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
promise =
|
428
|
-
|
429
|
-
request.headers = request_headers
|
430
|
-
@client.credentials.sign_request(request) unless @client.credentials.nil?
|
431
|
-
end
|
320
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
321
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways'
|
322
|
+
options = {
|
323
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
324
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
325
|
+
query_params: {'api-version' => @client.api_version},
|
326
|
+
headers: request_headers.merge(custom_headers || {})
|
327
|
+
}
|
328
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
329
|
+
promise = request.run_promise do |req|
|
330
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
432
331
|
end
|
433
332
|
|
434
333
|
promise = promise.then do |http_response|
|
435
334
|
status_code = http_response.status
|
436
335
|
response_content = http_response.body
|
437
|
-
unless
|
336
|
+
unless status_code == 200
|
438
337
|
error_model = JSON.load(response_content)
|
439
|
-
fail MsRestAzure::AzureOperationError.new(
|
338
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
440
339
|
end
|
441
340
|
|
442
341
|
# Create Result
|
443
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
342
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
444
343
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
445
344
|
# Deserialize Response
|
446
345
|
if status_code == 200
|
447
346
|
begin
|
448
|
-
parsed_response = JSON.load(response_content)
|
347
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
449
348
|
unless parsed_response.nil?
|
450
349
|
parsed_response = LocalNetworkGatewayListResult.deserialize_object(parsed_response)
|
451
350
|
end
|
452
351
|
result.body = parsed_response
|
453
352
|
rescue Exception => e
|
454
|
-
fail MsRest::DeserializationError.new(
|
353
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
455
354
|
end
|
456
355
|
end
|
457
356
|
|
@@ -464,6 +363,7 @@ module Azure::ARM::Network
|
|
464
363
|
#
|
465
364
|
# The List LocalNetworkGateways opertion retrieves all the local network
|
466
365
|
# gateways stored.
|
366
|
+
#
|
467
367
|
# @param next_page_link [String] The NextLink from the previous successful
|
468
368
|
# call to List operation.
|
469
369
|
# @param [Hash{String => String}] The hash of custom headers need to be
|
@@ -474,69 +374,43 @@ module Azure::ARM::Network
|
|
474
374
|
#
|
475
375
|
def list_next(next_page_link, custom_headers = nil)
|
476
376
|
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
477
|
-
|
478
|
-
path = "{nextLink}"
|
479
|
-
path['{nextLink}'] = next_page_link if path.include?('{nextLink}')
|
480
|
-
url = URI.parse(path)
|
481
|
-
properties = {}
|
482
|
-
unless url.query.nil?
|
483
|
-
url.query.split('&').each do |url_item|
|
484
|
-
url_items_parts = url_item.split('=')
|
485
|
-
properties[url_items_parts[0]] = url_items_parts[1]
|
486
|
-
end
|
487
|
-
end
|
488
|
-
properties.reject!{ |key, value| value.nil? }
|
489
|
-
url.query = properties.map{ |key, value| "#{key}=#{value}" }.compact.join('&')
|
490
|
-
fail URI::Error unless url.to_s =~ /\A#{URI::regexp}\z/
|
491
|
-
corrected_url = url.to_s.gsub(/([^:])\/\//, '\1/')
|
492
|
-
url = URI.parse(corrected_url)
|
493
|
-
|
494
|
-
connection = Faraday.new(:url => url) do |faraday|
|
495
|
-
faraday.use MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02
|
496
|
-
faraday.use :cookie_jar
|
497
|
-
faraday.adapter Faraday.default_adapter
|
498
|
-
end
|
499
|
-
request_headers = Hash.new
|
377
|
+
request_headers = {}
|
500
378
|
|
501
379
|
# Set Headers
|
502
380
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
503
|
-
request_headers[
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
connection.get do |request|
|
514
|
-
request.headers = request_headers
|
515
|
-
@client.credentials.sign_request(request) unless @client.credentials.nil?
|
516
|
-
end
|
381
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
382
|
+
path_template = '{nextLink}'
|
383
|
+
options = {
|
384
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
385
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
386
|
+
headers: request_headers.merge(custom_headers || {})
|
387
|
+
}
|
388
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
389
|
+
promise = request.run_promise do |req|
|
390
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
517
391
|
end
|
518
392
|
|
519
393
|
promise = promise.then do |http_response|
|
520
394
|
status_code = http_response.status
|
521
395
|
response_content = http_response.body
|
522
|
-
unless
|
396
|
+
unless status_code == 200
|
523
397
|
error_model = JSON.load(response_content)
|
524
|
-
fail MsRestAzure::AzureOperationError.new(
|
398
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
525
399
|
end
|
526
400
|
|
527
401
|
# Create Result
|
528
|
-
result = MsRestAzure::AzureOperationResponse.new(
|
402
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
529
403
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
530
404
|
# Deserialize Response
|
531
405
|
if status_code == 200
|
532
406
|
begin
|
533
|
-
parsed_response = JSON.load(response_content)
|
407
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
534
408
|
unless parsed_response.nil?
|
535
409
|
parsed_response = LocalNetworkGatewayListResult.deserialize_object(parsed_response)
|
536
410
|
end
|
537
411
|
result.body = parsed_response
|
538
412
|
rescue Exception => e
|
539
|
-
fail MsRest::DeserializationError.new(
|
413
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
540
414
|
end
|
541
415
|
end
|
542
416
|
|