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
@@ -0,0 +1,532 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::Network
|
7
|
+
#
|
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.
|
12
|
+
#
|
13
|
+
class RouteTables
|
14
|
+
include Azure::ARM::Network::Models
|
15
|
+
include MsRestAzure
|
16
|
+
|
17
|
+
#
|
18
|
+
# Creates and initializes a new instance of the RouteTables class.
|
19
|
+
# @param client service class for accessing basic functionality.
|
20
|
+
#
|
21
|
+
def initialize(client)
|
22
|
+
@client = client
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return reference to the NetworkManagementClient
|
26
|
+
attr_reader :client
|
27
|
+
|
28
|
+
#
|
29
|
+
# The Delete RouteTable operation deletes the specifed Route Table
|
30
|
+
#
|
31
|
+
# @param resource_group_name [String] The name of the resource group.
|
32
|
+
# @param route_table_name [String] The name of the route table.
|
33
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
34
|
+
# response.
|
35
|
+
#
|
36
|
+
def delete(resource_group_name, route_table_name, custom_headers = nil)
|
37
|
+
# Send request
|
38
|
+
promise = begin_delete(resource_group_name, route_table_name, custom_headers)
|
39
|
+
|
40
|
+
promise = promise.then do |response|
|
41
|
+
# Defining deserialization method.
|
42
|
+
deserialize_method = lambda do |parsed_response|
|
43
|
+
end
|
44
|
+
|
45
|
+
# Waiting for response.
|
46
|
+
@client.get_post_or_delete_operation_result(response, deserialize_method)
|
47
|
+
end
|
48
|
+
|
49
|
+
promise
|
50
|
+
end
|
51
|
+
|
52
|
+
#
|
53
|
+
# The Delete RouteTable operation deletes the specifed Route Table
|
54
|
+
#
|
55
|
+
# @param resource_group_name [String] The name of the resource group.
|
56
|
+
# @param route_table_name [String] The name of the route table.
|
57
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
58
|
+
# applied to HTTP request.
|
59
|
+
#
|
60
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
61
|
+
# response.
|
62
|
+
#
|
63
|
+
def begin_delete(resource_group_name, route_table_name, custom_headers = nil)
|
64
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
65
|
+
fail ArgumentError, 'route_table_name is nil' if route_table_name.nil?
|
66
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
67
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
68
|
+
request_headers = {}
|
69
|
+
|
70
|
+
# Set Headers
|
71
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
72
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
73
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'
|
74
|
+
options = {
|
75
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
76
|
+
path_params: {'resourceGroupName' => resource_group_name,'routeTableName' => route_table_name,'subscriptionId' => @client.subscription_id},
|
77
|
+
query_params: {'api-version' => @client.api_version},
|
78
|
+
headers: request_headers.merge(custom_headers || {})
|
79
|
+
}
|
80
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
|
81
|
+
promise = request.run_promise do |req|
|
82
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
83
|
+
end
|
84
|
+
|
85
|
+
promise = promise.then do |http_response|
|
86
|
+
status_code = http_response.status
|
87
|
+
response_content = http_response.body
|
88
|
+
unless status_code == 204 || status_code == 200 || status_code == 202
|
89
|
+
error_model = JSON.load(response_content)
|
90
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
91
|
+
end
|
92
|
+
|
93
|
+
# Create Result
|
94
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
95
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
96
|
+
|
97
|
+
result
|
98
|
+
end
|
99
|
+
|
100
|
+
promise.execute
|
101
|
+
end
|
102
|
+
|
103
|
+
#
|
104
|
+
# The Get RouteTables operation retrieves information about the specified
|
105
|
+
# route table.
|
106
|
+
#
|
107
|
+
# @param resource_group_name [String] The name of the resource group.
|
108
|
+
# @param route_table_name [String] The name of the route table.
|
109
|
+
# @param expand [String] expand references resources.
|
110
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
111
|
+
# applied to HTTP request.
|
112
|
+
#
|
113
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
114
|
+
# response.
|
115
|
+
#
|
116
|
+
def get(resource_group_name, route_table_name, expand = nil, custom_headers = nil)
|
117
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
118
|
+
fail ArgumentError, 'route_table_name is nil' if route_table_name.nil?
|
119
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
120
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
121
|
+
request_headers = {}
|
122
|
+
|
123
|
+
# Set Headers
|
124
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
125
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
126
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'
|
127
|
+
options = {
|
128
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
129
|
+
path_params: {'resourceGroupName' => resource_group_name,'routeTableName' => route_table_name,'subscriptionId' => @client.subscription_id},
|
130
|
+
query_params: {'api-version' => @client.api_version,'$expand' => expand},
|
131
|
+
headers: request_headers.merge(custom_headers || {})
|
132
|
+
}
|
133
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
134
|
+
promise = request.run_promise do |req|
|
135
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
136
|
+
end
|
137
|
+
|
138
|
+
promise = promise.then do |http_response|
|
139
|
+
status_code = http_response.status
|
140
|
+
response_content = http_response.body
|
141
|
+
unless status_code == 200
|
142
|
+
error_model = JSON.load(response_content)
|
143
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Create Result
|
147
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
148
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
149
|
+
# Deserialize Response
|
150
|
+
if status_code == 200
|
151
|
+
begin
|
152
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
153
|
+
unless parsed_response.nil?
|
154
|
+
parsed_response = RouteTable.deserialize_object(parsed_response)
|
155
|
+
end
|
156
|
+
result.body = parsed_response
|
157
|
+
rescue Exception => e
|
158
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
result
|
163
|
+
end
|
164
|
+
|
165
|
+
promise.execute
|
166
|
+
end
|
167
|
+
|
168
|
+
#
|
169
|
+
# The Put RouteTable operation creates/updates a route tablein the specified
|
170
|
+
# resource group.
|
171
|
+
#
|
172
|
+
# @param resource_group_name [String] The name of the resource group.
|
173
|
+
# @param route_table_name [String] The name of the route table.
|
174
|
+
# @param parameters [RouteTable] Parameters supplied to the create/update
|
175
|
+
# Route Table operation
|
176
|
+
# @param @client.api_version [String] Client Api Version.
|
177
|
+
# @param @client.subscription_id [String] Gets subscription credentials which
|
178
|
+
# uniquely identify Microsoft Azure subscription. The subscription ID forms
|
179
|
+
# part of the URI for every service call.
|
180
|
+
# @param @client.accept_language [String] Gets or sets the preferred language
|
181
|
+
# for the response.
|
182
|
+
#
|
183
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
184
|
+
# response.
|
185
|
+
#
|
186
|
+
def create_or_update(resource_group_name, route_table_name, parameters, custom_headers = nil)
|
187
|
+
# Send request
|
188
|
+
promise = begin_create_or_update(resource_group_name, route_table_name, parameters, custom_headers)
|
189
|
+
|
190
|
+
promise = promise.then do |response|
|
191
|
+
# Defining deserialization method.
|
192
|
+
deserialize_method = lambda do |parsed_response|
|
193
|
+
unless parsed_response.nil?
|
194
|
+
parsed_response = RouteTable.deserialize_object(parsed_response)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
# Waiting for response.
|
199
|
+
@client.get_put_operation_result(response, deserialize_method)
|
200
|
+
end
|
201
|
+
|
202
|
+
promise
|
203
|
+
end
|
204
|
+
|
205
|
+
#
|
206
|
+
# The Put RouteTable operation creates/updates a route tablein the specified
|
207
|
+
# resource group.
|
208
|
+
#
|
209
|
+
# @param resource_group_name [String] The name of the resource group.
|
210
|
+
# @param route_table_name [String] The name of the route table.
|
211
|
+
# @param parameters [RouteTable] Parameters supplied to the create/update
|
212
|
+
# Route Table operation
|
213
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
214
|
+
# applied to HTTP request.
|
215
|
+
#
|
216
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
217
|
+
# response.
|
218
|
+
#
|
219
|
+
def begin_create_or_update(resource_group_name, route_table_name, parameters, custom_headers = nil)
|
220
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
221
|
+
fail ArgumentError, 'route_table_name is nil' if route_table_name.nil?
|
222
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
223
|
+
parameters.validate unless parameters.nil?
|
224
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
225
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
226
|
+
request_headers = {}
|
227
|
+
|
228
|
+
# Set Headers
|
229
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
230
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
231
|
+
|
232
|
+
# Serialize Request
|
233
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
234
|
+
unless parameters.nil?
|
235
|
+
parameters = RouteTable.serialize_object(parameters)
|
236
|
+
end
|
237
|
+
request_content = JSON.generate(parameters, quirks_mode: true)
|
238
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}'
|
239
|
+
options = {
|
240
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
241
|
+
path_params: {'resourceGroupName' => resource_group_name,'routeTableName' => route_table_name,'subscriptionId' => @client.subscription_id},
|
242
|
+
query_params: {'api-version' => @client.api_version},
|
243
|
+
body: request_content,
|
244
|
+
headers: request_headers.merge(custom_headers || {})
|
245
|
+
}
|
246
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
|
247
|
+
promise = request.run_promise do |req|
|
248
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
249
|
+
end
|
250
|
+
|
251
|
+
promise = promise.then do |http_response|
|
252
|
+
status_code = http_response.status
|
253
|
+
response_content = http_response.body
|
254
|
+
unless status_code == 200 || status_code == 201
|
255
|
+
error_model = JSON.load(response_content)
|
256
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
257
|
+
end
|
258
|
+
|
259
|
+
# Create Result
|
260
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
261
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
262
|
+
# Deserialize Response
|
263
|
+
if status_code == 200
|
264
|
+
begin
|
265
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
266
|
+
unless parsed_response.nil?
|
267
|
+
parsed_response = RouteTable.deserialize_object(parsed_response)
|
268
|
+
end
|
269
|
+
result.body = parsed_response
|
270
|
+
rescue Exception => e
|
271
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
272
|
+
end
|
273
|
+
end
|
274
|
+
# Deserialize Response
|
275
|
+
if status_code == 201
|
276
|
+
begin
|
277
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
278
|
+
unless parsed_response.nil?
|
279
|
+
parsed_response = RouteTable.deserialize_object(parsed_response)
|
280
|
+
end
|
281
|
+
result.body = parsed_response
|
282
|
+
rescue Exception => e
|
283
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
result
|
288
|
+
end
|
289
|
+
|
290
|
+
promise.execute
|
291
|
+
end
|
292
|
+
|
293
|
+
#
|
294
|
+
# The list RouteTables returns all route tables in a resource group
|
295
|
+
#
|
296
|
+
# @param resource_group_name [String] The name of the resource group.
|
297
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
298
|
+
# applied to HTTP request.
|
299
|
+
#
|
300
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
301
|
+
# response.
|
302
|
+
#
|
303
|
+
def list(resource_group_name, custom_headers = nil)
|
304
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
305
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
306
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
307
|
+
request_headers = {}
|
308
|
+
|
309
|
+
# Set Headers
|
310
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
311
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
312
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables'
|
313
|
+
options = {
|
314
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
315
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
316
|
+
query_params: {'api-version' => @client.api_version},
|
317
|
+
headers: request_headers.merge(custom_headers || {})
|
318
|
+
}
|
319
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
320
|
+
promise = request.run_promise do |req|
|
321
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
322
|
+
end
|
323
|
+
|
324
|
+
promise = promise.then do |http_response|
|
325
|
+
status_code = http_response.status
|
326
|
+
response_content = http_response.body
|
327
|
+
unless status_code == 200
|
328
|
+
error_model = JSON.load(response_content)
|
329
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
330
|
+
end
|
331
|
+
|
332
|
+
# Create Result
|
333
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
334
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
335
|
+
# Deserialize Response
|
336
|
+
if status_code == 200
|
337
|
+
begin
|
338
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
339
|
+
unless parsed_response.nil?
|
340
|
+
parsed_response = RouteTableListResult.deserialize_object(parsed_response)
|
341
|
+
end
|
342
|
+
result.body = parsed_response
|
343
|
+
rescue Exception => e
|
344
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
result
|
349
|
+
end
|
350
|
+
|
351
|
+
promise.execute
|
352
|
+
end
|
353
|
+
|
354
|
+
#
|
355
|
+
# The list RouteTables returns all route tables in a subscription
|
356
|
+
#
|
357
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
358
|
+
# applied to HTTP request.
|
359
|
+
#
|
360
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
361
|
+
# response.
|
362
|
+
#
|
363
|
+
def list_all(custom_headers = nil)
|
364
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
365
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
366
|
+
request_headers = {}
|
367
|
+
|
368
|
+
# Set Headers
|
369
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
370
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
371
|
+
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables'
|
372
|
+
options = {
|
373
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
374
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
375
|
+
query_params: {'api-version' => @client.api_version},
|
376
|
+
headers: request_headers.merge(custom_headers || {})
|
377
|
+
}
|
378
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
379
|
+
promise = request.run_promise do |req|
|
380
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
381
|
+
end
|
382
|
+
|
383
|
+
promise = promise.then do |http_response|
|
384
|
+
status_code = http_response.status
|
385
|
+
response_content = http_response.body
|
386
|
+
unless status_code == 200
|
387
|
+
error_model = JSON.load(response_content)
|
388
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
389
|
+
end
|
390
|
+
|
391
|
+
# Create Result
|
392
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
393
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
394
|
+
# Deserialize Response
|
395
|
+
if status_code == 200
|
396
|
+
begin
|
397
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
398
|
+
unless parsed_response.nil?
|
399
|
+
parsed_response = RouteTableListResult.deserialize_object(parsed_response)
|
400
|
+
end
|
401
|
+
result.body = parsed_response
|
402
|
+
rescue Exception => e
|
403
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
404
|
+
end
|
405
|
+
end
|
406
|
+
|
407
|
+
result
|
408
|
+
end
|
409
|
+
|
410
|
+
promise.execute
|
411
|
+
end
|
412
|
+
|
413
|
+
#
|
414
|
+
# The list RouteTables returns all route tables in a resource group
|
415
|
+
#
|
416
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
417
|
+
# call to List operation.
|
418
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
419
|
+
# applied to HTTP request.
|
420
|
+
#
|
421
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
422
|
+
# response.
|
423
|
+
#
|
424
|
+
def list_next(next_page_link, custom_headers = nil)
|
425
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
426
|
+
request_headers = {}
|
427
|
+
|
428
|
+
# Set Headers
|
429
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
430
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
431
|
+
path_template = '{nextLink}'
|
432
|
+
options = {
|
433
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
434
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
435
|
+
headers: request_headers.merge(custom_headers || {})
|
436
|
+
}
|
437
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
438
|
+
promise = request.run_promise do |req|
|
439
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
440
|
+
end
|
441
|
+
|
442
|
+
promise = promise.then do |http_response|
|
443
|
+
status_code = http_response.status
|
444
|
+
response_content = http_response.body
|
445
|
+
unless status_code == 200
|
446
|
+
error_model = JSON.load(response_content)
|
447
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
448
|
+
end
|
449
|
+
|
450
|
+
# Create Result
|
451
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
452
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
453
|
+
# Deserialize Response
|
454
|
+
if status_code == 200
|
455
|
+
begin
|
456
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
457
|
+
unless parsed_response.nil?
|
458
|
+
parsed_response = RouteTableListResult.deserialize_object(parsed_response)
|
459
|
+
end
|
460
|
+
result.body = parsed_response
|
461
|
+
rescue Exception => e
|
462
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
463
|
+
end
|
464
|
+
end
|
465
|
+
|
466
|
+
result
|
467
|
+
end
|
468
|
+
|
469
|
+
promise.execute
|
470
|
+
end
|
471
|
+
|
472
|
+
#
|
473
|
+
# The list RouteTables returns all route tables in a subscription
|
474
|
+
#
|
475
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
476
|
+
# call to List operation.
|
477
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
478
|
+
# applied to HTTP request.
|
479
|
+
#
|
480
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
481
|
+
# response.
|
482
|
+
#
|
483
|
+
def list_all_next(next_page_link, custom_headers = nil)
|
484
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
485
|
+
request_headers = {}
|
486
|
+
|
487
|
+
# Set Headers
|
488
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
489
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
490
|
+
path_template = '{nextLink}'
|
491
|
+
options = {
|
492
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
493
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
494
|
+
headers: request_headers.merge(custom_headers || {})
|
495
|
+
}
|
496
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
497
|
+
promise = request.run_promise do |req|
|
498
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
499
|
+
end
|
500
|
+
|
501
|
+
promise = promise.then do |http_response|
|
502
|
+
status_code = http_response.status
|
503
|
+
response_content = http_response.body
|
504
|
+
unless status_code == 200
|
505
|
+
error_model = JSON.load(response_content)
|
506
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
507
|
+
end
|
508
|
+
|
509
|
+
# Create Result
|
510
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
511
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
512
|
+
# Deserialize Response
|
513
|
+
if status_code == 200
|
514
|
+
begin
|
515
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
516
|
+
unless parsed_response.nil?
|
517
|
+
parsed_response = RouteTableListResult.deserialize_object(parsed_response)
|
518
|
+
end
|
519
|
+
result.body = parsed_response
|
520
|
+
rescue Exception => e
|
521
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
522
|
+
end
|
523
|
+
end
|
524
|
+
|
525
|
+
result
|
526
|
+
end
|
527
|
+
|
528
|
+
promise.execute
|
529
|
+
end
|
530
|
+
|
531
|
+
end
|
532
|
+
end
|