azure_mgmt_devtestlabs 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generated/azure_mgmt_devtestlabs.rb +25 -25
- data/lib/generated/azure_mgmt_devtestlabs/artifact_operations.rb +42 -42
- data/lib/generated/azure_mgmt_devtestlabs/artifact_source_operations.rb +41 -41
- data/lib/generated/azure_mgmt_devtestlabs/cost_operations.rb +2 -2
- data/lib/generated/azure_mgmt_devtestlabs/custom_image_operations.rb +81 -81
- data/lib/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +14 -1
- data/lib/generated/azure_mgmt_devtestlabs/formula_operations.rb +100 -100
- data/lib/generated/azure_mgmt_devtestlabs/gallery_image_operations.rb +41 -41
- data/lib/generated/azure_mgmt_devtestlabs/lab_operations.rb +288 -288
- data/lib/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/artifact.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/artifact_source.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/cost.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/cost_per_day_properties.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/custom_image.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/day_details.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/enable_status.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/formula.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb +3 -3
- data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/hour_details.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/lab.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/lab_cost_type.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/lab_storage_type.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/parameter_info.rb +2 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/policy.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb +3 -3
- data/lib/generated/azure_mgmt_devtestlabs/models/policy_status.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/policy_violation.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/resource_cost_properties.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact_source.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_custom_image.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_formula.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_gallery_image.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_vhd.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_virtual_machine.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_policy.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_schedule.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_virtual_network.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/schedule.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/source_control_type.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/subnet.rb +2 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/subnet_override.rb +6 -6
- data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification.rb +2 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification_properties.rb +2 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification_state.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/virtual_network.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/week_details.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/module_definition.rb +1 -1
- data/lib/generated/azure_mgmt_devtestlabs/policy_operations.rb +42 -42
- data/lib/generated/azure_mgmt_devtestlabs/policy_set.rb +2 -2
- data/lib/generated/azure_mgmt_devtestlabs/schedule_operations.rb +41 -41
- data/lib/generated/azure_mgmt_devtestlabs/version.rb +2 -2
- data/lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb +224 -224
- data/lib/generated/azure_mgmt_devtestlabs/virtual_network_operations.rb +150 -150
- metadata +4 -4
@@ -1,11 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 0.
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
4
4
|
# regenerated.
|
5
5
|
|
6
6
|
module Azure::ARM::DevTestLabs
|
7
7
|
#
|
8
|
-
#
|
8
|
+
# Azure DevTest Labs REST API.
|
9
9
|
#
|
10
10
|
class VirtualMachine
|
11
11
|
include Azure::ARM::DevTestLabs::Models
|
@@ -30,35 +30,8 @@ module Azure::ARM::DevTestLabs
|
|
30
30
|
# @param filter [String] The filter to apply on the operation.
|
31
31
|
# @param top [Integer] The maximum number of resources to return from the
|
32
32
|
# operation.
|
33
|
-
# @param order_by [String] The ordering expression for the results, using
|
34
|
-
#
|
35
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
36
|
-
# will be added to the HTTP request.
|
37
|
-
#
|
38
|
-
# @return [ResponseWithContinuationLabVirtualMachine] which provide lazy
|
39
|
-
# access to pages of the response.
|
40
|
-
#
|
41
|
-
def list_as_lazy(resource_group_name, lab_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
|
42
|
-
response = list_async(resource_group_name, lab_name, filter, top, order_by, custom_headers).value!
|
43
|
-
unless response.nil?
|
44
|
-
page = response.body
|
45
|
-
page.next_method = Proc.new do |next_page_link|
|
46
|
-
list_next_async(next_page_link, custom_headers)
|
47
|
-
end
|
48
|
-
page
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
#
|
53
|
-
# List virtual machines in a given lab.
|
54
|
-
#
|
55
|
-
# @param resource_group_name [String] The name of the resource group.
|
56
|
-
# @param lab_name [String] The name of the lab.
|
57
|
-
# @param filter [String] The filter to apply on the operation.
|
58
|
-
# @param top [Integer] The maximum number of resources to return from the
|
59
|
-
# operation.
|
60
|
-
# @param order_by [String] The ordering expression for the results, using
|
61
|
-
# OData notation.
|
33
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
34
|
+
# notation.
|
62
35
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
63
36
|
# will be added to the HTTP request.
|
64
37
|
#
|
@@ -77,8 +50,8 @@ module Azure::ARM::DevTestLabs
|
|
77
50
|
# @param filter [String] The filter to apply on the operation.
|
78
51
|
# @param top [Integer] The maximum number of resources to return from the
|
79
52
|
# operation.
|
80
|
-
# @param order_by [String] The ordering expression for the results, using
|
81
|
-
#
|
53
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
54
|
+
# notation.
|
82
55
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
83
56
|
# will be added to the HTTP request.
|
84
57
|
#
|
@@ -96,8 +69,8 @@ module Azure::ARM::DevTestLabs
|
|
96
69
|
# @param filter [String] The filter to apply on the operation.
|
97
70
|
# @param top [Integer] The maximum number of resources to return from the
|
98
71
|
# operation.
|
99
|
-
# @param order_by [String] The ordering expression for the results, using
|
100
|
-
#
|
72
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
73
|
+
# notation.
|
101
74
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
102
75
|
# to the HTTP request.
|
103
76
|
#
|
@@ -298,8 +271,47 @@ module Azure::ARM::DevTestLabs
|
|
298
271
|
end
|
299
272
|
|
300
273
|
#
|
301
|
-
#
|
302
|
-
#
|
274
|
+
# Delete virtual machine. This operation can take a while to complete.
|
275
|
+
#
|
276
|
+
# @param resource_group_name [String] The name of the resource group.
|
277
|
+
# @param lab_name [String] The name of the lab.
|
278
|
+
# @param name [String] The name of the virtual Machine.
|
279
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
280
|
+
# will be added to the HTTP request.
|
281
|
+
#
|
282
|
+
def delete_resource(resource_group_name, lab_name, name, custom_headers = nil)
|
283
|
+
response = delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
|
284
|
+
nil
|
285
|
+
end
|
286
|
+
|
287
|
+
#
|
288
|
+
# @param resource_group_name [String] The name of the resource group.
|
289
|
+
# @param lab_name [String] The name of the lab.
|
290
|
+
# @param name [String] The name of the virtual Machine.
|
291
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
292
|
+
# will be added to the HTTP request.
|
293
|
+
#
|
294
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
295
|
+
# response.
|
296
|
+
#
|
297
|
+
def delete_resource_async(resource_group_name, lab_name, name, custom_headers = nil)
|
298
|
+
# Send request
|
299
|
+
promise = begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers)
|
300
|
+
|
301
|
+
promise = promise.then do |response|
|
302
|
+
# Defining deserialization method.
|
303
|
+
deserialize_method = lambda do |parsed_response|
|
304
|
+
end
|
305
|
+
|
306
|
+
# Waiting for response.
|
307
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
308
|
+
end
|
309
|
+
|
310
|
+
promise
|
311
|
+
end
|
312
|
+
|
313
|
+
#
|
314
|
+
# Modify properties of virtual machines.
|
303
315
|
#
|
304
316
|
# @param resource_group_name [String] The name of the resource group.
|
305
317
|
# @param lab_name [String] The name of the lab.
|
@@ -310,14 +322,13 @@ module Azure::ARM::DevTestLabs
|
|
310
322
|
#
|
311
323
|
# @return [LabVirtualMachine] operation results.
|
312
324
|
#
|
313
|
-
def
|
314
|
-
response =
|
325
|
+
def patch_resource(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
|
326
|
+
response = patch_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers).value!
|
315
327
|
response.body unless response.nil?
|
316
328
|
end
|
317
329
|
|
318
330
|
#
|
319
|
-
#
|
320
|
-
# while to complete.
|
331
|
+
# Modify properties of virtual machines.
|
321
332
|
#
|
322
333
|
# @param resource_group_name [String] The name of the resource group.
|
323
334
|
# @param lab_name [String] The name of the lab.
|
@@ -328,13 +339,12 @@ module Azure::ARM::DevTestLabs
|
|
328
339
|
#
|
329
340
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
330
341
|
#
|
331
|
-
def
|
332
|
-
|
342
|
+
def patch_resource_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
|
343
|
+
patch_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers).value!
|
333
344
|
end
|
334
345
|
|
335
346
|
#
|
336
|
-
#
|
337
|
-
# while to complete.
|
347
|
+
# Modify properties of virtual machines.
|
338
348
|
#
|
339
349
|
# @param resource_group_name [String] The name of the resource group.
|
340
350
|
# @param lab_name [String] The name of the lab.
|
@@ -345,7 +355,7 @@ module Azure::ARM::DevTestLabs
|
|
345
355
|
#
|
346
356
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
347
357
|
#
|
348
|
-
def
|
358
|
+
def patch_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
|
349
359
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
350
360
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
351
361
|
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
@@ -379,13 +389,13 @@ module Azure::ARM::DevTestLabs
|
|
379
389
|
headers: request_headers.merge(custom_headers || {}),
|
380
390
|
base_url: request_url
|
381
391
|
}
|
382
|
-
promise = @client.make_request_async(:
|
392
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
383
393
|
|
384
394
|
promise = promise.then do |result|
|
385
395
|
http_response = result.response
|
386
396
|
status_code = http_response.status
|
387
397
|
response_content = http_response.body
|
388
|
-
unless status_code == 200
|
398
|
+
unless status_code == 200
|
389
399
|
error_model = JSON.load(response_content)
|
390
400
|
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
391
401
|
end
|
@@ -401,16 +411,6 @@ module Azure::ARM::DevTestLabs
|
|
401
411
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
402
412
|
end
|
403
413
|
end
|
404
|
-
# Deserialize Response
|
405
|
-
if status_code == 201
|
406
|
-
begin
|
407
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
408
|
-
result_mapper = LabVirtualMachine.mapper()
|
409
|
-
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
410
|
-
rescue Exception => e
|
411
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
412
|
-
end
|
413
|
-
end
|
414
414
|
|
415
415
|
result
|
416
416
|
end
|
@@ -419,16 +419,17 @@ module Azure::ARM::DevTestLabs
|
|
419
419
|
end
|
420
420
|
|
421
421
|
#
|
422
|
-
#
|
422
|
+
# Apply artifacts to Lab VM. This operation can take a while to complete.
|
423
423
|
#
|
424
424
|
# @param resource_group_name [String] The name of the resource group.
|
425
425
|
# @param lab_name [String] The name of the lab.
|
426
426
|
# @param name [String] The name of the virtual Machine.
|
427
|
+
# @param apply_artifacts_request [ApplyArtifactsRequest]
|
427
428
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
428
429
|
# will be added to the HTTP request.
|
429
430
|
#
|
430
|
-
def
|
431
|
-
response =
|
431
|
+
def apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil)
|
432
|
+
response = apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers).value!
|
432
433
|
nil
|
433
434
|
end
|
434
435
|
|
@@ -436,15 +437,16 @@ module Azure::ARM::DevTestLabs
|
|
436
437
|
# @param resource_group_name [String] The name of the resource group.
|
437
438
|
# @param lab_name [String] The name of the lab.
|
438
439
|
# @param name [String] The name of the virtual Machine.
|
440
|
+
# @param apply_artifacts_request [ApplyArtifactsRequest]
|
439
441
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
440
442
|
# will be added to the HTTP request.
|
441
443
|
#
|
442
444
|
# @return [Concurrent::Promise] promise which provides async access to http
|
443
445
|
# response.
|
444
446
|
#
|
445
|
-
def
|
447
|
+
def apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil)
|
446
448
|
# Send request
|
447
|
-
promise =
|
449
|
+
promise = begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers)
|
448
450
|
|
449
451
|
promise = promise.then do |response|
|
450
452
|
# Defining deserialization method.
|
@@ -459,7 +461,7 @@ module Azure::ARM::DevTestLabs
|
|
459
461
|
end
|
460
462
|
|
461
463
|
#
|
462
|
-
#
|
464
|
+
# Start a Lab VM. This operation can take a while to complete.
|
463
465
|
#
|
464
466
|
# @param resource_group_name [String] The name of the resource group.
|
465
467
|
# @param lab_name [String] The name of the lab.
|
@@ -467,14 +469,11 @@ module Azure::ARM::DevTestLabs
|
|
467
469
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
468
470
|
# will be added to the HTTP request.
|
469
471
|
#
|
470
|
-
|
471
|
-
|
472
|
-
response = begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
|
472
|
+
def start(resource_group_name, lab_name, name, custom_headers = nil)
|
473
|
+
response = start_async(resource_group_name, lab_name, name, custom_headers).value!
|
473
474
|
nil
|
474
475
|
end
|
475
476
|
|
476
|
-
#
|
477
|
-
# Delete virtual machine. This operation can take a while to complete.
|
478
477
|
#
|
479
478
|
# @param resource_group_name [String] The name of the resource group.
|
480
479
|
# @param lab_name [String] The name of the lab.
|
@@ -482,68 +481,68 @@ module Azure::ARM::DevTestLabs
|
|
482
481
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
483
482
|
# will be added to the HTTP request.
|
484
483
|
#
|
485
|
-
# @return [
|
484
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
485
|
+
# response.
|
486
486
|
#
|
487
|
-
def
|
488
|
-
|
487
|
+
def start_async(resource_group_name, lab_name, name, custom_headers = nil)
|
488
|
+
# Send request
|
489
|
+
promise = begin_start_async(resource_group_name, lab_name, name, custom_headers)
|
490
|
+
|
491
|
+
promise = promise.then do |response|
|
492
|
+
# Defining deserialization method.
|
493
|
+
deserialize_method = lambda do |parsed_response|
|
494
|
+
end
|
495
|
+
|
496
|
+
# Waiting for response.
|
497
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
498
|
+
end
|
499
|
+
|
500
|
+
promise
|
489
501
|
end
|
490
502
|
|
491
503
|
#
|
492
|
-
#
|
504
|
+
# Stop a Lab VM. This operation can take a while to complete.
|
493
505
|
#
|
494
506
|
# @param resource_group_name [String] The name of the resource group.
|
495
507
|
# @param lab_name [String] The name of the lab.
|
496
508
|
# @param name [String] The name of the virtual Machine.
|
497
|
-
# @param [Hash{String => String}] A hash of custom headers that
|
498
|
-
# to the HTTP request.
|
499
|
-
#
|
500
|
-
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
509
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
510
|
+
# will be added to the HTTP request.
|
501
511
|
#
|
502
|
-
def
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
fail ArgumentError, 'name is nil' if name.nil?
|
507
|
-
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
508
|
-
|
509
|
-
|
510
|
-
request_headers = {}
|
511
|
-
|
512
|
-
# Set Headers
|
513
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
514
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
515
|
-
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}'
|
516
|
-
|
517
|
-
request_url = @base_url || @client.base_url
|
512
|
+
def stop(resource_group_name, lab_name, name, custom_headers = nil)
|
513
|
+
response = stop_async(resource_group_name, lab_name, name, custom_headers).value!
|
514
|
+
nil
|
515
|
+
end
|
518
516
|
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
517
|
+
#
|
518
|
+
# @param resource_group_name [String] The name of the resource group.
|
519
|
+
# @param lab_name [String] The name of the lab.
|
520
|
+
# @param name [String] The name of the virtual Machine.
|
521
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
522
|
+
# will be added to the HTTP request.
|
523
|
+
#
|
524
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
525
|
+
# response.
|
526
|
+
#
|
527
|
+
def stop_async(resource_group_name, lab_name, name, custom_headers = nil)
|
528
|
+
# Send request
|
529
|
+
promise = begin_stop_async(resource_group_name, lab_name, name, custom_headers)
|
527
530
|
|
528
|
-
promise = promise.then do |
|
529
|
-
|
530
|
-
|
531
|
-
response_content = http_response.body
|
532
|
-
unless status_code == 202 || status_code == 204
|
533
|
-
error_model = JSON.load(response_content)
|
534
|
-
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
531
|
+
promise = promise.then do |response|
|
532
|
+
# Defining deserialization method.
|
533
|
+
deserialize_method = lambda do |parsed_response|
|
535
534
|
end
|
536
535
|
|
537
|
-
|
538
|
-
|
539
|
-
result
|
536
|
+
# Waiting for response.
|
537
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
540
538
|
end
|
541
539
|
|
542
|
-
promise
|
540
|
+
promise
|
543
541
|
end
|
544
542
|
|
545
543
|
#
|
546
|
-
#
|
544
|
+
# Create or replace an existing Virtual Machine. This operation can take a
|
545
|
+
# while to complete.
|
547
546
|
#
|
548
547
|
# @param resource_group_name [String] The name of the resource group.
|
549
548
|
# @param lab_name [String] The name of the lab.
|
@@ -554,13 +553,14 @@ module Azure::ARM::DevTestLabs
|
|
554
553
|
#
|
555
554
|
# @return [LabVirtualMachine] operation results.
|
556
555
|
#
|
557
|
-
def
|
558
|
-
response =
|
556
|
+
def begin_create_or_update_resource(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
|
557
|
+
response = begin_create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers).value!
|
559
558
|
response.body unless response.nil?
|
560
559
|
end
|
561
560
|
|
562
561
|
#
|
563
|
-
#
|
562
|
+
# Create or replace an existing Virtual Machine. This operation can take a
|
563
|
+
# while to complete.
|
564
564
|
#
|
565
565
|
# @param resource_group_name [String] The name of the resource group.
|
566
566
|
# @param lab_name [String] The name of the lab.
|
@@ -571,12 +571,13 @@ module Azure::ARM::DevTestLabs
|
|
571
571
|
#
|
572
572
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
573
573
|
#
|
574
|
-
def
|
575
|
-
|
574
|
+
def begin_create_or_update_resource_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
|
575
|
+
begin_create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers).value!
|
576
576
|
end
|
577
577
|
|
578
578
|
#
|
579
|
-
#
|
579
|
+
# Create or replace an existing Virtual Machine. This operation can take a
|
580
|
+
# while to complete.
|
580
581
|
#
|
581
582
|
# @param resource_group_name [String] The name of the resource group.
|
582
583
|
# @param lab_name [String] The name of the lab.
|
@@ -587,7 +588,7 @@ module Azure::ARM::DevTestLabs
|
|
587
588
|
#
|
588
589
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
589
590
|
#
|
590
|
-
def
|
591
|
+
def begin_create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
|
591
592
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
592
593
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
593
594
|
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
@@ -621,13 +622,13 @@ module Azure::ARM::DevTestLabs
|
|
621
622
|
headers: request_headers.merge(custom_headers || {}),
|
622
623
|
base_url: request_url
|
623
624
|
}
|
624
|
-
promise = @client.make_request_async(:
|
625
|
+
promise = @client.make_request_async(:put, path_template, options)
|
625
626
|
|
626
627
|
promise = promise.then do |result|
|
627
628
|
http_response = result.response
|
628
629
|
status_code = http_response.status
|
629
630
|
response_content = http_response.body
|
630
|
-
unless status_code == 200
|
631
|
+
unless status_code == 200 || status_code == 201
|
631
632
|
error_model = JSON.load(response_content)
|
632
633
|
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
633
634
|
end
|
@@ -643,6 +644,16 @@ module Azure::ARM::DevTestLabs
|
|
643
644
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
644
645
|
end
|
645
646
|
end
|
647
|
+
# Deserialize Response
|
648
|
+
if status_code == 201
|
649
|
+
begin
|
650
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
651
|
+
result_mapper = LabVirtualMachine.mapper()
|
652
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
653
|
+
rescue Exception => e
|
654
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
655
|
+
end
|
656
|
+
end
|
646
657
|
|
647
658
|
result
|
648
659
|
end
|
@@ -651,45 +662,87 @@ module Azure::ARM::DevTestLabs
|
|
651
662
|
end
|
652
663
|
|
653
664
|
#
|
654
|
-
#
|
665
|
+
# Delete virtual machine. This operation can take a while to complete.
|
655
666
|
#
|
656
667
|
# @param resource_group_name [String] The name of the resource group.
|
657
668
|
# @param lab_name [String] The name of the lab.
|
658
669
|
# @param name [String] The name of the virtual Machine.
|
659
|
-
# @param apply_artifacts_request [ApplyArtifactsRequest]
|
660
670
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
661
671
|
# will be added to the HTTP request.
|
662
672
|
#
|
663
|
-
|
664
|
-
|
673
|
+
#
|
674
|
+
def begin_delete_resource(resource_group_name, lab_name, name, custom_headers = nil)
|
675
|
+
response = begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
|
665
676
|
nil
|
666
677
|
end
|
667
678
|
|
679
|
+
#
|
680
|
+
# Delete virtual machine. This operation can take a while to complete.
|
668
681
|
#
|
669
682
|
# @param resource_group_name [String] The name of the resource group.
|
670
683
|
# @param lab_name [String] The name of the lab.
|
671
684
|
# @param name [String] The name of the virtual Machine.
|
672
|
-
# @param apply_artifacts_request [ApplyArtifactsRequest]
|
673
685
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
674
686
|
# will be added to the HTTP request.
|
675
687
|
#
|
676
|
-
# @return [
|
677
|
-
# response.
|
688
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
678
689
|
#
|
679
|
-
def
|
680
|
-
|
681
|
-
|
690
|
+
def begin_delete_resource_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
|
691
|
+
begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
|
692
|
+
end
|
682
693
|
|
683
|
-
|
684
|
-
|
685
|
-
|
694
|
+
#
|
695
|
+
# Delete virtual machine. This operation can take a while to complete.
|
696
|
+
#
|
697
|
+
# @param resource_group_name [String] The name of the resource group.
|
698
|
+
# @param lab_name [String] The name of the lab.
|
699
|
+
# @param name [String] The name of the virtual Machine.
|
700
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
701
|
+
# to the HTTP request.
|
702
|
+
#
|
703
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
704
|
+
#
|
705
|
+
def begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers = nil)
|
706
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
707
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
708
|
+
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
709
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
710
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
711
|
+
|
712
|
+
|
713
|
+
request_headers = {}
|
714
|
+
|
715
|
+
# Set Headers
|
716
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
717
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
718
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}'
|
719
|
+
|
720
|
+
request_url = @base_url || @client.base_url
|
721
|
+
|
722
|
+
options = {
|
723
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
724
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
|
725
|
+
query_params: {'api-version' => @client.api_version},
|
726
|
+
headers: request_headers.merge(custom_headers || {}),
|
727
|
+
base_url: request_url
|
728
|
+
}
|
729
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
730
|
+
|
731
|
+
promise = promise.then do |result|
|
732
|
+
http_response = result.response
|
733
|
+
status_code = http_response.status
|
734
|
+
response_content = http_response.body
|
735
|
+
unless status_code == 202 || status_code == 204
|
736
|
+
error_model = JSON.load(response_content)
|
737
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
686
738
|
end
|
687
739
|
|
688
|
-
|
689
|
-
|
740
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
741
|
+
|
742
|
+
result
|
690
743
|
end
|
691
744
|
|
692
|
-
promise
|
745
|
+
promise.execute
|
693
746
|
end
|
694
747
|
|
695
748
|
#
|
@@ -789,46 +842,6 @@ module Azure::ARM::DevTestLabs
|
|
789
842
|
promise.execute
|
790
843
|
end
|
791
844
|
|
792
|
-
#
|
793
|
-
# Start a Lab VM. This operation can take a while to complete.
|
794
|
-
#
|
795
|
-
# @param resource_group_name [String] The name of the resource group.
|
796
|
-
# @param lab_name [String] The name of the lab.
|
797
|
-
# @param name [String] The name of the virtual Machine.
|
798
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
799
|
-
# will be added to the HTTP request.
|
800
|
-
#
|
801
|
-
def start(resource_group_name, lab_name, name, custom_headers = nil)
|
802
|
-
response = start_async(resource_group_name, lab_name, name, custom_headers).value!
|
803
|
-
nil
|
804
|
-
end
|
805
|
-
|
806
|
-
#
|
807
|
-
# @param resource_group_name [String] The name of the resource group.
|
808
|
-
# @param lab_name [String] The name of the lab.
|
809
|
-
# @param name [String] The name of the virtual Machine.
|
810
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
811
|
-
# will be added to the HTTP request.
|
812
|
-
#
|
813
|
-
# @return [Concurrent::Promise] promise which provides async access to http
|
814
|
-
# response.
|
815
|
-
#
|
816
|
-
def start_async(resource_group_name, lab_name, name, custom_headers = nil)
|
817
|
-
# Send request
|
818
|
-
promise = begin_start_async(resource_group_name, lab_name, name, custom_headers)
|
819
|
-
|
820
|
-
promise = promise.then do |response|
|
821
|
-
# Defining deserialization method.
|
822
|
-
deserialize_method = lambda do |parsed_response|
|
823
|
-
end
|
824
|
-
|
825
|
-
# Waiting for response.
|
826
|
-
@client.get_long_running_operation_result(response, deserialize_method)
|
827
|
-
end
|
828
|
-
|
829
|
-
promise
|
830
|
-
end
|
831
|
-
|
832
845
|
#
|
833
846
|
# Start a Lab VM. This operation can take a while to complete.
|
834
847
|
#
|
@@ -913,46 +926,6 @@ module Azure::ARM::DevTestLabs
|
|
913
926
|
promise.execute
|
914
927
|
end
|
915
928
|
|
916
|
-
#
|
917
|
-
# Stop a Lab VM. This operation can take a while to complete.
|
918
|
-
#
|
919
|
-
# @param resource_group_name [String] The name of the resource group.
|
920
|
-
# @param lab_name [String] The name of the lab.
|
921
|
-
# @param name [String] The name of the virtual Machine.
|
922
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
923
|
-
# will be added to the HTTP request.
|
924
|
-
#
|
925
|
-
def stop(resource_group_name, lab_name, name, custom_headers = nil)
|
926
|
-
response = stop_async(resource_group_name, lab_name, name, custom_headers).value!
|
927
|
-
nil
|
928
|
-
end
|
929
|
-
|
930
|
-
#
|
931
|
-
# @param resource_group_name [String] The name of the resource group.
|
932
|
-
# @param lab_name [String] The name of the lab.
|
933
|
-
# @param name [String] The name of the virtual Machine.
|
934
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
935
|
-
# will be added to the HTTP request.
|
936
|
-
#
|
937
|
-
# @return [Concurrent::Promise] promise which provides async access to http
|
938
|
-
# response.
|
939
|
-
#
|
940
|
-
def stop_async(resource_group_name, lab_name, name, custom_headers = nil)
|
941
|
-
# Send request
|
942
|
-
promise = begin_stop_async(resource_group_name, lab_name, name, custom_headers)
|
943
|
-
|
944
|
-
promise = promise.then do |response|
|
945
|
-
# Defining deserialization method.
|
946
|
-
deserialize_method = lambda do |parsed_response|
|
947
|
-
end
|
948
|
-
|
949
|
-
# Waiting for response.
|
950
|
-
@client.get_long_running_operation_result(response, deserialize_method)
|
951
|
-
end
|
952
|
-
|
953
|
-
promise
|
954
|
-
end
|
955
|
-
|
956
929
|
#
|
957
930
|
# Stop a Lab VM. This operation can take a while to complete.
|
958
931
|
#
|
@@ -1040,8 +1013,8 @@ module Azure::ARM::DevTestLabs
|
|
1040
1013
|
#
|
1041
1014
|
# List virtual machines in a given lab.
|
1042
1015
|
#
|
1043
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
1044
|
-
#
|
1016
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1017
|
+
# to List operation.
|
1045
1018
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1046
1019
|
# will be added to the HTTP request.
|
1047
1020
|
#
|
@@ -1055,8 +1028,8 @@ module Azure::ARM::DevTestLabs
|
|
1055
1028
|
#
|
1056
1029
|
# List virtual machines in a given lab.
|
1057
1030
|
#
|
1058
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
1059
|
-
#
|
1031
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1032
|
+
# to List operation.
|
1060
1033
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1061
1034
|
# will be added to the HTTP request.
|
1062
1035
|
#
|
@@ -1069,8 +1042,8 @@ module Azure::ARM::DevTestLabs
|
|
1069
1042
|
#
|
1070
1043
|
# List virtual machines in a given lab.
|
1071
1044
|
#
|
1072
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
1073
|
-
#
|
1045
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1046
|
+
# to List operation.
|
1074
1047
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1075
1048
|
# to the HTTP request.
|
1076
1049
|
#
|
@@ -1124,5 +1097,32 @@ module Azure::ARM::DevTestLabs
|
|
1124
1097
|
promise.execute
|
1125
1098
|
end
|
1126
1099
|
|
1100
|
+
#
|
1101
|
+
# List virtual machines in a given lab.
|
1102
|
+
#
|
1103
|
+
# @param resource_group_name [String] The name of the resource group.
|
1104
|
+
# @param lab_name [String] The name of the lab.
|
1105
|
+
# @param filter [String] The filter to apply on the operation.
|
1106
|
+
# @param top [Integer] The maximum number of resources to return from the
|
1107
|
+
# operation.
|
1108
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
1109
|
+
# notation.
|
1110
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1111
|
+
# will be added to the HTTP request.
|
1112
|
+
#
|
1113
|
+
# @return [ResponseWithContinuationLabVirtualMachine] which provide lazy access
|
1114
|
+
# to pages of the response.
|
1115
|
+
#
|
1116
|
+
def list_as_lazy(resource_group_name, lab_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
|
1117
|
+
response = list_async(resource_group_name, lab_name, filter, top, order_by, custom_headers).value!
|
1118
|
+
unless response.nil?
|
1119
|
+
page = response.body
|
1120
|
+
page.next_method = Proc.new do |next_page_link|
|
1121
|
+
list_next_async(next_page_link, custom_headers)
|
1122
|
+
end
|
1123
|
+
page
|
1124
|
+
end
|
1125
|
+
end
|
1126
|
+
|
1127
1127
|
end
|
1128
1128
|
end
|