Class: Azure::Compute::Mgmt::V2015_06_15::VirtualMachines
- Inherits:
-
Object
- Object
- Azure::Compute::Mgmt::V2015_06_15::VirtualMachines
- Includes:
- MsRestAzure
- Defined in:
- lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb
Overview
Compute Client
Instance Attribute Summary collapse
-
#client ⇒ ComputeManagementClient
readonly
Reference to the ComputeManagementClient.
Instance Method Summary collapse
-
#begin_capture(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ VirtualMachineCaptureResult
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
-
#begin_capture_async(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
-
#begin_capture_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
-
#begin_create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ VirtualMachine
The operation to create or update a virtual machine.
-
#begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The operation to create or update a virtual machine.
-
#begin_create_or_update_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to create or update a virtual machine.
-
#begin_deallocate(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
Shuts down the virtual machine and releases the compute resources.
-
#begin_deallocate_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
Shuts down the virtual machine and releases the compute resources.
-
#begin_deallocate_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Shuts down the virtual machine and releases the compute resources.
-
#begin_delete(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to delete a virtual machine.
-
#begin_delete_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to delete a virtual machine.
-
#begin_delete_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to delete a virtual machine.
-
#begin_power_off(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to power off (stop) a virtual machine.
-
#begin_power_off_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to power off (stop) a virtual machine.
-
#begin_power_off_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to power off (stop) a virtual machine.
-
#begin_redeploy(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to redeploy a virtual machine.
-
#begin_redeploy_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to redeploy a virtual machine.
-
#begin_redeploy_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to redeploy a virtual machine.
-
#begin_restart(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to restart a virtual machine.
-
#begin_restart_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to restart a virtual machine.
-
#begin_restart_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to restart a virtual machine.
-
#begin_start(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to start a virtual machine.
-
#begin_start_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to start a virtual machine.
-
#begin_start_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to start a virtual machine.
-
#capture(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ VirtualMachineCaptureResult
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
-
#capture_async(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
the Capture Virtual Machine operation.
-
#create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ VirtualMachine
The operation to create or update a virtual machine.
-
#create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
Machine operation.
-
#deallocate(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
Shuts down the virtual machine and releases the compute resources.
-
#deallocate_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#delete(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to delete a virtual machine.
-
#delete_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#generalize(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
Sets the state of the virtual machine to generalized.
-
#generalize_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
Sets the state of the virtual machine to generalized.
-
#generalize_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Sets the state of the virtual machine to generalized.
-
#get(resource_group_name, vm_name, expand = nil, custom_headers = nil) ⇒ VirtualMachine
Retrieves information about the model view or the instance view of a virtual machine.
-
#get_async(resource_group_name, vm_name, expand = nil, custom_headers = nil) ⇒ Concurrent::Promise
Retrieves information about the model view or the instance view of a virtual machine.
-
#get_with_http_info(resource_group_name, vm_name, expand = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Retrieves information about the model view or the instance view of a virtual machine.
-
#initialize(client) ⇒ VirtualMachines
constructor
Creates and initializes a new instance of the VirtualMachines class.
-
#list(resource_group_name, custom_headers = nil) ⇒ Array<VirtualMachine>
Lists all of the virtual machines in the specified resource group.
-
#list_all(custom_headers = nil) ⇒ Array<VirtualMachine>
Lists all of the virtual machines in the specified subscription.
-
#list_all_as_lazy(custom_headers = nil) ⇒ VirtualMachineListResult
Lists all of the virtual machines in the specified subscription.
-
#list_all_async(custom_headers = nil) ⇒ Concurrent::Promise
Lists all of the virtual machines in the specified subscription.
-
#list_all_next(next_page_link, custom_headers = nil) ⇒ VirtualMachineListResult
Lists all of the virtual machines in the specified subscription.
-
#list_all_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise
Lists all of the virtual machines in the specified subscription.
-
#list_all_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the virtual machines in the specified subscription.
-
#list_all_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the virtual machines in the specified subscription.
-
#list_as_lazy(resource_group_name, custom_headers = nil) ⇒ VirtualMachineListResult
Lists all of the virtual machines in the specified resource group.
-
#list_async(resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise
Lists all of the virtual machines in the specified resource group.
-
#list_available_sizes(resource_group_name, vm_name, custom_headers = nil) ⇒ VirtualMachineSizeListResult
Lists all available virtual machine sizes to which the specified virtual machine can be resized.
-
#list_available_sizes_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
Lists all available virtual machine sizes to which the specified virtual machine can be resized.
-
#list_available_sizes_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all available virtual machine sizes to which the specified virtual machine can be resized.
-
#list_next(next_page_link, custom_headers = nil) ⇒ VirtualMachineListResult
Lists all of the virtual machines in the specified resource group.
-
#list_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise
Lists all of the virtual machines in the specified resource group.
-
#list_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the virtual machines in the specified resource group.
-
#list_with_http_info(resource_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the virtual machines in the specified resource group.
-
#power_off(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to power off (stop) a virtual machine.
-
#power_off_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#redeploy(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to redeploy a virtual machine.
-
#redeploy_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#restart(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to restart a virtual machine.
-
#restart_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#start(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to start a virtual machine.
-
#start_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
Constructor Details
#initialize(client) ⇒ VirtualMachines
Creates and initializes a new instance of the VirtualMachines class.
17 18 19 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ ComputeManagementClient (readonly)
Returns reference to the ComputeManagementClient.
22 23 24 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 22 def client @client end |
Instance Method Details
#begin_capture(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ VirtualMachineCaptureResult
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
the Capture Virtual Machine operation. will be added to the HTTP request.
846 847 848 849 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 846 def begin_capture(resource_group_name, vm_name, parameters, custom_headers = nil) response = begin_capture_async(resource_group_name, vm_name, parameters, custom_headers).value! response.body unless response.nil? end |
#begin_capture_async(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
the Capture Virtual Machine operation. to the HTTP request.
881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 881 def begin_capture_async(resource_group_name, vm_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_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 = {} # 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::Compute::Mgmt::V2015_06_15::Models::VirtualMachineCaptureParameters.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.Compute/virtualMachines/{vmName}/capture' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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(: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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::VirtualMachineCaptureResult.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_capture_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
the Capture Virtual Machine operation. will be added to the HTTP request.
864 865 866 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 864 def begin_capture_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil) begin_capture_async(resource_group_name, vm_name, parameters, custom_headers).value! end |
#begin_create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ VirtualMachine
The operation to create or update a virtual machine.
Machine operation. will be added to the HTTP request.
955 956 957 958 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 955 def begin_create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil) response = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value! response.body unless response.nil? end |
#begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
The operation to create or update a virtual machine.
Machine operation. to the HTTP request.
988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 988 def begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_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 = {} # 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::Compute::Mgmt::V2015_06_15::Models::VirtualMachine.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.Compute/virtualMachines/{vmName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::VirtualMachine.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::Compute::Mgmt::V2015_06_15::Models::VirtualMachine.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, vm_name, parameters, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to create or update a virtual machine.
Machine operation. will be added to the HTTP request.
972 973 974 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 972 def begin_create_or_update_with_http_info(resource_group_name, vm_name, parameters, custom_headers = nil) begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value! end |
#begin_deallocate(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses.
will be added to the HTTP request.
1162 1163 1164 1165 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1162 def begin_deallocate(resource_group_name, vm_name, custom_headers = nil) response = begin_deallocate_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#begin_deallocate_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses.
to the HTTP request.
1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1193 def begin_deallocate_async(resource_group_name, vm_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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_deallocate_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses.
will be added to the HTTP request.
1178 1179 1180 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1178 def begin_deallocate_with_http_info(resource_group_name, vm_name, custom_headers = nil) begin_deallocate_async(resource_group_name, vm_name, custom_headers).value! end |
#begin_delete(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to delete a virtual machine.
will be added to the HTTP request.
1070 1071 1072 1073 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1070 def begin_delete(resource_group_name, vm_name, custom_headers = nil) response = begin_delete_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#begin_delete_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to delete a virtual machine.
to the HTTP request.
1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1099 def begin_delete_async(resource_group_name, vm_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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 == 200 || status_code == 202 || status_code == 204 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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_delete_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to delete a virtual machine.
will be added to the HTTP request.
1085 1086 1087 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1085 def begin_delete_with_http_info(resource_group_name, vm_name, custom_headers = nil) begin_delete_async(resource_group_name, vm_name, custom_headers).value! end |
#begin_power_off(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine.
will be added to the HTTP request.
1257 1258 1259 1260 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1257 def begin_power_off(resource_group_name, vm_name, custom_headers = nil) response = begin_power_off_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#begin_power_off_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine.
to the HTTP request.
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1290 def begin_power_off_async(resource_group_name, vm_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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_power_off_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine.
will be added to the HTTP request.
1274 1275 1276 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1274 def begin_power_off_with_http_info(resource_group_name, vm_name, custom_headers = nil) begin_power_off_async(resource_group_name, vm_name, custom_headers).value! end |
#begin_redeploy(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to redeploy a virtual machine.
will be added to the HTTP request.
1534 1535 1536 1537 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1534 def begin_redeploy(resource_group_name, vm_name, custom_headers = nil) response = begin_redeploy_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#begin_redeploy_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to redeploy a virtual machine.
to the HTTP request.
1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1563 def begin_redeploy_async(resource_group_name, vm_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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_redeploy_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to redeploy a virtual machine.
will be added to the HTTP request.
1549 1550 1551 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1549 def begin_redeploy_with_http_info(resource_group_name, vm_name, custom_headers = nil) begin_redeploy_async(resource_group_name, vm_name, custom_headers).value! end |
#begin_restart(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to restart a virtual machine.
will be added to the HTTP request.
1352 1353 1354 1355 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1352 def begin_restart(resource_group_name, vm_name, custom_headers = nil) response = begin_restart_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#begin_restart_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to restart a virtual machine.
to the HTTP request.
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1381 def begin_restart_async(resource_group_name, vm_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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_restart_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to restart a virtual machine.
will be added to the HTTP request.
1367 1368 1369 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1367 def begin_restart_with_http_info(resource_group_name, vm_name, custom_headers = nil) begin_restart_async(resource_group_name, vm_name, custom_headers).value! end |
#begin_start(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to start a virtual machine.
will be added to the HTTP request.
1443 1444 1445 1446 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1443 def begin_start(resource_group_name, vm_name, custom_headers = nil) response = begin_start_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#begin_start_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
The operation to start a virtual machine.
to the HTTP request.
1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1472 def begin_start_async(resource_group_name, vm_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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_start_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
The operation to start a virtual machine.
will be added to the HTTP request.
1458 1459 1460 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1458 def begin_start_with_http_info(resource_group_name, vm_name, custom_headers = nil) begin_start_async(resource_group_name, vm_name, custom_headers).value! end |
#capture(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ VirtualMachineCaptureResult
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
the Capture Virtual Machine operation. will be added to the HTTP request.
37 38 39 40 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 37 def capture(resource_group_name, vm_name, parameters, custom_headers = nil) response = capture_async(resource_group_name, vm_name, parameters, custom_headers).value! response.body unless response.nil? end |
#capture_async(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
the Capture Virtual Machine operation. will be added to the HTTP request.
response.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 53 def capture_async(resource_group_name, vm_name, parameters, custom_headers = nil) # Send request promise = begin_capture_async(resource_group_name, vm_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Compute::Mgmt::V2015_06_15::Models::VirtualMachineCaptureResult.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_or_update(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ VirtualMachine
The operation to create or update a virtual machine.
Machine operation. will be added to the HTTP request.
83 84 85 86 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 83 def create_or_update(resource_group_name, vm_name, parameters, custom_headers = nil) response = create_or_update_async(resource_group_name, vm_name, parameters, custom_headers).value! response.body unless response.nil? end |
#create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil) ⇒ Concurrent::Promise
Machine operation. will be added to the HTTP request.
response.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 99 def create_or_update_async(resource_group_name, vm_name, parameters, custom_headers = nil) # Send request promise = begin_create_or_update_async(resource_group_name, vm_name, parameters, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Compute::Mgmt::V2015_06_15::Models::VirtualMachine.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 |
#deallocate(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses.
will be added to the HTTP request.
270 271 272 273 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 270 def deallocate(resource_group_name, vm_name, custom_headers = nil) response = deallocate_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#deallocate_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 284 def deallocate_async(resource_group_name, vm_name, custom_headers = nil) # Send request promise = begin_deallocate_async(resource_group_name, vm_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to delete a virtual machine.
will be added to the HTTP request.
127 128 129 130 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 127 def delete(resource_group_name, vm_name, custom_headers = nil) response = delete_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#delete_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 141 def delete_async(resource_group_name, vm_name, custom_headers = nil) # Send request promise = begin_delete_async(resource_group_name, vm_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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 |
#generalize(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
Sets the state of the virtual machine to generalized.
will be added to the HTTP request.
312 313 314 315 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 312 def generalize(resource_group_name, vm_name, custom_headers = nil) response = generalize_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#generalize_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
Sets the state of the virtual machine to generalized.
to the HTTP request.
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 341 def generalize_async(resource_group_name, vm_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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 error_model = JSON.load(response_content) fail MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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 |
#generalize_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Sets the state of the virtual machine to generalized.
will be added to the HTTP request.
327 328 329 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 327 def generalize_with_http_info(resource_group_name, vm_name, custom_headers = nil) generalize_async(resource_group_name, vm_name, custom_headers).value! end |
#get(resource_group_name, vm_name, expand = nil, custom_headers = nil) ⇒ VirtualMachine
Retrieves information about the model view or the instance view of a virtual machine.
operation. Possible values include: ‘instanceView’ will be added to the HTTP request.
172 173 174 175 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 172 def get(resource_group_name, vm_name, = nil, custom_headers = nil) response = get_async(resource_group_name, vm_name, , custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, vm_name, expand = nil, custom_headers = nil) ⇒ Concurrent::Promise
Retrieves information about the model view or the instance view of a virtual machine.
operation. Possible values include: ‘instanceView’ to the HTTP request.
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 207 def get_async(resource_group_name, vm_name, = nil, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_name,'subscriptionId' => @client.subscription_id}, query_params: {'$expand' => ,'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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::VirtualMachine.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, vm_name, expand = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Retrieves information about the model view or the instance view of a virtual machine.
operation. Possible values include: ‘instanceView’ will be added to the HTTP request.
190 191 192 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 190 def get_with_http_info(resource_group_name, vm_name, = nil, custom_headers = nil) get_async(resource_group_name, vm_name, , custom_headers).value! end |
#list(resource_group_name, custom_headers = nil) ⇒ Array<VirtualMachine>
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.
will be added to the HTTP request.
403 404 405 406 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 403 def list(resource_group_name, custom_headers = nil) first_page = list_as_lazy(resource_group_name, custom_headers) first_page.get_all_items end |
#list_all(custom_headers = nil) ⇒ Array<VirtualMachine>
Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.
will be added to the HTTP request.
492 493 494 495 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 492 def list_all(custom_headers = nil) first_page = list_all_as_lazy(custom_headers) first_page.get_all_items end |
#list_all_as_lazy(custom_headers = nil) ⇒ VirtualMachineListResult
Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.
will be added to the HTTP request.
response.
1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1827 def list_all_as_lazy(custom_headers = nil) response = list_all_async(custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_all_next_async(next_page_link, custom_headers) end page end end |
#list_all_async(custom_headers = nil) ⇒ Concurrent::Promise
Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.
to the HTTP request.
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 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 519 def list_all_async(custom_headers = nil) fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::VirtualMachineListResult.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_all_next(next_page_link, custom_headers = nil) ⇒ VirtualMachineListResult
Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.
to List operation. will be added to the HTTP request.
1716 1717 1718 1719 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1716 def list_all_next(next_page_link, custom_headers = nil) response = list_all_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end |
#list_all_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise
Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.
to List operation. to the HTTP request.
1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1747 def list_all_next_async(next_page_link, custom_headers = nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, 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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::VirtualMachineListResult.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_all_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.
to List operation. will be added to the HTTP request.
1732 1733 1734 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1732 def list_all_next_with_http_info(next_page_link, custom_headers = nil) list_all_next_async(next_page_link, custom_headers).value! end |
#list_all_with_http_info(custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines.
will be added to the HTTP request.
506 507 508 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 506 def list_all_with_http_info(custom_headers = nil) list_all_async(custom_headers).value! end |
#list_as_lazy(resource_group_name, custom_headers = nil) ⇒ VirtualMachineListResult
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.
will be added to the HTTP request.
response.
1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1806 def list_as_lazy(resource_group_name, custom_headers = nil) response = list_async(resource_group_name, custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_next_async(next_page_link, custom_headers) end page end end |
#list_async(resource_group_name, custom_headers = nil) ⇒ Concurrent::Promise
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.
to the HTTP request.
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 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 432 def list_async(resource_group_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::VirtualMachineListResult.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_available_sizes(resource_group_name, vm_name, custom_headers = nil) ⇒ VirtualMachineSizeListResult
Lists all available virtual machine sizes to which the specified virtual machine can be resized.
will be added to the HTTP request.
580 581 582 583 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 580 def list_available_sizes(resource_group_name, vm_name, custom_headers = nil) response = list_available_sizes_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#list_available_sizes_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
Lists all available virtual machine sizes to which the specified virtual machine can be resized.
to the HTTP request.
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 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 611 def list_available_sizes_async(resource_group_name, vm_name, custom_headers = nil) fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'vm_name is nil' if vm_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'resourceGroupName' => resource_group_name,'vmName' => vm_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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::VirtualMachineSizeListResult.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_available_sizes_with_http_info(resource_group_name, vm_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all available virtual machine sizes to which the specified virtual machine can be resized.
will be added to the HTTP request.
596 597 598 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 596 def list_available_sizes_with_http_info(resource_group_name, vm_name, custom_headers = nil) list_available_sizes_async(resource_group_name, vm_name, custom_headers).value! end |
#list_next(next_page_link, custom_headers = nil) ⇒ VirtualMachineListResult
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.
to List operation. will be added to the HTTP request.
1626 1627 1628 1629 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1626 def list_next(next_page_link, custom_headers = nil) response = list_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end |
#list_next_async(next_page_link, custom_headers = nil) ⇒ Concurrent::Promise
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.
to List operation. to the HTTP request.
1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1657 def list_next_async(next_page_link, custom_headers = nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{nextLink}' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], skip_encoding_path_params: {'nextLink' => next_page_link}, 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 MsRestAzure::AzureOperationError.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::Compute::Mgmt::V2015_06_15::Models::VirtualMachineListResult.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_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.
to List operation. will be added to the HTTP request.
1642 1643 1644 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 1642 def list_next_with_http_info(next_page_link, custom_headers = nil) list_next_async(next_page_link, custom_headers).value! end |
#list_with_http_info(resource_group_name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to get the next page of virtual machines.
will be added to the HTTP request.
418 419 420 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 418 def list_with_http_info(resource_group_name, custom_headers = nil) list_async(resource_group_name, custom_headers).value! end |
#power_off(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned resources. You are still charged for this virtual machine.
will be added to the HTTP request.
675 676 677 678 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 675 def power_off(resource_group_name, vm_name, custom_headers = nil) response = power_off_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#power_off_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 689 def power_off_async(resource_group_name, vm_name, custom_headers = nil) # Send request promise = begin_power_off_async(resource_group_name, vm_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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 |
#redeploy(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to redeploy a virtual machine.
will be added to the HTTP request.
801 802 803 804 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 801 def redeploy(resource_group_name, vm_name, custom_headers = nil) response = redeploy_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#redeploy_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 815 def redeploy_async(resource_group_name, vm_name, custom_headers = nil) # Send request promise = begin_redeploy_async(resource_group_name, vm_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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 |
#restart(resource_group_name, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to restart a virtual machine.
will be added to the HTTP request.
717 718 719 720 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 717 def restart(resource_group_name, vm_name, custom_headers = nil) response = restart_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#restart_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 731 def restart_async(resource_group_name, vm_name, custom_headers = nil) # Send request promise = begin_restart_async(resource_group_name, vm_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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, vm_name, custom_headers = nil) ⇒ OperationStatusResponse
The operation to start a virtual machine.
will be added to the HTTP request.
759 760 761 762 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 759 def start(resource_group_name, vm_name, custom_headers = nil) response = start_async(resource_group_name, vm_name, custom_headers).value! response.body unless response.nil? end |
#start_async(resource_group_name, vm_name, custom_headers = nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 |
# File 'lib/2015-06-15/generated/azure_mgmt_compute/virtual_machines.rb', line 773 def start_async(resource_group_name, vm_name, custom_headers = nil) # Send request promise = begin_start_async(resource_group_name, vm_name, custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Compute::Mgmt::V2015_06_15::Models::OperationStatusResponse.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 |