Class: Azure::DevTestLabs::Mgmt::V2016_05_15::VirtualMachines
- Inherits:
-
Object
- Object
- Azure::DevTestLabs::Mgmt::V2016_05_15::VirtualMachines
- Includes:
- MsRestAzure
- Defined in:
- lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb
Overview
The DevTest Labs Client.
Instance Attribute Summary collapse
-
#client ⇒ DevTestLabsClient
readonly
Reference to the DevTestLabsClient.
Instance Method Summary collapse
-
#add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ Object
Attach a new or existing data disk to virtual machine.
-
#add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ Concurrent::Promise
new or existing data disk to a virtual machine.
-
#apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ Object
Apply artifacts to virtual machine.
-
#apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ Concurrent::Promise
applying artifacts to a virtual machine.
-
#begin_add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ Object
Attach a new or existing data disk to virtual machine.
-
#begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ Concurrent::Promise
Attach a new or existing data disk to virtual machine.
-
#begin_add_data_disk_with_http_info(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Attach a new or existing data disk to virtual machine.
-
#begin_apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ Object
Apply artifacts to virtual machine.
-
#begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ Concurrent::Promise
Apply artifacts to virtual machine.
-
#begin_apply_artifacts_with_http_info(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Apply artifacts to virtual machine.
-
#begin_claim(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Take ownership of an existing virtual machine This operation can take a while to complete.
-
#begin_claim_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Take ownership of an existing virtual machine This operation can take a while to complete.
-
#begin_claim_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Take ownership of an existing virtual machine This operation can take a while to complete.
-
#begin_create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ LabVirtualMachine
Create or replace an existing Virtual machine.
-
#begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ Concurrent::Promise
Create or replace an existing Virtual machine.
-
#begin_create_or_update_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create or replace an existing Virtual machine.
-
#begin_delete(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Delete virtual machine.
-
#begin_delete_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Delete virtual machine.
-
#begin_delete_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Delete virtual machine.
-
#begin_detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ Object
Detach the specified disk from the virtual machine.
-
#begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ Concurrent::Promise
Detach the specified disk from the virtual machine.
-
#begin_detach_data_disk_with_http_info(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Detach the specified disk from the virtual machine.
-
#begin_start(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Start a virtual machine.
-
#begin_start_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Start a virtual machine.
-
#begin_start_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Start a virtual machine.
-
#begin_stop(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Stop a virtual machine This operation can take a while to complete.
-
#begin_stop_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Stop a virtual machine This operation can take a while to complete.
-
#begin_stop_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Stop a virtual machine This operation can take a while to complete.
-
#claim(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Take ownership of an existing virtual machine This operation can take a while to complete.
-
#claim_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ LabVirtualMachine
Create or replace an existing Virtual machine.
-
#create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#delete(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Delete virtual machine.
-
#delete_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ Object
Detach the specified disk from the virtual machine.
-
#detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ Concurrent::Promise
for detaching data disk from a virtual machine.
-
#get(resource_group_name, lab_name, name, expand: nil, custom_headers: nil) ⇒ LabVirtualMachine
Get virtual machine.
-
#get_async(resource_group_name, lab_name, name, expand: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get virtual machine.
-
#get_with_http_info(resource_group_name, lab_name, name, expand: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get virtual machine.
-
#initialize(client) ⇒ VirtualMachines
constructor
Creates and initializes a new instance of the VirtualMachines class.
-
#list(resource_group_name, lab_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Array<LabVirtualMachine>
List virtual machines in a given lab.
-
#list_applicable_schedules(resource_group_name, lab_name, name, custom_headers: nil) ⇒ ApplicableSchedule
Lists all applicable schedules.
-
#list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Lists all applicable schedules.
-
#list_applicable_schedules_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all applicable schedules.
-
#list_as_lazy(resource_group_name, lab_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ ResponseWithContinuationLabVirtualMachine
List virtual machines in a given lab.
-
#list_async(resource_group_name, lab_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise
List virtual machines in a given lab.
-
#list_next(next_page_link, custom_headers: nil) ⇒ ResponseWithContinuationLabVirtualMachine
List virtual machines in a given lab.
-
#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
List virtual machines in a given lab.
-
#list_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List virtual machines in a given lab.
-
#list_with_http_info(resource_group_name, lab_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List virtual machines in a given lab.
-
#start(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Start a virtual machine.
-
#start_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#stop(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Stop a virtual machine This operation can take a while to complete.
-
#stop_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
-
#update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ LabVirtualMachine
Modify properties of virtual machines.
-
#update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ Concurrent::Promise
Modify properties of virtual machines.
-
#update_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Modify properties of virtual machines.
Constructor Details
#initialize(client) ⇒ VirtualMachines
Creates and initializes a new instance of the VirtualMachines class.
17 18 19 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ DevTestLabsClient (readonly)
22 23 24 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 22 def client @client end |
Instance Method Details
#add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ Object
Attach a new or existing data disk to virtual machine. This operation can take a while to complete.
new or existing data disk to a virtual machine. will be added to the HTTP request.
445 446 447 448 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 445 def add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil) response = add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers).value! nil end |
#add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ Concurrent::Promise
new or existing data disk to a virtual machine. will be added to the HTTP request.
response.
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 462 def add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil) # Send request promise = begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ Object
Apply artifacts to virtual machine. This operation can take a while to complete.
applying artifacts to a virtual machine. will be added to the HTTP request.
490 491 492 493 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 490 def apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil) response = apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers).value! nil end |
#apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ Concurrent::Promise
applying artifacts to a virtual machine. will be added to the HTTP request.
response.
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 507 def apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil) # Send request promise = begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#begin_add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ Object
Attach a new or existing data disk to virtual machine. This operation can take a while to complete.
new or existing data disk to a virtual machine. will be added to the HTTP request.
1003 1004 1005 1006 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1003 def begin_add_data_disk(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil) response = begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers).value! nil end |
#begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ Concurrent::Promise
Attach a new or existing data disk to virtual machine. This operation can take a while to complete.
new or existing data disk to a virtual machine. to the HTTP request.
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1040 def begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, 'data_disk_properties is nil' if data_disk_properties.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DataDiskProperties.mapper() request_content = @client.serialize(request_mapper, data_disk_properties) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/addDataDisk' 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,'labName' => lab_name,'name' => name}, 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? result end promise.execute end |
#begin_add_data_disk_with_http_info(resource_group_name, lab_name, name, data_disk_properties, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Attach a new or existing data disk to virtual machine. This operation can take a while to complete.
new or existing data disk to a virtual machine. will be added to the HTTP request.
1022 1023 1024 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1022 def begin_add_data_disk_with_http_info(resource_group_name, lab_name, name, data_disk_properties, custom_headers:nil) begin_add_data_disk_async(resource_group_name, lab_name, name, data_disk_properties, custom_headers:custom_headers).value! end |
#begin_apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ Object
Apply artifacts to virtual machine. This operation can take a while to complete.
applying artifacts to a virtual machine. will be added to the HTTP request.
1105 1106 1107 1108 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1105 def begin_apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil) response = begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers).value! nil end |
#begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ Concurrent::Promise
Apply artifacts to virtual machine. This operation can take a while to complete.
applying artifacts to a virtual machine. to the HTTP request.
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1142 def begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, 'apply_artifacts_request is nil' if apply_artifacts_request.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ApplyArtifactsRequest.mapper() request_content = @client.serialize(request_mapper, apply_artifacts_request) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/applyArtifacts' 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,'labName' => lab_name,'name' => name}, 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? result end promise.execute end |
#begin_apply_artifacts_with_http_info(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Apply artifacts to virtual machine. This operation can take a while to complete.
applying artifacts to a virtual machine. will be added to the HTTP request.
1124 1125 1126 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1124 def begin_apply_artifacts_with_http_info(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:nil) begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers:custom_headers).value! end |
#begin_claim(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Take ownership of an existing virtual machine This operation can take a while to complete.
will be added to the HTTP request.
1205 1206 1207 1208 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1205 def begin_claim(resource_group_name, lab_name, name, custom_headers:nil) response = begin_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! nil end |
#begin_claim_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Take ownership of an existing virtual machine This operation can take a while to complete.
to the HTTP request.
1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1238 def begin_claim_async(resource_group_name, lab_name, name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/claim' 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,'labName' => lab_name,'name' => name}, 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? result end promise.execute end |
#begin_claim_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Take ownership of an existing virtual machine This operation can take a while to complete.
will be added to the HTTP request.
1222 1223 1224 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1222 def begin_claim_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) begin_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! end |
#begin_create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ LabVirtualMachine
Create or replace an existing Virtual machine. This operation can take a while to complete.
will be added to the HTTP request.
798 799 800 801 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 798 def begin_create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) response = begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! response.body unless response.nil? end |
#begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ Concurrent::Promise
Create or replace an existing Virtual machine. This operation can take a while to complete.
to the HTTP request.
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 893 894 895 896 897 898 899 900 901 902 903 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 833 def begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, 'lab_virtual_machine is nil' if lab_virtual_machine.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine.mapper() request_content = @client.serialize(request_mapper, lab_virtual_machine) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}' 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,'labName' => lab_name,'name' => name}, 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::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine.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::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine.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, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Create or replace an existing Virtual machine. This operation can take a while to complete.
will be added to the HTTP request.
816 817 818 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 816 def begin_create_or_update_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! end |
#begin_delete(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Delete virtual machine. This operation can take a while to complete.
will be added to the HTTP request.
915 916 917 918 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 915 def begin_delete(resource_group_name, lab_name, name, custom_headers:nil) response = begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! nil end |
#begin_delete_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Delete virtual machine. This operation can take a while to complete.
to the HTTP request.
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 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 946 def begin_delete_async(resource_group_name, lab_name, name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}' 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,'labName' => lab_name,'name' => name}, 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 == 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? result end promise.execute end |
#begin_delete_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Delete virtual machine. This operation can take a while to complete.
will be added to the HTTP request.
931 932 933 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 931 def begin_delete_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! end |
#begin_detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ Object
Detach the specified disk from the virtual machine. This operation can take a while to complete.
for detaching data disk from a virtual machine. will be added to the HTTP request.
1295 1296 1297 1298 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1295 def begin_detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil) response = begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers).value! nil end |
#begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ Concurrent::Promise
Detach the specified disk from the virtual machine. This operation can take a while to complete.
for detaching data disk from a virtual machine. to the HTTP request.
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1332 def begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, 'detach_data_disk_properties is nil' if detach_data_disk_properties.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::DetachDataDiskProperties.mapper() request_content = @client.serialize(request_mapper, detach_data_disk_properties) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/detachDataDisk' 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,'labName' => lab_name,'name' => name}, 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? result end promise.execute end |
#begin_detach_data_disk_with_http_info(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Detach the specified disk from the virtual machine. This operation can take a while to complete.
for detaching data disk from a virtual machine. will be added to the HTTP request.
1314 1315 1316 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1314 def begin_detach_data_disk_with_http_info(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil) begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers).value! end |
#begin_start(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Start a virtual machine. This operation can take a while to complete.
will be added to the HTTP request.
1394 1395 1396 1397 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1394 def begin_start(resource_group_name, lab_name, name, custom_headers:nil) response = begin_start_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! nil end |
#begin_start_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Start a virtual machine. This operation can take a while to complete.
to the HTTP request.
1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1425 def begin_start_async(resource_group_name, lab_name, name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/start' 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,'labName' => lab_name,'name' => name}, 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? result end promise.execute end |
#begin_start_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Start a virtual machine. This operation can take a while to complete.
will be added to the HTTP request.
1410 1411 1412 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1410 def begin_start_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) begin_start_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! end |
#begin_stop(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Stop a virtual machine This operation can take a while to complete.
will be added to the HTTP request.
1479 1480 1481 1482 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1479 def begin_stop(resource_group_name, lab_name, name, custom_headers:nil) response = begin_stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! nil end |
#begin_stop_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Stop a virtual machine This operation can take a while to complete.
to the HTTP request.
1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1510 def begin_stop_async(resource_group_name, lab_name, name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/stop' 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,'labName' => lab_name,'name' => name}, 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? result end promise.execute end |
#begin_stop_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Stop a virtual machine This operation can take a while to complete.
will be added to the HTTP request.
1495 1496 1497 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1495 def begin_stop_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) begin_stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! end |
#claim(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Take ownership of an existing virtual machine This operation can take a while to complete.
will be added to the HTTP request.
533 534 535 536 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 533 def claim(resource_group_name, lab_name, name, custom_headers:nil) response = claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! nil end |
#claim_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 548 def claim_async(resource_group_name, lab_name, name, custom_headers:nil) # Send request promise = begin_claim_async(resource_group_name, lab_name, name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ LabVirtualMachine
Create or replace an existing Virtual machine. This operation can take a while to complete.
will be added to the HTTP request.
252 253 254 255 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 252 def create_or_update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) response = create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! response.body unless response.nil? end |
#create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 268 def create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) # Send request promise = begin_create_or_update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine.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, lab_name, name, custom_headers: nil) ⇒ Object
Delete virtual machine. This operation can take a while to complete.
will be added to the HTTP request.
295 296 297 298 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 295 def delete(resource_group_name, lab_name, name, custom_headers:nil) response = delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! nil end |
#delete_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 310 def delete_async(resource_group_name, lab_name, name, custom_headers:nil) # Send request promise = begin_delete_async(resource_group_name, lab_name, name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ Object
Detach the specified disk from the virtual machine. This operation can take a while to complete.
for detaching data disk from a virtual machine. will be added to the HTTP request.
576 577 578 579 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 576 def detach_data_disk(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil) response = detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers).value! nil end |
#detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers: nil) ⇒ Concurrent::Promise
for detaching data disk from a virtual machine. will be added to the HTTP request.
response.
593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 593 def detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:nil) # Send request promise = begin_detach_data_disk_async(resource_group_name, lab_name, name, detach_data_disk_properties, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#get(resource_group_name, lab_name, name, expand: nil, custom_headers: nil) ⇒ LabVirtualMachine
Get virtual machine.
‘properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)’ will be added to the HTTP request.
150 151 152 153 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 150 def get(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) response = get_async(resource_group_name, lab_name, name, expand:, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_async(resource_group_name, lab_name, name, expand: nil, custom_headers: nil) ⇒ Concurrent::Promise
Get virtual machine.
‘properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)’ to the HTTP request.
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 185 def get_async(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}' 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,'labName' => lab_name,'name' => name}, 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::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine.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, lab_name, name, expand: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get virtual machine.
‘properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)’ will be added to the HTTP request.
168 169 170 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 168 def get_with_http_info(resource_group_name, lab_name, name, expand:nil, custom_headers:nil) get_async(resource_group_name, lab_name, name, expand:, custom_headers:custom_headers).value! end |
#list(resource_group_name, lab_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Array<LabVirtualMachine>
List virtual machines in a given lab.
‘properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)’ operation. notation. will be added to the HTTP request.
41 42 43 44 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 41 def list(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) first_page = list_as_lazy(resource_group_name, lab_name, expand:, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers) first_page.get_all_items end |
#list_applicable_schedules(resource_group_name, lab_name, name, custom_headers: nil) ⇒ ApplicableSchedule
Lists all applicable schedules
will be added to the HTTP request.
620 621 622 623 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 620 def list_applicable_schedules(resource_group_name, lab_name, name, custom_headers:nil) response = list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
Lists all applicable schedules
to the HTTP request.
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 651 def list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/listApplicableSchedules' 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,'labName' => lab_name,'name' => name}, 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::DevTestLabs::Mgmt::V2016_05_15::Models::ApplicableSchedule.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_applicable_schedules_with_http_info(resource_group_name, lab_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Lists all applicable schedules
will be added to the HTTP request.
636 637 638 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 636 def list_applicable_schedules_with_http_info(resource_group_name, lab_name, name, custom_headers:nil) list_applicable_schedules_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! end |
#list_as_lazy(resource_group_name, lab_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ ResponseWithContinuationLabVirtualMachine
List virtual machines in a given lab.
‘properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)’ operation. notation. will be added to the HTTP request.
to pages of the response.
1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1660 def list_as_lazy(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) response = list_async(resource_group_name, lab_name, expand:, filter:filter, top:top, orderby:orderby, custom_headers: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:custom_headers) end page end end |
#list_async(resource_group_name, lab_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise
List virtual machines in a given lab.
‘properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)’ operation. notation. to the HTTP request.
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 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 84 def list_async(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines' 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,'labName' => lab_name}, query_params: {'$expand' => ,'$filter' => filter,'$top' => top,'$orderby' => orderby,'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::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVirtualMachine.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(next_page_link, custom_headers: nil) ⇒ ResponseWithContinuationLabVirtualMachine
List virtual machines in a given lab.
to List operation. will be added to the HTTP request.
1564 1565 1566 1567 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1564 def list_next(next_page_link, custom_headers:nil) response = list_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise
List virtual machines in a given lab.
to List operation. to the HTTP request.
1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1593 def list_next_async(next_page_link, custom_headers:nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? path_template = '{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::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVirtualMachine.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
List virtual machines in a given lab.
to List operation. will be added to the HTTP request.
1579 1580 1581 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 1579 def list_next_with_http_info(next_page_link, custom_headers:nil) list_next_async(next_page_link, custom_headers:custom_headers).value! end |
#list_with_http_info(resource_group_name, lab_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List virtual machines in a given lab.
‘properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)’ operation. notation. will be added to the HTTP request.
63 64 65 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 63 def list_with_http_info(resource_group_name, lab_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil) list_async(resource_group_name, lab_name, expand:, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value! end |
#start(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Start a virtual machine. This operation can take a while to complete.
will be added to the HTTP request.
714 715 716 717 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 714 def start(resource_group_name, lab_name, name, custom_headers:nil) response = start_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! nil end |
#start_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 729 def start_async(resource_group_name, lab_name, name, custom_headers:nil) # Send request promise = begin_start_async(resource_group_name, lab_name, name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#stop(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Object
Stop a virtual machine This operation can take a while to complete.
will be added to the HTTP request.
754 755 756 757 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 754 def stop(resource_group_name, lab_name, name, custom_headers:nil) response = stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers).value! nil end |
#stop_async(resource_group_name, lab_name, name, custom_headers: nil) ⇒ Concurrent::Promise
will be added to the HTTP request.
response.
769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 769 def stop_async(resource_group_name, lab_name, name, custom_headers:nil) # Send request promise = begin_stop_async(resource_group_name, lab_name, name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end |
#update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ LabVirtualMachine
Modify properties of virtual machines.
will be added to the HTTP request.
338 339 340 341 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 338 def update(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) response = update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! response.body unless response.nil? end |
#update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ Concurrent::Promise
Modify properties of virtual machines.
to the HTTP request.
371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 371 def update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? fail ArgumentError, 'lab_name is nil' if lab_name.nil? fail ArgumentError, 'name is nil' if name.nil? fail ArgumentError, 'lab_virtual_machine is nil' if lab_virtual_machine.nil? fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Set Headers request_headers['x-ms-client-request-id'] = SecureRandom.uuid request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? # Serialize Request request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineFragment.mapper() request_content = @client.serialize(request_mapper, lab_virtual_machine) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}' 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,'labName' => lab_name,'name' => name}, 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(: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 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::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachine.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 |
#update_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Modify properties of virtual machines.
will be added to the HTTP request.
355 356 357 |
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/virtual_machines.rb', line 355 def update_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:nil) update_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers:custom_headers).value! end |