azure_mgmt_devtestlabs 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 LabOperations
|
|
11
11
|
include Azure::ARM::DevTestLabs::Models
|
|
@@ -28,33 +28,8 @@ module Azure::ARM::DevTestLabs
|
|
|
28
28
|
# @param filter [String] The filter to apply on the operation.
|
|
29
29
|
# @param top [Integer] The maximum number of resources to return from the
|
|
30
30
|
# operation.
|
|
31
|
-
# @param order_by [String] The ordering expression for the results, using
|
|
32
|
-
#
|
|
33
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
34
|
-
# will be added to the HTTP request.
|
|
35
|
-
#
|
|
36
|
-
# @return [ResponseWithContinuationLab] which provide lazy access to pages of
|
|
37
|
-
# the response.
|
|
38
|
-
#
|
|
39
|
-
def list_by_subscription_as_lazy(filter = nil, top = nil, order_by = nil, custom_headers = nil)
|
|
40
|
-
response = list_by_subscription_async(filter, top, order_by, custom_headers).value!
|
|
41
|
-
unless response.nil?
|
|
42
|
-
page = response.body
|
|
43
|
-
page.next_method = Proc.new do |next_page_link|
|
|
44
|
-
list_by_subscription_next_async(next_page_link, custom_headers)
|
|
45
|
-
end
|
|
46
|
-
page
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
#
|
|
51
|
-
# List labs in a subscription.
|
|
52
|
-
#
|
|
53
|
-
# @param filter [String] The filter to apply on the operation.
|
|
54
|
-
# @param top [Integer] The maximum number of resources to return from the
|
|
55
|
-
# operation.
|
|
56
|
-
# @param order_by [String] The ordering expression for the results, using
|
|
57
|
-
# OData notation.
|
|
31
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
|
32
|
+
# notation.
|
|
58
33
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
59
34
|
# will be added to the HTTP request.
|
|
60
35
|
#
|
|
@@ -71,8 +46,8 @@ module Azure::ARM::DevTestLabs
|
|
|
71
46
|
# @param filter [String] The filter to apply on the operation.
|
|
72
47
|
# @param top [Integer] The maximum number of resources to return from the
|
|
73
48
|
# operation.
|
|
74
|
-
# @param order_by [String] The ordering expression for the results, using
|
|
75
|
-
#
|
|
49
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
|
50
|
+
# notation.
|
|
76
51
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
77
52
|
# will be added to the HTTP request.
|
|
78
53
|
#
|
|
@@ -88,8 +63,8 @@ module Azure::ARM::DevTestLabs
|
|
|
88
63
|
# @param filter [String] The filter to apply on the operation.
|
|
89
64
|
# @param top [Integer] The maximum number of resources to return from the
|
|
90
65
|
# operation.
|
|
91
|
-
# @param order_by [String] The ordering expression for the results, using
|
|
92
|
-
#
|
|
66
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
|
67
|
+
# notation.
|
|
93
68
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
94
69
|
# to the HTTP request.
|
|
95
70
|
#
|
|
@@ -152,34 +127,8 @@ module Azure::ARM::DevTestLabs
|
|
|
152
127
|
# @param filter [String] The filter to apply on the operation.
|
|
153
128
|
# @param top [Integer] The maximum number of resources to return from the
|
|
154
129
|
# operation.
|
|
155
|
-
# @param order_by [String] The ordering expression for the results, using
|
|
156
|
-
#
|
|
157
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
158
|
-
# will be added to the HTTP request.
|
|
159
|
-
#
|
|
160
|
-
# @return [ResponseWithContinuationLab] which provide lazy access to pages of
|
|
161
|
-
# the response.
|
|
162
|
-
#
|
|
163
|
-
def list_by_resource_group_as_lazy(resource_group_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
|
|
164
|
-
response = list_by_resource_group_async(resource_group_name, filter, top, order_by, custom_headers).value!
|
|
165
|
-
unless response.nil?
|
|
166
|
-
page = response.body
|
|
167
|
-
page.next_method = Proc.new do |next_page_link|
|
|
168
|
-
list_by_resource_group_next_async(next_page_link, custom_headers)
|
|
169
|
-
end
|
|
170
|
-
page
|
|
171
|
-
end
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
#
|
|
175
|
-
# List labs in a resource group.
|
|
176
|
-
#
|
|
177
|
-
# @param resource_group_name [String] The name of the resource group.
|
|
178
|
-
# @param filter [String] The filter to apply on the operation.
|
|
179
|
-
# @param top [Integer] The maximum number of resources to return from the
|
|
180
|
-
# operation.
|
|
181
|
-
# @param order_by [String] The ordering expression for the results, using
|
|
182
|
-
# OData notation.
|
|
130
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
|
131
|
+
# notation.
|
|
183
132
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
184
133
|
# will be added to the HTTP request.
|
|
185
134
|
#
|
|
@@ -197,8 +146,8 @@ module Azure::ARM::DevTestLabs
|
|
|
197
146
|
# @param filter [String] The filter to apply on the operation.
|
|
198
147
|
# @param top [Integer] The maximum number of resources to return from the
|
|
199
148
|
# operation.
|
|
200
|
-
# @param order_by [String] The ordering expression for the results, using
|
|
201
|
-
#
|
|
149
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
|
150
|
+
# notation.
|
|
202
151
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
203
152
|
# will be added to the HTTP request.
|
|
204
153
|
#
|
|
@@ -215,8 +164,8 @@ module Azure::ARM::DevTestLabs
|
|
|
215
164
|
# @param filter [String] The filter to apply on the operation.
|
|
216
165
|
# @param top [Integer] The maximum number of resources to return from the
|
|
217
166
|
# operation.
|
|
218
|
-
# @param order_by [String] The ordering expression for the results, using
|
|
219
|
-
#
|
|
167
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
|
168
|
+
# notation.
|
|
220
169
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
221
170
|
# to the HTTP request.
|
|
222
171
|
#
|
|
@@ -410,8 +359,45 @@ module Azure::ARM::DevTestLabs
|
|
|
410
359
|
end
|
|
411
360
|
|
|
412
361
|
#
|
|
413
|
-
#
|
|
414
|
-
#
|
|
362
|
+
# Delete lab. This operation can take a while to complete.
|
|
363
|
+
#
|
|
364
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
365
|
+
# @param name [String] The name of the lab.
|
|
366
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
367
|
+
# will be added to the HTTP request.
|
|
368
|
+
#
|
|
369
|
+
def delete_resource(resource_group_name, name, custom_headers = nil)
|
|
370
|
+
response = delete_resource_async(resource_group_name, name, custom_headers).value!
|
|
371
|
+
nil
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
#
|
|
375
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
376
|
+
# @param name [String] The name of the lab.
|
|
377
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
378
|
+
# will be added to the HTTP request.
|
|
379
|
+
#
|
|
380
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
381
|
+
# response.
|
|
382
|
+
#
|
|
383
|
+
def delete_resource_async(resource_group_name, name, custom_headers = nil)
|
|
384
|
+
# Send request
|
|
385
|
+
promise = begin_delete_resource_async(resource_group_name, name, custom_headers)
|
|
386
|
+
|
|
387
|
+
promise = promise.then do |response|
|
|
388
|
+
# Defining deserialization method.
|
|
389
|
+
deserialize_method = lambda do |parsed_response|
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
# Waiting for response.
|
|
393
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
promise
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
#
|
|
400
|
+
# Modify properties of labs.
|
|
415
401
|
#
|
|
416
402
|
# @param resource_group_name [String] The name of the resource group.
|
|
417
403
|
# @param name [String] The name of the lab.
|
|
@@ -421,14 +407,13 @@ module Azure::ARM::DevTestLabs
|
|
|
421
407
|
#
|
|
422
408
|
# @return [Lab] operation results.
|
|
423
409
|
#
|
|
424
|
-
def
|
|
425
|
-
response =
|
|
410
|
+
def patch_resource(resource_group_name, name, lab, custom_headers = nil)
|
|
411
|
+
response = patch_resource_async(resource_group_name, name, lab, custom_headers).value!
|
|
426
412
|
response.body unless response.nil?
|
|
427
413
|
end
|
|
428
414
|
|
|
429
415
|
#
|
|
430
|
-
#
|
|
431
|
-
# complete.
|
|
416
|
+
# Modify properties of labs.
|
|
432
417
|
#
|
|
433
418
|
# @param resource_group_name [String] The name of the resource group.
|
|
434
419
|
# @param name [String] The name of the lab.
|
|
@@ -438,13 +423,12 @@ module Azure::ARM::DevTestLabs
|
|
|
438
423
|
#
|
|
439
424
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
440
425
|
#
|
|
441
|
-
def
|
|
442
|
-
|
|
426
|
+
def patch_resource_with_http_info(resource_group_name, name, lab, custom_headers = nil)
|
|
427
|
+
patch_resource_async(resource_group_name, name, lab, custom_headers).value!
|
|
443
428
|
end
|
|
444
429
|
|
|
445
430
|
#
|
|
446
|
-
#
|
|
447
|
-
# complete.
|
|
431
|
+
# Modify properties of labs.
|
|
448
432
|
#
|
|
449
433
|
# @param resource_group_name [String] The name of the resource group.
|
|
450
434
|
# @param name [String] The name of the lab.
|
|
@@ -454,7 +438,7 @@ module Azure::ARM::DevTestLabs
|
|
|
454
438
|
#
|
|
455
439
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
456
440
|
#
|
|
457
|
-
def
|
|
441
|
+
def patch_resource_async(resource_group_name, name, lab, custom_headers = nil)
|
|
458
442
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
459
443
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
460
444
|
fail ArgumentError, 'name is nil' if name.nil?
|
|
@@ -487,13 +471,13 @@ module Azure::ARM::DevTestLabs
|
|
|
487
471
|
headers: request_headers.merge(custom_headers || {}),
|
|
488
472
|
base_url: request_url
|
|
489
473
|
}
|
|
490
|
-
promise = @client.make_request_async(:
|
|
474
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
|
491
475
|
|
|
492
476
|
promise = promise.then do |result|
|
|
493
477
|
http_response = result.response
|
|
494
478
|
status_code = http_response.status
|
|
495
479
|
response_content = http_response.body
|
|
496
|
-
unless status_code == 200
|
|
480
|
+
unless status_code == 200
|
|
497
481
|
error_model = JSON.load(response_content)
|
|
498
482
|
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
499
483
|
end
|
|
@@ -509,16 +493,6 @@ module Azure::ARM::DevTestLabs
|
|
|
509
493
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
510
494
|
end
|
|
511
495
|
end
|
|
512
|
-
# Deserialize Response
|
|
513
|
-
if status_code == 201
|
|
514
|
-
begin
|
|
515
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
516
|
-
result_mapper = Lab.mapper()
|
|
517
|
-
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
518
|
-
rescue Exception => e
|
|
519
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
520
|
-
end
|
|
521
|
-
end
|
|
522
496
|
|
|
523
497
|
result
|
|
524
498
|
end
|
|
@@ -527,30 +501,33 @@ module Azure::ARM::DevTestLabs
|
|
|
527
501
|
end
|
|
528
502
|
|
|
529
503
|
#
|
|
530
|
-
#
|
|
504
|
+
# Create virtual machines in a Lab. This operation can take a while to
|
|
505
|
+
# complete.
|
|
531
506
|
#
|
|
532
507
|
# @param resource_group_name [String] The name of the resource group.
|
|
533
508
|
# @param name [String] The name of the lab.
|
|
509
|
+
# @param lab_virtual_machine [LabVirtualMachine]
|
|
534
510
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
535
511
|
# will be added to the HTTP request.
|
|
536
512
|
#
|
|
537
|
-
def
|
|
538
|
-
response =
|
|
513
|
+
def create_environment(resource_group_name, name, lab_virtual_machine, custom_headers = nil)
|
|
514
|
+
response = create_environment_async(resource_group_name, name, lab_virtual_machine, custom_headers).value!
|
|
539
515
|
nil
|
|
540
516
|
end
|
|
541
517
|
|
|
542
518
|
#
|
|
543
519
|
# @param resource_group_name [String] The name of the resource group.
|
|
544
520
|
# @param name [String] The name of the lab.
|
|
521
|
+
# @param lab_virtual_machine [LabVirtualMachine]
|
|
545
522
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
546
523
|
# will be added to the HTTP request.
|
|
547
524
|
#
|
|
548
525
|
# @return [Concurrent::Promise] promise which provides async access to http
|
|
549
526
|
# response.
|
|
550
527
|
#
|
|
551
|
-
def
|
|
528
|
+
def create_environment_async(resource_group_name, name, lab_virtual_machine, custom_headers = nil)
|
|
552
529
|
# Send request
|
|
553
|
-
promise =
|
|
530
|
+
promise = begin_create_environment_async(resource_group_name, name, lab_virtual_machine, custom_headers)
|
|
554
531
|
|
|
555
532
|
promise = promise.then do |response|
|
|
556
533
|
# Defining deserialization method.
|
|
@@ -565,47 +542,52 @@ module Azure::ARM::DevTestLabs
|
|
|
565
542
|
end
|
|
566
543
|
|
|
567
544
|
#
|
|
568
|
-
#
|
|
545
|
+
# Generate a URI for uploading custom disk images to a Lab.
|
|
569
546
|
#
|
|
570
547
|
# @param resource_group_name [String] The name of the resource group.
|
|
571
548
|
# @param name [String] The name of the lab.
|
|
549
|
+
# @param generate_upload_uri_parameter [GenerateUploadUriParameter]
|
|
572
550
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
573
551
|
# will be added to the HTTP request.
|
|
574
552
|
#
|
|
553
|
+
# @return [GenerateUploadUriResponse] operation results.
|
|
575
554
|
#
|
|
576
|
-
def
|
|
577
|
-
response =
|
|
578
|
-
nil
|
|
555
|
+
def generate_upload_uri(resource_group_name, name, generate_upload_uri_parameter, custom_headers = nil)
|
|
556
|
+
response = generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers).value!
|
|
557
|
+
response.body unless response.nil?
|
|
579
558
|
end
|
|
580
559
|
|
|
581
560
|
#
|
|
582
|
-
#
|
|
561
|
+
# Generate a URI for uploading custom disk images to a Lab.
|
|
583
562
|
#
|
|
584
563
|
# @param resource_group_name [String] The name of the resource group.
|
|
585
564
|
# @param name [String] The name of the lab.
|
|
565
|
+
# @param generate_upload_uri_parameter [GenerateUploadUriParameter]
|
|
586
566
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
587
567
|
# will be added to the HTTP request.
|
|
588
568
|
#
|
|
589
569
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
590
570
|
#
|
|
591
|
-
def
|
|
592
|
-
|
|
571
|
+
def generate_upload_uri_with_http_info(resource_group_name, name, generate_upload_uri_parameter, custom_headers = nil)
|
|
572
|
+
generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers).value!
|
|
593
573
|
end
|
|
594
574
|
|
|
595
575
|
#
|
|
596
|
-
#
|
|
576
|
+
# Generate a URI for uploading custom disk images to a Lab.
|
|
597
577
|
#
|
|
598
578
|
# @param resource_group_name [String] The name of the resource group.
|
|
599
579
|
# @param name [String] The name of the lab.
|
|
580
|
+
# @param generate_upload_uri_parameter [GenerateUploadUriParameter]
|
|
600
581
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
601
582
|
# to the HTTP request.
|
|
602
583
|
#
|
|
603
584
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
604
585
|
#
|
|
605
|
-
def
|
|
586
|
+
def generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers = nil)
|
|
606
587
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
607
588
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
608
589
|
fail ArgumentError, 'name is nil' if name.nil?
|
|
590
|
+
fail ArgumentError, 'generate_upload_uri_parameter is nil' if generate_upload_uri_parameter.nil?
|
|
609
591
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
610
592
|
|
|
611
593
|
|
|
@@ -614,7 +596,15 @@ module Azure::ARM::DevTestLabs
|
|
|
614
596
|
# Set Headers
|
|
615
597
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
616
598
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
617
|
-
|
|
599
|
+
|
|
600
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
601
|
+
|
|
602
|
+
# Serialize Request
|
|
603
|
+
request_mapper = GenerateUploadUriParameter.mapper()
|
|
604
|
+
request_content = @client.serialize(request_mapper, generate_upload_uri_parameter, 'generate_upload_uri_parameter')
|
|
605
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
606
|
+
|
|
607
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/generateUploadUri'
|
|
618
608
|
|
|
619
609
|
request_url = @base_url || @client.base_url
|
|
620
610
|
|
|
@@ -622,21 +612,32 @@ module Azure::ARM::DevTestLabs
|
|
|
622
612
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
623
613
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
|
|
624
614
|
query_params: {'api-version' => @client.api_version},
|
|
615
|
+
body: request_content,
|
|
625
616
|
headers: request_headers.merge(custom_headers || {}),
|
|
626
617
|
base_url: request_url
|
|
627
618
|
}
|
|
628
|
-
promise = @client.make_request_async(:
|
|
619
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
629
620
|
|
|
630
621
|
promise = promise.then do |result|
|
|
631
622
|
http_response = result.response
|
|
632
623
|
status_code = http_response.status
|
|
633
624
|
response_content = http_response.body
|
|
634
|
-
unless status_code ==
|
|
625
|
+
unless status_code == 200
|
|
635
626
|
error_model = JSON.load(response_content)
|
|
636
627
|
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
637
628
|
end
|
|
638
629
|
|
|
639
630
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
631
|
+
# Deserialize Response
|
|
632
|
+
if status_code == 200
|
|
633
|
+
begin
|
|
634
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
635
|
+
result_mapper = GenerateUploadUriResponse.mapper()
|
|
636
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
637
|
+
rescue Exception => e
|
|
638
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
639
|
+
end
|
|
640
|
+
end
|
|
640
641
|
|
|
641
642
|
result
|
|
642
643
|
end
|
|
@@ -645,52 +646,48 @@ module Azure::ARM::DevTestLabs
|
|
|
645
646
|
end
|
|
646
647
|
|
|
647
648
|
#
|
|
648
|
-
#
|
|
649
|
+
# List disk images available for custom image creation.
|
|
649
650
|
#
|
|
650
651
|
# @param resource_group_name [String] The name of the resource group.
|
|
651
652
|
# @param name [String] The name of the lab.
|
|
652
|
-
# @param lab [Lab]
|
|
653
653
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
654
654
|
# will be added to the HTTP request.
|
|
655
655
|
#
|
|
656
|
-
# @return [
|
|
656
|
+
# @return [Array<LabVhd>] operation results.
|
|
657
657
|
#
|
|
658
|
-
def
|
|
659
|
-
|
|
660
|
-
|
|
658
|
+
def list_vhds(resource_group_name, name, custom_headers = nil)
|
|
659
|
+
first_page = list_vhds_as_lazy(resource_group_name, name, custom_headers)
|
|
660
|
+
first_page.get_all_items
|
|
661
661
|
end
|
|
662
662
|
|
|
663
663
|
#
|
|
664
|
-
#
|
|
664
|
+
# List disk images available for custom image creation.
|
|
665
665
|
#
|
|
666
666
|
# @param resource_group_name [String] The name of the resource group.
|
|
667
667
|
# @param name [String] The name of the lab.
|
|
668
|
-
# @param lab [Lab]
|
|
669
668
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
670
669
|
# will be added to the HTTP request.
|
|
671
670
|
#
|
|
672
671
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
673
672
|
#
|
|
674
|
-
def
|
|
675
|
-
|
|
673
|
+
def list_vhds_with_http_info(resource_group_name, name, custom_headers = nil)
|
|
674
|
+
list_vhds_async(resource_group_name, name, custom_headers).value!
|
|
676
675
|
end
|
|
677
676
|
|
|
678
677
|
#
|
|
679
|
-
#
|
|
678
|
+
# List disk images available for custom image creation.
|
|
680
679
|
#
|
|
681
680
|
# @param resource_group_name [String] The name of the resource group.
|
|
682
681
|
# @param name [String] The name of the lab.
|
|
683
|
-
# @param lab [Lab]
|
|
684
682
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
685
683
|
# to the HTTP request.
|
|
686
684
|
#
|
|
687
685
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
688
686
|
#
|
|
689
|
-
def
|
|
687
|
+
def list_vhds_async(resource_group_name, name, custom_headers = nil)
|
|
690
688
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
691
689
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
692
690
|
fail ArgumentError, 'name is nil' if name.nil?
|
|
693
|
-
fail ArgumentError, 'lab is nil' if lab.nil?
|
|
694
691
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
695
692
|
|
|
696
693
|
|
|
@@ -699,15 +696,7 @@ module Azure::ARM::DevTestLabs
|
|
|
699
696
|
# Set Headers
|
|
700
697
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
701
698
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
702
|
-
|
|
703
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
704
|
-
|
|
705
|
-
# Serialize Request
|
|
706
|
-
request_mapper = Lab.mapper()
|
|
707
|
-
request_content = @client.serialize(request_mapper, lab, 'lab')
|
|
708
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
709
|
-
|
|
710
|
-
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'
|
|
699
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/listVhds'
|
|
711
700
|
|
|
712
701
|
request_url = @base_url || @client.base_url
|
|
713
702
|
|
|
@@ -715,11 +704,10 @@ module Azure::ARM::DevTestLabs
|
|
|
715
704
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
716
705
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
|
|
717
706
|
query_params: {'api-version' => @client.api_version},
|
|
718
|
-
body: request_content,
|
|
719
707
|
headers: request_headers.merge(custom_headers || {}),
|
|
720
708
|
base_url: request_url
|
|
721
709
|
}
|
|
722
|
-
promise = @client.make_request_async(:
|
|
710
|
+
promise = @client.make_request_async(:post, path_template, options)
|
|
723
711
|
|
|
724
712
|
promise = promise.then do |result|
|
|
725
713
|
http_response = result.response
|
|
@@ -735,7 +723,7 @@ module Azure::ARM::DevTestLabs
|
|
|
735
723
|
if status_code == 200
|
|
736
724
|
begin
|
|
737
725
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
738
|
-
result_mapper =
|
|
726
|
+
result_mapper = ResponseWithContinuationLabVhd.mapper()
|
|
739
727
|
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
740
728
|
rescue Exception => e
|
|
741
729
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
@@ -749,95 +737,55 @@ module Azure::ARM::DevTestLabs
|
|
|
749
737
|
end
|
|
750
738
|
|
|
751
739
|
#
|
|
752
|
-
# Create
|
|
753
|
-
# complete.
|
|
754
|
-
#
|
|
755
|
-
# @param resource_group_name [String] The name of the resource group.
|
|
756
|
-
# @param name [String] The name of the lab.
|
|
757
|
-
# @param lab_virtual_machine [LabVirtualMachine]
|
|
758
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
759
|
-
# will be added to the HTTP request.
|
|
760
|
-
#
|
|
761
|
-
def create_environment(resource_group_name, name, lab_virtual_machine, custom_headers = nil)
|
|
762
|
-
response = create_environment_async(resource_group_name, name, lab_virtual_machine, custom_headers).value!
|
|
763
|
-
nil
|
|
764
|
-
end
|
|
765
|
-
|
|
766
|
-
#
|
|
767
|
-
# @param resource_group_name [String] The name of the resource group.
|
|
768
|
-
# @param name [String] The name of the lab.
|
|
769
|
-
# @param lab_virtual_machine [LabVirtualMachine]
|
|
770
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
771
|
-
# will be added to the HTTP request.
|
|
772
|
-
#
|
|
773
|
-
# @return [Concurrent::Promise] promise which provides async access to http
|
|
774
|
-
# response.
|
|
775
|
-
#
|
|
776
|
-
def create_environment_async(resource_group_name, name, lab_virtual_machine, custom_headers = nil)
|
|
777
|
-
# Send request
|
|
778
|
-
promise = begin_create_environment_async(resource_group_name, name, lab_virtual_machine, custom_headers)
|
|
779
|
-
|
|
780
|
-
promise = promise.then do |response|
|
|
781
|
-
# Defining deserialization method.
|
|
782
|
-
deserialize_method = lambda do |parsed_response|
|
|
783
|
-
end
|
|
784
|
-
|
|
785
|
-
# Waiting for response.
|
|
786
|
-
@client.get_long_running_operation_result(response, deserialize_method)
|
|
787
|
-
end
|
|
788
|
-
|
|
789
|
-
promise
|
|
790
|
-
end
|
|
791
|
-
|
|
792
|
-
#
|
|
793
|
-
# Create virtual machines in a Lab. This operation can take a while to
|
|
740
|
+
# Create or replace an existing Lab. This operation can take a while to
|
|
794
741
|
# complete.
|
|
795
742
|
#
|
|
796
743
|
# @param resource_group_name [String] The name of the resource group.
|
|
797
744
|
# @param name [String] The name of the lab.
|
|
798
|
-
# @param
|
|
745
|
+
# @param lab [Lab]
|
|
799
746
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
800
747
|
# will be added to the HTTP request.
|
|
801
748
|
#
|
|
749
|
+
# @return [Lab] operation results.
|
|
802
750
|
#
|
|
803
|
-
def
|
|
804
|
-
response =
|
|
805
|
-
nil
|
|
751
|
+
def begin_create_or_update_resource(resource_group_name, name, lab, custom_headers = nil)
|
|
752
|
+
response = begin_create_or_update_resource_async(resource_group_name, name, lab, custom_headers).value!
|
|
753
|
+
response.body unless response.nil?
|
|
806
754
|
end
|
|
807
755
|
|
|
808
756
|
#
|
|
809
|
-
# Create
|
|
757
|
+
# Create or replace an existing Lab. This operation can take a while to
|
|
810
758
|
# complete.
|
|
811
759
|
#
|
|
812
760
|
# @param resource_group_name [String] The name of the resource group.
|
|
813
761
|
# @param name [String] The name of the lab.
|
|
814
|
-
# @param
|
|
762
|
+
# @param lab [Lab]
|
|
815
763
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
816
764
|
# will be added to the HTTP request.
|
|
817
765
|
#
|
|
818
766
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
819
767
|
#
|
|
820
|
-
def
|
|
821
|
-
|
|
768
|
+
def begin_create_or_update_resource_with_http_info(resource_group_name, name, lab, custom_headers = nil)
|
|
769
|
+
begin_create_or_update_resource_async(resource_group_name, name, lab, custom_headers).value!
|
|
822
770
|
end
|
|
823
771
|
|
|
824
772
|
#
|
|
825
|
-
# Create
|
|
773
|
+
# Create or replace an existing Lab. This operation can take a while to
|
|
826
774
|
# complete.
|
|
827
775
|
#
|
|
828
776
|
# @param resource_group_name [String] The name of the resource group.
|
|
829
777
|
# @param name [String] The name of the lab.
|
|
830
|
-
# @param
|
|
778
|
+
# @param lab [Lab]
|
|
831
779
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
832
780
|
# to the HTTP request.
|
|
833
781
|
#
|
|
834
782
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
835
783
|
#
|
|
836
|
-
def
|
|
784
|
+
def begin_create_or_update_resource_async(resource_group_name, name, lab, custom_headers = nil)
|
|
837
785
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
838
786
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
839
787
|
fail ArgumentError, 'name is nil' if name.nil?
|
|
840
|
-
fail ArgumentError, '
|
|
788
|
+
fail ArgumentError, 'lab is nil' if lab.nil?
|
|
841
789
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
842
790
|
|
|
843
791
|
|
|
@@ -850,11 +798,11 @@ module Azure::ARM::DevTestLabs
|
|
|
850
798
|
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
851
799
|
|
|
852
800
|
# Serialize Request
|
|
853
|
-
request_mapper =
|
|
854
|
-
request_content = @client.serialize(request_mapper,
|
|
801
|
+
request_mapper = Lab.mapper()
|
|
802
|
+
request_content = @client.serialize(request_mapper, lab, 'lab')
|
|
855
803
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
856
804
|
|
|
857
|
-
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}
|
|
805
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'
|
|
858
806
|
|
|
859
807
|
request_url = @base_url || @client.base_url
|
|
860
808
|
|
|
@@ -866,18 +814,38 @@ module Azure::ARM::DevTestLabs
|
|
|
866
814
|
headers: request_headers.merge(custom_headers || {}),
|
|
867
815
|
base_url: request_url
|
|
868
816
|
}
|
|
869
|
-
promise = @client.make_request_async(:
|
|
817
|
+
promise = @client.make_request_async(:put, path_template, options)
|
|
870
818
|
|
|
871
819
|
promise = promise.then do |result|
|
|
872
820
|
http_response = result.response
|
|
873
821
|
status_code = http_response.status
|
|
874
822
|
response_content = http_response.body
|
|
875
|
-
unless status_code == 200 || status_code ==
|
|
823
|
+
unless status_code == 200 || status_code == 201
|
|
876
824
|
error_model = JSON.load(response_content)
|
|
877
825
|
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
878
826
|
end
|
|
879
827
|
|
|
880
828
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
829
|
+
# Deserialize Response
|
|
830
|
+
if status_code == 200
|
|
831
|
+
begin
|
|
832
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
833
|
+
result_mapper = Lab.mapper()
|
|
834
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
835
|
+
rescue Exception => e
|
|
836
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
837
|
+
end
|
|
838
|
+
end
|
|
839
|
+
# Deserialize Response
|
|
840
|
+
if status_code == 201
|
|
841
|
+
begin
|
|
842
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
843
|
+
result_mapper = Lab.mapper()
|
|
844
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
845
|
+
rescue Exception => e
|
|
846
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
847
|
+
end
|
|
848
|
+
end
|
|
881
849
|
|
|
882
850
|
result
|
|
883
851
|
end
|
|
@@ -886,52 +854,47 @@ module Azure::ARM::DevTestLabs
|
|
|
886
854
|
end
|
|
887
855
|
|
|
888
856
|
#
|
|
889
|
-
#
|
|
857
|
+
# Delete lab. This operation can take a while to complete.
|
|
890
858
|
#
|
|
891
859
|
# @param resource_group_name [String] The name of the resource group.
|
|
892
860
|
# @param name [String] The name of the lab.
|
|
893
|
-
# @param generate_upload_uri_parameter [GenerateUploadUriParameter]
|
|
894
861
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
895
862
|
# will be added to the HTTP request.
|
|
896
863
|
#
|
|
897
|
-
# @return [GenerateUploadUriResponse] operation results.
|
|
898
864
|
#
|
|
899
|
-
def
|
|
900
|
-
response =
|
|
901
|
-
|
|
865
|
+
def begin_delete_resource(resource_group_name, name, custom_headers = nil)
|
|
866
|
+
response = begin_delete_resource_async(resource_group_name, name, custom_headers).value!
|
|
867
|
+
nil
|
|
902
868
|
end
|
|
903
869
|
|
|
904
870
|
#
|
|
905
|
-
#
|
|
871
|
+
# Delete lab. This operation can take a while to complete.
|
|
906
872
|
#
|
|
907
873
|
# @param resource_group_name [String] The name of the resource group.
|
|
908
874
|
# @param name [String] The name of the lab.
|
|
909
|
-
# @param generate_upload_uri_parameter [GenerateUploadUriParameter]
|
|
910
875
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
911
876
|
# will be added to the HTTP request.
|
|
912
877
|
#
|
|
913
878
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
914
879
|
#
|
|
915
|
-
def
|
|
916
|
-
|
|
880
|
+
def begin_delete_resource_with_http_info(resource_group_name, name, custom_headers = nil)
|
|
881
|
+
begin_delete_resource_async(resource_group_name, name, custom_headers).value!
|
|
917
882
|
end
|
|
918
883
|
|
|
919
884
|
#
|
|
920
|
-
#
|
|
885
|
+
# Delete lab. This operation can take a while to complete.
|
|
921
886
|
#
|
|
922
887
|
# @param resource_group_name [String] The name of the resource group.
|
|
923
888
|
# @param name [String] The name of the lab.
|
|
924
|
-
# @param generate_upload_uri_parameter [GenerateUploadUriParameter]
|
|
925
889
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
926
890
|
# to the HTTP request.
|
|
927
891
|
#
|
|
928
892
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
929
893
|
#
|
|
930
|
-
def
|
|
894
|
+
def begin_delete_resource_async(resource_group_name, name, custom_headers = nil)
|
|
931
895
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
932
896
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
933
897
|
fail ArgumentError, 'name is nil' if name.nil?
|
|
934
|
-
fail ArgumentError, 'generate_upload_uri_parameter is nil' if generate_upload_uri_parameter.nil?
|
|
935
898
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
936
899
|
|
|
937
900
|
|
|
@@ -940,15 +903,7 @@ module Azure::ARM::DevTestLabs
|
|
|
940
903
|
# Set Headers
|
|
941
904
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
942
905
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
943
|
-
|
|
944
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
945
|
-
|
|
946
|
-
# Serialize Request
|
|
947
|
-
request_mapper = GenerateUploadUriParameter.mapper()
|
|
948
|
-
request_content = @client.serialize(request_mapper, generate_upload_uri_parameter, 'generate_upload_uri_parameter')
|
|
949
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
950
|
-
|
|
951
|
-
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/generateUploadUri'
|
|
906
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'
|
|
952
907
|
|
|
953
908
|
request_url = @base_url || @client.base_url
|
|
954
909
|
|
|
@@ -956,32 +911,21 @@ module Azure::ARM::DevTestLabs
|
|
|
956
911
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
957
912
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
|
|
958
913
|
query_params: {'api-version' => @client.api_version},
|
|
959
|
-
body: request_content,
|
|
960
914
|
headers: request_headers.merge(custom_headers || {}),
|
|
961
915
|
base_url: request_url
|
|
962
916
|
}
|
|
963
|
-
promise = @client.make_request_async(:
|
|
917
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
|
964
918
|
|
|
965
919
|
promise = promise.then do |result|
|
|
966
920
|
http_response = result.response
|
|
967
921
|
status_code = http_response.status
|
|
968
922
|
response_content = http_response.body
|
|
969
|
-
unless status_code ==
|
|
923
|
+
unless status_code == 202 || status_code == 204
|
|
970
924
|
error_model = JSON.load(response_content)
|
|
971
925
|
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
972
926
|
end
|
|
973
927
|
|
|
974
928
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
975
|
-
# Deserialize Response
|
|
976
|
-
if status_code == 200
|
|
977
|
-
begin
|
|
978
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
979
|
-
result_mapper = GenerateUploadUriResponse.mapper()
|
|
980
|
-
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
981
|
-
rescue Exception => e
|
|
982
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
983
|
-
end
|
|
984
|
-
end
|
|
985
929
|
|
|
986
930
|
result
|
|
987
931
|
end
|
|
@@ -990,70 +934,54 @@ module Azure::ARM::DevTestLabs
|
|
|
990
934
|
end
|
|
991
935
|
|
|
992
936
|
#
|
|
993
|
-
#
|
|
994
|
-
#
|
|
995
|
-
# @param resource_group_name [String] The name of the resource group.
|
|
996
|
-
# @param name [String] The name of the lab.
|
|
997
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
998
|
-
# will be added to the HTTP request.
|
|
999
|
-
#
|
|
1000
|
-
# @return [ResponseWithContinuationLabVhd] which provide lazy access to pages
|
|
1001
|
-
# of the response.
|
|
1002
|
-
#
|
|
1003
|
-
def list_vhds_as_lazy(resource_group_name, name, custom_headers = nil)
|
|
1004
|
-
response = list_vhds_async(resource_group_name, name, custom_headers).value!
|
|
1005
|
-
unless response.nil?
|
|
1006
|
-
page = response.body
|
|
1007
|
-
page.next_method = Proc.new do |next_page_link|
|
|
1008
|
-
list_vhds_next_async(next_page_link, custom_headers)
|
|
1009
|
-
end
|
|
1010
|
-
page
|
|
1011
|
-
end
|
|
1012
|
-
end
|
|
1013
|
-
|
|
1014
|
-
#
|
|
1015
|
-
# List disk images available for custom image creation.
|
|
937
|
+
# Create virtual machines in a Lab. This operation can take a while to
|
|
938
|
+
# complete.
|
|
1016
939
|
#
|
|
1017
940
|
# @param resource_group_name [String] The name of the resource group.
|
|
1018
941
|
# @param name [String] The name of the lab.
|
|
942
|
+
# @param lab_virtual_machine [LabVirtualMachine]
|
|
1019
943
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1020
944
|
# will be added to the HTTP request.
|
|
1021
945
|
#
|
|
1022
|
-
# @return [Array<LabVhd>] operation results.
|
|
1023
946
|
#
|
|
1024
|
-
def
|
|
1025
|
-
|
|
1026
|
-
|
|
947
|
+
def begin_create_environment(resource_group_name, name, lab_virtual_machine, custom_headers = nil)
|
|
948
|
+
response = begin_create_environment_async(resource_group_name, name, lab_virtual_machine, custom_headers).value!
|
|
949
|
+
nil
|
|
1027
950
|
end
|
|
1028
951
|
|
|
1029
952
|
#
|
|
1030
|
-
#
|
|
953
|
+
# Create virtual machines in a Lab. This operation can take a while to
|
|
954
|
+
# complete.
|
|
1031
955
|
#
|
|
1032
956
|
# @param resource_group_name [String] The name of the resource group.
|
|
1033
957
|
# @param name [String] The name of the lab.
|
|
958
|
+
# @param lab_virtual_machine [LabVirtualMachine]
|
|
1034
959
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1035
960
|
# will be added to the HTTP request.
|
|
1036
961
|
#
|
|
1037
962
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
|
1038
963
|
#
|
|
1039
|
-
def
|
|
1040
|
-
|
|
964
|
+
def begin_create_environment_with_http_info(resource_group_name, name, lab_virtual_machine, custom_headers = nil)
|
|
965
|
+
begin_create_environment_async(resource_group_name, name, lab_virtual_machine, custom_headers).value!
|
|
1041
966
|
end
|
|
1042
967
|
|
|
1043
968
|
#
|
|
1044
|
-
#
|
|
969
|
+
# Create virtual machines in a Lab. This operation can take a while to
|
|
970
|
+
# complete.
|
|
1045
971
|
#
|
|
1046
972
|
# @param resource_group_name [String] The name of the resource group.
|
|
1047
973
|
# @param name [String] The name of the lab.
|
|
974
|
+
# @param lab_virtual_machine [LabVirtualMachine]
|
|
1048
975
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
1049
976
|
# to the HTTP request.
|
|
1050
977
|
#
|
|
1051
978
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
|
1052
979
|
#
|
|
1053
|
-
def
|
|
980
|
+
def begin_create_environment_async(resource_group_name, name, lab_virtual_machine, custom_headers = nil)
|
|
1054
981
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1055
982
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1056
983
|
fail ArgumentError, 'name is nil' if name.nil?
|
|
984
|
+
fail ArgumentError, 'lab_virtual_machine is nil' if lab_virtual_machine.nil?
|
|
1057
985
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1058
986
|
|
|
1059
987
|
|
|
@@ -1062,7 +990,15 @@ module Azure::ARM::DevTestLabs
|
|
|
1062
990
|
# Set Headers
|
|
1063
991
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1064
992
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1065
|
-
|
|
993
|
+
|
|
994
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
995
|
+
|
|
996
|
+
# Serialize Request
|
|
997
|
+
request_mapper = LabVirtualMachine.mapper()
|
|
998
|
+
request_content = @client.serialize(request_mapper, lab_virtual_machine, 'lab_virtual_machine')
|
|
999
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
|
1000
|
+
|
|
1001
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/createEnvironment'
|
|
1066
1002
|
|
|
1067
1003
|
request_url = @base_url || @client.base_url
|
|
1068
1004
|
|
|
@@ -1070,6 +1006,7 @@ module Azure::ARM::DevTestLabs
|
|
|
1070
1006
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1071
1007
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
|
|
1072
1008
|
query_params: {'api-version' => @client.api_version},
|
|
1009
|
+
body: request_content,
|
|
1073
1010
|
headers: request_headers.merge(custom_headers || {}),
|
|
1074
1011
|
base_url: request_url
|
|
1075
1012
|
}
|
|
@@ -1079,22 +1016,12 @@ module Azure::ARM::DevTestLabs
|
|
|
1079
1016
|
http_response = result.response
|
|
1080
1017
|
status_code = http_response.status
|
|
1081
1018
|
response_content = http_response.body
|
|
1082
|
-
unless status_code == 200
|
|
1019
|
+
unless status_code == 200 || status_code == 202
|
|
1083
1020
|
error_model = JSON.load(response_content)
|
|
1084
1021
|
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
|
1085
1022
|
end
|
|
1086
1023
|
|
|
1087
1024
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1088
|
-
# Deserialize Response
|
|
1089
|
-
if status_code == 200
|
|
1090
|
-
begin
|
|
1091
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1092
|
-
result_mapper = ResponseWithContinuationLabVhd.mapper()
|
|
1093
|
-
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
|
1094
|
-
rescue Exception => e
|
|
1095
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1096
|
-
end
|
|
1097
|
-
end
|
|
1098
1025
|
|
|
1099
1026
|
result
|
|
1100
1027
|
end
|
|
@@ -1105,8 +1032,8 @@ module Azure::ARM::DevTestLabs
|
|
|
1105
1032
|
#
|
|
1106
1033
|
# List labs in a subscription.
|
|
1107
1034
|
#
|
|
1108
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
|
1109
|
-
#
|
|
1035
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1036
|
+
# to List operation.
|
|
1110
1037
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1111
1038
|
# will be added to the HTTP request.
|
|
1112
1039
|
#
|
|
@@ -1120,8 +1047,8 @@ module Azure::ARM::DevTestLabs
|
|
|
1120
1047
|
#
|
|
1121
1048
|
# List labs in a subscription.
|
|
1122
1049
|
#
|
|
1123
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
|
1124
|
-
#
|
|
1050
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1051
|
+
# to List operation.
|
|
1125
1052
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1126
1053
|
# will be added to the HTTP request.
|
|
1127
1054
|
#
|
|
@@ -1134,8 +1061,8 @@ module Azure::ARM::DevTestLabs
|
|
|
1134
1061
|
#
|
|
1135
1062
|
# List labs in a subscription.
|
|
1136
1063
|
#
|
|
1137
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
|
1138
|
-
#
|
|
1064
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1065
|
+
# to List operation.
|
|
1139
1066
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
1140
1067
|
# to the HTTP request.
|
|
1141
1068
|
#
|
|
@@ -1192,8 +1119,8 @@ module Azure::ARM::DevTestLabs
|
|
|
1192
1119
|
#
|
|
1193
1120
|
# List labs in a resource group.
|
|
1194
1121
|
#
|
|
1195
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
|
1196
|
-
#
|
|
1122
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1123
|
+
# to List operation.
|
|
1197
1124
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1198
1125
|
# will be added to the HTTP request.
|
|
1199
1126
|
#
|
|
@@ -1207,8 +1134,8 @@ module Azure::ARM::DevTestLabs
|
|
|
1207
1134
|
#
|
|
1208
1135
|
# List labs in a resource group.
|
|
1209
1136
|
#
|
|
1210
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
|
1211
|
-
#
|
|
1137
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1138
|
+
# to List operation.
|
|
1212
1139
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1213
1140
|
# will be added to the HTTP request.
|
|
1214
1141
|
#
|
|
@@ -1221,8 +1148,8 @@ module Azure::ARM::DevTestLabs
|
|
|
1221
1148
|
#
|
|
1222
1149
|
# List labs in a resource group.
|
|
1223
1150
|
#
|
|
1224
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
|
1225
|
-
#
|
|
1151
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1152
|
+
# to List operation.
|
|
1226
1153
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
1227
1154
|
# to the HTTP request.
|
|
1228
1155
|
#
|
|
@@ -1279,8 +1206,8 @@ module Azure::ARM::DevTestLabs
|
|
|
1279
1206
|
#
|
|
1280
1207
|
# List disk images available for custom image creation.
|
|
1281
1208
|
#
|
|
1282
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
|
1283
|
-
#
|
|
1209
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1210
|
+
# to List operation.
|
|
1284
1211
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1285
1212
|
# will be added to the HTTP request.
|
|
1286
1213
|
#
|
|
@@ -1294,8 +1221,8 @@ module Azure::ARM::DevTestLabs
|
|
|
1294
1221
|
#
|
|
1295
1222
|
# List disk images available for custom image creation.
|
|
1296
1223
|
#
|
|
1297
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
|
1298
|
-
#
|
|
1224
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1225
|
+
# to List operation.
|
|
1299
1226
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1300
1227
|
# will be added to the HTTP request.
|
|
1301
1228
|
#
|
|
@@ -1308,8 +1235,8 @@ module Azure::ARM::DevTestLabs
|
|
|
1308
1235
|
#
|
|
1309
1236
|
# List disk images available for custom image creation.
|
|
1310
1237
|
#
|
|
1311
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
|
1312
|
-
#
|
|
1238
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
|
1239
|
+
# to List operation.
|
|
1313
1240
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
|
1314
1241
|
# to the HTTP request.
|
|
1315
1242
|
#
|
|
@@ -1363,5 +1290,78 @@ module Azure::ARM::DevTestLabs
|
|
|
1363
1290
|
promise.execute
|
|
1364
1291
|
end
|
|
1365
1292
|
|
|
1293
|
+
#
|
|
1294
|
+
# List labs in a subscription.
|
|
1295
|
+
#
|
|
1296
|
+
# @param filter [String] The filter to apply on the operation.
|
|
1297
|
+
# @param top [Integer] The maximum number of resources to return from the
|
|
1298
|
+
# operation.
|
|
1299
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
|
1300
|
+
# notation.
|
|
1301
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1302
|
+
# will be added to the HTTP request.
|
|
1303
|
+
#
|
|
1304
|
+
# @return [ResponseWithContinuationLab] which provide lazy access to pages of
|
|
1305
|
+
# the response.
|
|
1306
|
+
#
|
|
1307
|
+
def list_by_subscription_as_lazy(filter = nil, top = nil, order_by = nil, custom_headers = nil)
|
|
1308
|
+
response = list_by_subscription_async(filter, top, order_by, custom_headers).value!
|
|
1309
|
+
unless response.nil?
|
|
1310
|
+
page = response.body
|
|
1311
|
+
page.next_method = Proc.new do |next_page_link|
|
|
1312
|
+
list_by_subscription_next_async(next_page_link, custom_headers)
|
|
1313
|
+
end
|
|
1314
|
+
page
|
|
1315
|
+
end
|
|
1316
|
+
end
|
|
1317
|
+
|
|
1318
|
+
#
|
|
1319
|
+
# List labs in a resource group.
|
|
1320
|
+
#
|
|
1321
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
1322
|
+
# @param filter [String] The filter to apply on the operation.
|
|
1323
|
+
# @param top [Integer] The maximum number of resources to return from the
|
|
1324
|
+
# operation.
|
|
1325
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
|
1326
|
+
# notation.
|
|
1327
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1328
|
+
# will be added to the HTTP request.
|
|
1329
|
+
#
|
|
1330
|
+
# @return [ResponseWithContinuationLab] which provide lazy access to pages of
|
|
1331
|
+
# the response.
|
|
1332
|
+
#
|
|
1333
|
+
def list_by_resource_group_as_lazy(resource_group_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
|
|
1334
|
+
response = list_by_resource_group_async(resource_group_name, filter, top, order_by, custom_headers).value!
|
|
1335
|
+
unless response.nil?
|
|
1336
|
+
page = response.body
|
|
1337
|
+
page.next_method = Proc.new do |next_page_link|
|
|
1338
|
+
list_by_resource_group_next_async(next_page_link, custom_headers)
|
|
1339
|
+
end
|
|
1340
|
+
page
|
|
1341
|
+
end
|
|
1342
|
+
end
|
|
1343
|
+
|
|
1344
|
+
#
|
|
1345
|
+
# List disk images available for custom image creation.
|
|
1346
|
+
#
|
|
1347
|
+
# @param resource_group_name [String] The name of the resource group.
|
|
1348
|
+
# @param name [String] The name of the lab.
|
|
1349
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
|
1350
|
+
# will be added to the HTTP request.
|
|
1351
|
+
#
|
|
1352
|
+
# @return [ResponseWithContinuationLabVhd] which provide lazy access to pages
|
|
1353
|
+
# of the response.
|
|
1354
|
+
#
|
|
1355
|
+
def list_vhds_as_lazy(resource_group_name, name, custom_headers = nil)
|
|
1356
|
+
response = list_vhds_async(resource_group_name, name, custom_headers).value!
|
|
1357
|
+
unless response.nil?
|
|
1358
|
+
page = response.body
|
|
1359
|
+
page.next_method = Proc.new do |next_page_link|
|
|
1360
|
+
list_vhds_next_async(next_page_link, custom_headers)
|
|
1361
|
+
end
|
|
1362
|
+
page
|
|
1363
|
+
end
|
|
1364
|
+
end
|
|
1365
|
+
|
|
1366
1366
|
end
|
|
1367
1367
|
end
|