Class: Azure::ARM::Network::Routes
- Inherits:
-
Object
- Object
- Azure::ARM::Network::Routes
- Includes:
- Models, MsRestAzure
- Defined in:
- lib/azure_mgmt_network/routes.rb
Overview
The Microsoft Azure Network management API provides a RESTful set of web services that interact with Microsoft Azure Networks service to manage your network resrources. The API has entities that capture the relationship between an end user and the Microsoft Azure Networks service.
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Reference to the NetworkManagementClient.
Instance Method Summary collapse
-
#begin_create_or_update(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) ⇒ Route
The Put route operation creates/updates a route in the specified route table.
-
#begin_create_or_update_async(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put route operation creates/updates a route in the specified route table.
-
#begin_create_or_update_with_http_info(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The Put route operation creates/updates a route in the specified route table.
-
#begin_delete(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Object
The delete route operation deletes the specified route from a route table.
-
#begin_delete_async(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Concurrent::Promise
The delete route operation deletes the specified route from a route table.
-
#begin_delete_with_http_info(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The delete route operation deletes the specified route from a route table.
-
#create_or_update(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put route operation creates/updates a route in the specified route table.
-
#delete(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Concurrent::Promise
The delete route operation deletes the specified route from a route table.
-
#get(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Route
The Get route operation retreives information about the specified route from the route table.
-
#get_async(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Concurrent::Promise
The Get route operation retreives information about the specified route from the route table.
-
#get_with_http_info(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The Get route operation retreives information about the specified route from the route table.
-
#initialize(client) ⇒ Routes
constructor
Creates and initializes a new instance of the Routes class.
-
#list(resource_group_name, route_table_name, custom_headers = nil) ⇒ RouteListResult
The List network security rule opertion retrieves all the routes in a route table.
-
#list_async(resource_group_name, route_table_name, custom_headers = nil) ⇒ Concurrent::Promise
The List network security rule opertion retrieves all the routes in a route table.
-
#list_next(next_page_link, custom_headers = nil) ⇒ RouteListResult
The List network security rule opertion retrieves all the routes in a route table.
-
#list_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise
The List network security rule opertion retrieves all the routes in a route table.
-
#list_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The List network security rule opertion retrieves all the routes in a route table.
-
#list_with_http_info(resource_group_name, route_table_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The List network security rule opertion retrieves all the routes in a route table.
Constructor Details
#initialize(client) ⇒ Routes
Creates and initializes a new instance of the Routes class.
21 22 23 |
# File 'lib/azure_mgmt_network/routes.rb', line 21 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns reference to the NetworkManagementClient.
26 27 28 |
# File 'lib/azure_mgmt_network/routes.rb', line 26 def client @client end |
Instance Method Details
#begin_create_or_update(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) ⇒ Route
The Put route operation creates/updates a route in the specified route table
routeoperation will be added to the HTTP request.
289 290 291 292 |
# File 'lib/azure_mgmt_network/routes.rb', line 289 def begin_create_or_update(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) response = begin_create_or_update_async(resource_group_name, route_table_name, route_name, route_parameters, custom_headers).value! response.body unless response.nil? end |
#begin_create_or_update_async(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put route operation creates/updates a route in the specified route table
routeoperation to the HTTP request.
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/azure_mgmt_network/routes.rb', line 324 def begin_create_or_update_async(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'route_table_name is nil' if route_table_name.nil? fail ArgumentError, 'route_name is nil' if route_name.nil? fail ArgumentError, 'route_parameters is nil' if route_parameters.nil? route_parameters.validate unless route_parameters.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_headers['Content-Type'] = 'application/json; charset=utf-8' unless route_parameters.nil? route_parameters = Route.serialize_object(route_parameters) end request_content = route_parameters != nil ? JSON.generate(route_parameters, quirks_mode: true) : nil path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'routeTableName' => route_table_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 201 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = Route.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end # Deserialize Response if status_code == 201 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = Route.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#begin_create_or_update_with_http_info(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The Put route operation creates/updates a route in the specified route table
routeoperation will be added to the HTTP request.
307 308 309 |
# File 'lib/azure_mgmt_network/routes.rb', line 307 def begin_create_or_update_with_http_info(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) begin_create_or_update_async(resource_group_name, route_table_name, route_name, route_parameters, custom_headers).value! end |
#begin_delete(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Object
The delete route operation deletes the specified route from a route table.
will be added to the HTTP request.
63 64 65 66 |
# File 'lib/azure_mgmt_network/routes.rb', line 63 def begin_delete(resource_group_name, route_table_name, route_name, custom_headers = nil) response = begin_delete_async(resource_group_name, route_table_name, route_name, custom_headers).value! nil end |
#begin_delete_async(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Concurrent::Promise
The delete route operation deletes the specified route from a route table.
to the HTTP request.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/azure_mgmt_network/routes.rb', line 94 def begin_delete_async(resource_group_name, route_table_name, route_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'route_table_name is nil' if route_table_name.nil? fail ArgumentError, 'route_name is nil' if route_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'routeTableName' => route_table_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 202 || status_code == 200 || status_code == 204 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result end promise.execute end |
#begin_delete_with_http_info(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The delete route operation deletes the specified route from a route table.
will be added to the HTTP request.
79 80 81 |
# File 'lib/azure_mgmt_network/routes.rb', line 79 def begin_delete_with_http_info(resource_group_name, route_table_name, route_name, custom_headers = nil) begin_delete_async(resource_group_name, route_table_name, route_name, custom_headers).value! end |
#create_or_update(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) ⇒ Concurrent::Promise
The Put route operation creates/updates a route in the specified route table
routeoperation uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. for the response.
response.
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/azure_mgmt_network/routes.rb', line 257 def create_or_update(resource_group_name, route_table_name, route_name, route_parameters, custom_headers = nil) # Send request promise = begin_create_or_update_async(resource_group_name, route_table_name, route_name, route_parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| unless parsed_response.nil? parsed_response = Route.deserialize_object(parsed_response) end end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#delete(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Concurrent::Promise
The delete route operation deletes the specified route from a route table.
response.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/azure_mgmt_network/routes.rb', line 37 def delete(resource_group_name, route_table_name, route_name, custom_headers = nil) # Send request promise = begin_delete_async(resource_group_name, route_table_name, route_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#get(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Route
The Get route operation retreives information about the specified route from the route table.
will be added to the HTTP request.
150 151 152 153 |
# File 'lib/azure_mgmt_network/routes.rb', line 150 def get(resource_group_name, route_table_name, route_name, custom_headers = nil) response = get_async(resource_group_name, route_table_name, route_name, custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ Concurrent::Promise
The Get route operation retreives information about the specified route from the route table.
to the HTTP request.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/azure_mgmt_network/routes.rb', line 183 def get_async(resource_group_name, route_table_name, route_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'route_table_name is nil' if route_table_name.nil? fail ArgumentError, 'route_name is nil' if route_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'routeTableName' => route_table_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = Route.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_with_http_info(resource_group_name, route_table_name, route_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The Get route operation retreives information about the specified route from the route table.
will be added to the HTTP request.
167 168 169 |
# File 'lib/azure_mgmt_network/routes.rb', line 167 def get_with_http_info(resource_group_name, route_table_name, route_name, custom_headers = nil) get_async(resource_group_name, route_table_name, route_name, custom_headers).value! end |
#list(resource_group_name, route_table_name, custom_headers = nil) ⇒ RouteListResult
The List network security rule opertion retrieves all the routes in a route table.
will be added to the HTTP request.
413 414 415 416 |
# File 'lib/azure_mgmt_network/routes.rb', line 413 def list(resource_group_name, route_table_name, custom_headers = nil) response = list_async(resource_group_name, route_table_name, custom_headers).value! response.body unless response.nil? end |
#list_async(resource_group_name, route_table_name, custom_headers = nil) ⇒ Concurrent::Promise
The List network security rule opertion retrieves all the routes in a route table.
to the HTTP request.
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 |
# File 'lib/azure_mgmt_network/routes.rb', line 444 def list_async(resource_group_name, route_table_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'route_table_name is nil' if route_table_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'routeTableName' => route_table_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = RouteListResult.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_next(next_page_link, custom_headers = nil) ⇒ RouteListResult
The List network security rule opertion retrieves all the routes in a route table.
call to List operation. will be added to the HTTP request.
510 511 512 513 |
# File 'lib/azure_mgmt_network/routes.rb', line 510 def list_next(next_page_link, custom_headers = nil) response = list_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end |
#list_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise
The List network security rule opertion retrieves all the routes in a route table.
call to List operation. to the HTTP request.
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 |
# File 'lib/azure_mgmt_network/routes.rb', line 541 def list_next_async(next_page_link, custom_headers = nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, headers: request_headers.merge(custom_headers || {}) } request_url = @base_url || @client.base_url request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, ) promise = request.run_promise do |req| @client.credentials.sign_request(req) unless @client.credentials.nil? end promise = promise.then do |http_response| status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.new(request, http_response, error_model) end # Create Result result = MsRestAzure::AzureOperationResponse.new(request, http_response) result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) unless parsed_response.nil? parsed_response = RouteListResult.deserialize_object(parsed_response) end result.body = parsed_response rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The List network security rule opertion retrieves all the routes in a route table.
call to List operation. will be added to the HTTP request.
526 527 528 |
# File 'lib/azure_mgmt_network/routes.rb', line 526 def list_next_with_http_info(next_page_link, custom_headers = nil) list_next_async(next_page_link, custom_headers).value! end |
#list_with_http_info(resource_group_name, route_table_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The List network security rule opertion retrieves all the routes in a route table.
will be added to the HTTP request.
429 430 431 |
# File 'lib/azure_mgmt_network/routes.rb', line 429 def list_with_http_info(resource_group_name, route_table_name, custom_headers = nil) list_async(resource_group_name, route_table_name, custom_headers).value! end |