Class: Azure::ServerManagement::Mgmt::V2016_07_01_preview::PowerShell
- Inherits:
-
Object
- Object
- Azure::ServerManagement::Mgmt::V2016_07_01_preview::PowerShell
- Includes:
- MsRestAzure
- Defined in:
- lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb
Overview
REST API for Azure Server Management Service.
Instance Attribute Summary collapse
-
#client ⇒ ServerManagement
readonly
Reference to the ServerManagement.
Instance Method Summary collapse
-
#begin_cancel_command(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellCommandResults
Cancels a PowerShell command.
-
#begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
Cancels a PowerShell command.
-
#begin_cancel_command_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Cancels a PowerShell command.
-
#begin_create_session(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellSessionResource
Creates a PowerShell session.
-
#begin_create_session_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
Creates a PowerShell session.
-
#begin_create_session_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a PowerShell session.
-
#begin_invoke_command(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ PowerShellCommandResults
Creates a PowerShell script and invokes it.
-
#begin_invoke_command_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ Concurrent::Promise
Creates a PowerShell script and invokes it.
-
#begin_invoke_command_with_http_info(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a PowerShell script and invokes it.
-
#begin_update_command(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellCommandResults
Updates a running PowerShell command with more data.
-
#begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
Updates a running PowerShell command with more data.
-
#begin_update_command_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Updates a running PowerShell command with more data.
-
#cancel_command(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellCommandResults
Cancels a PowerShell command.
-
#cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId.
-
#create_session(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellSessionResource
Creates a PowerShell session.
-
#create_session_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId.
-
#get_command_status(resource_group_name, node_name, session, pssession, expand = nil, custom_headers = nil) ⇒ PowerShellCommandStatus
Gets the status of a command.
-
#get_command_status_async(resource_group_name, node_name, session, pssession, expand = nil, custom_headers = nil) ⇒ Concurrent::Promise
Gets the status of a command.
-
#get_command_status_with_http_info(resource_group_name, node_name, session, pssession, expand = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the status of a command.
-
#initialize(client) ⇒ PowerShell
constructor
Creates and initializes a new instance of the PowerShell class.
-
#invoke_command(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ PowerShellCommandResults
Creates a PowerShell script and invokes it.
-
#invoke_command_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId.
-
#list_session(resource_group_name, node_name, session, custom_headers = nil) ⇒ PowerShellSessionResources
Gets a list of the active sessions.
-
#list_session_async(resource_group_name, node_name, session, custom_headers = nil) ⇒ Concurrent::Promise
Gets a list of the active sessions.
-
#list_session_with_http_info(resource_group_name, node_name, session, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a list of the active sessions.
-
#tab_completion(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ PowerShellTabCompletionResults
Gets tab completion values for a command.
-
#tab_completion_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ Concurrent::Promise
Gets tab completion values for a command.
-
#tab_completion_with_http_info(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets tab completion values for a command.
-
#update_command(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellCommandResults
Updates a running PowerShell command with more data.
-
#update_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId.
Constructor Details
#initialize(client) ⇒ PowerShell
Creates and initializes a new instance of the PowerShell class.
17 18 19 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ ServerManagement (readonly)
Returns reference to the ServerManagement.
22 23 24 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 22 def client @client end |
Instance Method Details
#begin_cancel_command(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellCommandResults
Cancels a PowerShell command.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
907 908 909 910 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 907 def begin_cancel_command(resource_group_name, node_name, session, pssession, custom_headers = nil) response = begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers).value! response.body unless response.nil? end |
#begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
Cancels a PowerShell command.
identifies the resource group within the user subscriptionId. to the HTTP request.
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 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 942 def begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'node_name is nil' if node_name.nil? fail ArgumentError, "'node_name' should satisfy the constraint - 'MaxLength': '256'" if !node_name.nil? && node_name.length > 256 fail ArgumentError, "'node_name' should satisfy the constraint - 'MinLength': '1'" if !node_name.nil? && node_name.length < 1 fail ArgumentError, "'node_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !node_name.nil? && node_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? fail ArgumentError, 'session is nil' if session.nil? fail ArgumentError, 'pssession is nil' if pssession.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.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/cancel' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession}, 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? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellCommandResults.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_cancel_command_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Cancels a PowerShell command.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
925 926 927 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 925 def begin_cancel_command_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil) begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers).value! end |
#begin_create_session(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellSessionResource
Creates a PowerShell session.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
570 571 572 573 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 570 def begin_create_session(resource_group_name, node_name, session, pssession, custom_headers = nil) response = begin_create_session_async(resource_group_name, node_name, session, pssession, custom_headers).value! response.body unless response.nil? end |
#begin_create_session_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
Creates a PowerShell session.
identifies the resource group within the user subscriptionId. to the HTTP request.
605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 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 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 605 def begin_create_session_async(resource_group_name, node_name, session, pssession, custom_headers = nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'node_name is nil' if node_name.nil? fail ArgumentError, "'node_name' should satisfy the constraint - 'MaxLength': '256'" if !node_name.nil? && node_name.length > 256 fail ArgumentError, "'node_name' should satisfy the constraint - 'MinLength': '1'" if !node_name.nil? && node_name.length < 1 fail ArgumentError, "'node_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !node_name.nil? && node_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? fail ArgumentError, 'session is nil' if session.nil? fail ArgumentError, 'pssession is nil' if pssession.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.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession}, query_params: {'api-version' => @client.api_version}, 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 == 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? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellSessionResource.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_session_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a PowerShell session.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
588 589 590 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 588 def begin_create_session_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil) begin_create_session_async(resource_group_name, node_name, session, pssession, custom_headers).value! end |
#begin_invoke_command(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ PowerShellCommandResults
Creates a PowerShell script and invokes it.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
785 786 787 788 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 785 def begin_invoke_command(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) response = begin_invoke_command_async(resource_group_name, node_name, session, pssession, command, custom_headers).value! response.body unless response.nil? end |
#begin_invoke_command_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ Concurrent::Promise
Creates a PowerShell script and invokes it.
identifies the resource group within the user subscriptionId. to the HTTP request.
822 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 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 822 def begin_invoke_command_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'node_name is nil' if node_name.nil? fail ArgumentError, "'node_name' should satisfy the constraint - 'MaxLength': '256'" if !node_name.nil? && node_name.length > 256 fail ArgumentError, "'node_name' should satisfy the constraint - 'MinLength': '1'" if !node_name.nil? && node_name.length < 1 fail ArgumentError, "'node_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !node_name.nil? && node_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? fail ArgumentError, 'session is nil' if session.nil? fail ArgumentError, 'pssession is nil' if pssession.nil? power_shell_command_parameters = PowerShellCommandParameters.new unless command.nil? power_shell_command_parameters.command = command end 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? request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request request_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellCommandParameters.mapper() request_content = @client.serialize(request_mapper, power_shell_command_parameters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/invokeCommand' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession}, 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(: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? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellCommandResults.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_invoke_command_with_http_info(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Creates a PowerShell script and invokes it.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
804 805 806 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 804 def begin_invoke_command_with_http_info(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) begin_invoke_command_async(resource_group_name, node_name, session, pssession, command, custom_headers).value! end |
#begin_update_command(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellCommandResults
Updates a running PowerShell command with more data.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
677 678 679 680 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 677 def begin_update_command(resource_group_name, node_name, session, pssession, custom_headers = nil) response = begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers).value! response.body unless response.nil? end |
#begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
Updates a running PowerShell command with more data.
identifies the resource group within the user subscriptionId. to the HTTP request.
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 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 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 712 def begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'node_name is nil' if node_name.nil? fail ArgumentError, "'node_name' should satisfy the constraint - 'MaxLength': '256'" if !node_name.nil? && node_name.length > 256 fail ArgumentError, "'node_name' should satisfy the constraint - 'MinLength': '1'" if !node_name.nil? && node_name.length < 1 fail ArgumentError, "'node_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !node_name.nil? && node_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? fail ArgumentError, 'session is nil' if session.nil? fail ArgumentError, 'pssession is nil' if pssession.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.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession}, query_params: {'api-version' => @client.api_version}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = @client.make_request_async(:patch, 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? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellCommandResults.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_update_command_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Updates a running PowerShell command with more data.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
695 696 697 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 695 def begin_update_command_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil) begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers).value! end |
#cancel_command(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellCommandResults
Cancels a PowerShell command.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
399 400 401 402 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 399 def cancel_command(resource_group_name, node_name, session, pssession, custom_headers = nil) response = cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers).value! response.body unless response.nil? end |
#cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
response.
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 416 def cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) # Send request promise = begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellCommandResults.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 |
#create_session(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellSessionResource
Creates a PowerShell session.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
140 141 142 143 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 140 def create_session(resource_group_name, node_name, session, pssession, custom_headers = nil) response = create_session_async(resource_group_name, node_name, session, pssession, custom_headers).value! response.body unless response.nil? end |
#create_session_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
response.
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 157 def create_session_async(resource_group_name, node_name, session, pssession, custom_headers = nil) # Send request promise = begin_create_session_async(resource_group_name, node_name, session, pssession, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellSessionResource.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 |
#get_command_status(resource_group_name, node_name, session, pssession, expand = nil, custom_headers = nil) ⇒ PowerShellCommandStatus
Gets the status of a command.
identifies the resource group within the user subscriptionId. call. Possible values include: ‘output’ will be added to the HTTP request.
190 191 192 193 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 190 def get_command_status(resource_group_name, node_name, session, pssession, = nil, custom_headers = nil) response = get_command_status_async(resource_group_name, node_name, session, pssession, , custom_headers).value! response.body unless response.nil? end |
#get_command_status_async(resource_group_name, node_name, session, pssession, expand = nil, custom_headers = nil) ⇒ Concurrent::Promise
Gets the status of a command.
identifies the resource group within the user subscriptionId. call. Possible values include: ‘output’ to the HTTP request.
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 229 def get_command_status_async(resource_group_name, node_name, session, pssession, = nil, custom_headers = nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'node_name is nil' if node_name.nil? fail ArgumentError, "'node_name' should satisfy the constraint - 'MaxLength': '256'" if !node_name.nil? && node_name.length > 256 fail ArgumentError, "'node_name' should satisfy the constraint - 'MinLength': '1'" if !node_name.nil? && node_name.length < 1 fail ArgumentError, "'node_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !node_name.nil? && node_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? fail ArgumentError, 'session is nil' if session.nil? fail ArgumentError, 'pssession is nil' if pssession.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.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession}, query_params: {'api-version' => @client.api_version,'$expand' => }, 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? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellCommandStatus.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_command_status_with_http_info(resource_group_name, node_name, session, pssession, expand = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the status of a command.
identifies the resource group within the user subscriptionId. call. Possible values include: ‘output’ will be added to the HTTP request.
210 211 212 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 210 def get_command_status_with_http_info(resource_group_name, node_name, session, pssession, = nil, custom_headers = nil) get_command_status_async(resource_group_name, node_name, session, pssession, , custom_headers).value! end |
#invoke_command(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ PowerShellCommandResults
Creates a PowerShell script and invokes it.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
350 351 352 353 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 350 def invoke_command(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) response = invoke_command_async(resource_group_name, node_name, session, pssession, command, custom_headers).value! response.body unless response.nil? end |
#invoke_command_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
response.
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 368 def invoke_command_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) # Send request promise = begin_invoke_command_async(resource_group_name, node_name, session, pssession, command, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellCommandResults.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 |
#list_session(resource_group_name, node_name, session, custom_headers = nil) ⇒ PowerShellSessionResources
Gets a list of the active sessions.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
36 37 38 39 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 36 def list_session(resource_group_name, node_name, session, custom_headers = nil) response = list_session_async(resource_group_name, node_name, session, custom_headers).value! response.body unless response.nil? end |
#list_session_async(resource_group_name, node_name, session, custom_headers = nil) ⇒ Concurrent::Promise
Gets a list of the active sessions.
identifies the resource group within the user subscriptionId. to the HTTP request.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 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 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 69 def list_session_async(resource_group_name, node_name, session, custom_headers = nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'node_name is nil' if node_name.nil? fail ArgumentError, "'node_name' should satisfy the constraint - 'MaxLength': '256'" if !node_name.nil? && node_name.length > 256 fail ArgumentError, "'node_name' should satisfy the constraint - 'MinLength': '1'" if !node_name.nil? && node_name.length < 1 fail ArgumentError, "'node_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !node_name.nil? && node_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? fail ArgumentError, 'session is nil' if session.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.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session}, 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? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellSessionResources.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_session_with_http_info(resource_group_name, node_name, session, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets a list of the active sessions.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
53 54 55 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 53 def list_session_with_http_info(resource_group_name, node_name, session, custom_headers = nil) list_session_async(resource_group_name, node_name, session, custom_headers).value! end |
#tab_completion(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ PowerShellTabCompletionResults
Gets tab completion values for a command.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
448 449 450 451 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 448 def tab_completion(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) response = tab_completion_async(resource_group_name, node_name, session, pssession, command, custom_headers).value! response.body unless response.nil? end |
#tab_completion_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ Concurrent::Promise
Gets tab completion values for a command.
identifies the resource group within the user subscriptionId. to the HTTP request.
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 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 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 485 def tab_completion_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '3'" if !resource_group_name.nil? && resource_group_name.length < 3 fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9]+'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^[a-zA-Z0-9]+$')).nil? fail ArgumentError, 'node_name is nil' if node_name.nil? fail ArgumentError, "'node_name' should satisfy the constraint - 'MaxLength': '256'" if !node_name.nil? && node_name.length > 256 fail ArgumentError, "'node_name' should satisfy the constraint - 'MinLength': '1'" if !node_name.nil? && node_name.length < 1 fail ArgumentError, "'node_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'" if !node_name.nil? && node_name.match(Regexp.new('^^[a-zA-Z0-9][a-zA-Z0-9_.-]*$$')).nil? fail ArgumentError, 'session is nil' if session.nil? fail ArgumentError, 'pssession is nil' if pssession.nil? power_shell_tab_completion_paramters = PowerShellTabCompletionParameters.new unless command.nil? power_shell_tab_completion_paramters.command = command end 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? request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request request_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellTabCompletionParameters.mapper() request_content = @client.serialize(request_mapper, power_shell_tab_completion_paramters) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/tab' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession}, 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(: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 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? # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellTabCompletionResults.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 |
#tab_completion_with_http_info(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Gets tab completion values for a command.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
467 468 469 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 467 def tab_completion_with_http_info(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil) tab_completion_async(resource_group_name, node_name, session, pssession, command, custom_headers).value! end |
#update_command(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ PowerShellCommandResults
Updates a running PowerShell command with more data.
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
301 302 303 304 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 301 def update_command(resource_group_name, node_name, session, pssession, custom_headers = nil) response = update_command_async(resource_group_name, node_name, session, pssession, custom_headers).value! response.body unless response.nil? end |
#update_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) ⇒ Concurrent::Promise
identifies the resource group within the user subscriptionId. will be added to the HTTP request.
response.
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/2016-07-01-preview/generated/azure_mgmt_server_management/power_shell.rb', line 318 def update_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil) # Send request promise = begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::ServerManagement::Mgmt::V2016_07_01_preview::Models::PowerShellCommandResults.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 |