Class: Azure::Network::Mgmt::V2018_08_01::ConnectionMonitors
- Inherits:
-
Object
- Object
- Azure::Network::Mgmt::V2018_08_01::ConnectionMonitors
- Includes:
- MsRestAzure
- Defined in:
- lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb
Overview
ConnectionMonitors
Instance Attribute Summary collapse
-
#client ⇒ NetworkManagementClient
readonly
Reference to the NetworkManagementClient.
Instance Method Summary collapse
-
#begin_create_or_update(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ ConnectionMonitorResult
Create or update a connection monitor.
-
#begin_create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Create or update a connection monitor.
-
#begin_create_or_update_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create or update a connection monitor.
-
#begin_delete(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Deletes the specified connection monitor.
-
#begin_delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes the specified connection monitor.
-
#begin_delete_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes the specified connection monitor.
-
#begin_query(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ ConnectionMonitorQueryResult
Query a snapshot of the most recent connection states.
-
#begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Query a snapshot of the most recent connection states.
-
#begin_query_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Query a snapshot of the most recent connection states.
-
#begin_start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Starts the specified connection monitor.
-
#begin_start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Starts the specified connection monitor.
-
#begin_start_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Starts the specified connection monitor.
-
#begin_stop(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Stops the specified connection monitor.
-
#begin_stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Stops the specified connection monitor.
-
#begin_stop_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Stops the specified connection monitor.
-
#create_or_update(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ ConnectionMonitorResult
Create or update a connection monitor.
-
#create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher.
-
#delete(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Deletes the specified connection monitor.
-
#delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher.
-
#get(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ ConnectionMonitorResult
Gets a connection monitor by name.
-
#get_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets a connection monitor by name.
-
#get_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a connection monitor by name.
-
#initialize(client) ⇒ ConnectionMonitors
constructor
Creates and initializes a new instance of the ConnectionMonitors class.
-
#list(resource_group_name, network_watcher_name, custom_headers: nil) ⇒ ConnectionMonitorListResult
Lists all connection monitors for the specified Network Watcher.
-
#list_async(resource_group_name, network_watcher_name, custom_headers: nil) ⇒ Concurrent::Promise
Lists all connection monitors for the specified Network Watcher.
-
#list_with_http_info(resource_group_name, network_watcher_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all connection monitors for the specified Network Watcher.
-
#query(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ ConnectionMonitorQueryResult
Query a snapshot of the most recent connection states.
-
#query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher.
-
#start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Starts the specified connection monitor.
-
#start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher.
-
#stop(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Stops the specified connection monitor.
-
#stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher.
Constructor Details
#initialize(client) ⇒ ConnectionMonitors
Creates and initializes a new instance of the ConnectionMonitors class.
17 18 19 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ NetworkManagementClient (readonly)
Returns reference to the NetworkManagementClient.
22 23 24 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 22 def client @client end |
Instance Method Details
#begin_create_or_update(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ ConnectionMonitorResult
Create or update a connection monitor.
Network Watcher. resource. create a connection monitor. will be added to the HTTP request.
477 478 479 480 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 477 def begin_create_or_update(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:nil) response = begin_create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Create or update a connection monitor.
Network Watcher. resource. create a connection monitor. to the HTTP request.
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 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 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 516 def begin_create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'connection_monitor_name is nil' if connection_monitor_name.nil? fail ArgumentError, 'parameters is nil' if 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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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_mapper = Azure::Network::Mgmt::V2018_08_01::Models::ConnectionMonitor.mapper() request_content = @client.serialize(request_mapper, parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'connectionMonitorName' => connection_monitor_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:put, path_template, ) promise = promise.then do |result| http_response = result.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 MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::ConnectionMonitorResult.mapper() result.body = @client.deserialize(result_mapper, 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) result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::ConnectionMonitorResult.mapper() result.body = @client.deserialize(result_mapper, 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, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create or update a connection monitor.
Network Watcher. resource. create a connection monitor. will be added to the HTTP request.
497 498 499 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 497 def begin_create_or_update_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:nil) begin_create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:custom_headers).value! end |
#begin_delete(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Deletes the specified connection monitor.
Network Watcher. resource. will be added to the HTTP request.
602 603 604 605 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 602 def begin_delete(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = begin_delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! nil end |
#begin_delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Deletes the specified connection monitor.
Network Watcher. resource. to the HTTP request.
637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 637 def begin_delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'connection_monitor_name is nil' if connection_monitor_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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'connectionMonitorName' => connection_monitor_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:delete, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 204 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_delete_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Deletes the specified connection monitor.
Network Watcher. resource. will be added to the HTTP request.
620 621 622 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 620 def begin_delete_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) begin_delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! end |
#begin_query(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ ConnectionMonitorQueryResult
Query a snapshot of the most recent connection states.
Network Watcher. resource. monitor. will be added to the HTTP request.
883 884 885 886 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 883 def begin_query(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Query a snapshot of the most recent connection states.
Network Watcher. resource. monitor. to the HTTP request.
920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 920 def begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'connection_monitor_name is nil' if connection_monitor_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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'connectionMonitorName' => connection_monitor_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::ConnectionMonitorQueryResult.mapper() result.body = @client.deserialize(result_mapper, 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 == 202 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::ConnectionMonitorQueryResult.mapper() result.body = @client.deserialize(result_mapper, 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_query_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Query a snapshot of the most recent connection states.
Network Watcher. resource. monitor. will be added to the HTTP request.
902 903 904 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 902 def begin_query_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! end |
#begin_start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Starts the specified connection monitor.
Network Watcher. resource. will be added to the HTTP request.
788 789 790 791 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 788 def begin_start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = begin_start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! nil end |
#begin_start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Starts the specified connection monitor.
Network Watcher. resource. to the HTTP request.
823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 823 def begin_start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'connection_monitor_name is nil' if connection_monitor_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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/start' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'connectionMonitorName' => connection_monitor_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_start_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Starts the specified connection monitor.
Network Watcher. resource. will be added to the HTTP request.
806 807 808 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 806 def begin_start_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) begin_start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! end |
#begin_stop(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Stops the specified connection monitor.
Network Watcher. resource. will be added to the HTTP request.
695 696 697 698 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 695 def begin_stop(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = begin_stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! nil end |
#begin_stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Stops the specified connection monitor.
Network Watcher. resource. to the HTTP request.
730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 730 def begin_stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'connection_monitor_name is nil' if connection_monitor_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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/stop' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'connectionMonitorName' => connection_monitor_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:post, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 202 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? result end promise.execute end |
#begin_stop_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Stops the specified connection monitor.
Network Watcher. resource. will be added to the HTTP request.
713 714 715 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 713 def begin_stop_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) begin_stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! end |
#create_or_update(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ ConnectionMonitorResult
Create or update a connection monitor.
Network Watcher. resource. create a connection monitor. will be added to the HTTP request.
39 40 41 42 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 39 def create_or_update(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher. resource. create a connection monitor. will be added to the HTTP request.
response.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 58 def create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:nil) # Send request promise = begin_create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::ConnectionMonitorResult.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#delete(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Deletes the specified connection monitor.
Network Watcher. resource. will be added to the HTTP request.
191 192 193 194 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 191 def delete(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! nil end |
#delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher. resource. will be added to the HTTP request.
response.
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 208 def delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) # Send request promise = begin_delete_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: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, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ ConnectionMonitorResult
Gets a connection monitor by name.
Network Watcher. resource. will be added to the HTTP request.
89 90 91 92 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 89 def get(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = get_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Gets a connection monitor by name.
Network Watcher. resource. to the HTTP request.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 124 def get_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_name.nil? fail ArgumentError, 'connection_monitor_name is nil' if connection_monitor_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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'connectionMonitorName' => connection_monitor_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::ConnectionMonitorResult.mapper() result.body = @client.deserialize(result_mapper, 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, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a connection monitor by name.
Network Watcher. resource. will be added to the HTTP request.
107 108 109 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 107 def get_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) get_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! end |
#list(resource_group_name, network_watcher_name, custom_headers: nil) ⇒ ConnectionMonitorListResult
Lists all connection monitors for the specified Network Watcher.
Network Watcher. resource. will be added to the HTTP request.
374 375 376 377 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 374 def list(resource_group_name, network_watcher_name, custom_headers:nil) response = list_async(resource_group_name, network_watcher_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_async(resource_group_name, network_watcher_name, custom_headers: nil) ⇒ Concurrent::Promise
Lists all connection monitors for the specified Network Watcher.
Network Watcher. resource. to the HTTP request.
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 407 def list_async(resource_group_name, network_watcher_name, custom_headers:nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'network_watcher_name is nil' if network_watcher_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 = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # 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/networkWatchers/{networkWatcherName}/connectionMonitors' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'networkWatcherName' => network_watcher_name,'subscriptionId' => @client.subscription_id}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:get, path_template, ) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil? result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::ConnectionMonitorListResult.mapper() result.body = @client.deserialize(result_mapper, 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_with_http_info(resource_group_name, network_watcher_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all connection monitors for the specified Network Watcher.
Network Watcher. resource. will be added to the HTTP request.
391 392 393 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 391 def list_with_http_info(resource_group_name, network_watcher_name, custom_headers:nil) list_async(resource_group_name, network_watcher_name, custom_headers:custom_headers).value! end |
#query(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ ConnectionMonitorQueryResult
Query a snapshot of the most recent connection states.
Network Watcher. resource. monitor. will be added to the HTTP request.
326 327 328 329 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 326 def query(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher. resource. monitor. will be added to the HTTP request.
response.
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 344 def query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) # Send request promise = begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::ConnectionMonitorQueryResult.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Starts the specified connection monitor.
Network Watcher. resource. will be added to the HTTP request.
279 280 281 282 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 279 def start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! nil end |
#start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher. resource. will be added to the HTTP request.
response.
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 296 def start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) # Send request promise = begin_start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: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 |
#stop(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Object
Stops the specified connection monitor.
Network Watcher. resource. will be added to the HTTP request.
235 236 237 238 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 235 def stop(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! nil end |
#stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: nil) ⇒ Concurrent::Promise
Network Watcher. resource. will be added to the HTTP request.
response.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/2018-08-01/generated/azure_mgmt_network/connection_monitors.rb', line 252 def stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) # Send request promise = begin_stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers: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 |