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 VirtualNetworkOperations
|
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 [ResponseWithContinuationVirtualNetwork] which provide lazy access
|
39
|
-
# 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 networks 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 network. 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 network.
|
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 network.
|
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 networks.
|
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 [VirtualNetwork] operation results.
|
312
324
|
#
|
313
|
-
def
|
314
|
-
response =
|
325
|
+
def patch_resource(resource_group_name, lab_name, name, virtual_network, custom_headers = nil)
|
326
|
+
response = patch_resource_async(resource_group_name, lab_name, name, virtual_network, 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 networks.
|
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, virtual_network, custom_headers = nil)
|
343
|
+
patch_resource_async(resource_group_name, lab_name, name, virtual_network, custom_headers).value!
|
333
344
|
end
|
334
345
|
|
335
346
|
#
|
336
|
-
#
|
337
|
-
# while to complete.
|
347
|
+
# Modify properties of virtual networks.
|
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, virtual_network, 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 = VirtualNetwork.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,91 +419,59 @@ module Azure::ARM::DevTestLabs
|
|
419
419
|
end
|
420
420
|
|
421
421
|
#
|
422
|
-
#
|
423
|
-
#
|
424
|
-
# @param resource_group_name [String] The name of the resource group.
|
425
|
-
# @param lab_name [String] The name of the lab.
|
426
|
-
# @param name [String] The name of the virtual network.
|
427
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
428
|
-
# will be added to the HTTP request.
|
429
|
-
#
|
430
|
-
def delete_resource(resource_group_name, lab_name, name, custom_headers = nil)
|
431
|
-
response = delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
|
432
|
-
nil
|
433
|
-
end
|
434
|
-
|
435
|
-
#
|
436
|
-
# @param resource_group_name [String] The name of the resource group.
|
437
|
-
# @param lab_name [String] The name of the lab.
|
438
|
-
# @param name [String] The name of the virtual network.
|
439
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
440
|
-
# will be added to the HTTP request.
|
441
|
-
#
|
442
|
-
# @return [Concurrent::Promise] promise which provides async access to http
|
443
|
-
# response.
|
444
|
-
#
|
445
|
-
def delete_resource_async(resource_group_name, lab_name, name, custom_headers = nil)
|
446
|
-
# Send request
|
447
|
-
promise = begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers)
|
448
|
-
|
449
|
-
promise = promise.then do |response|
|
450
|
-
# Defining deserialization method.
|
451
|
-
deserialize_method = lambda do |parsed_response|
|
452
|
-
end
|
453
|
-
|
454
|
-
# Waiting for response.
|
455
|
-
@client.get_long_running_operation_result(response, deserialize_method)
|
456
|
-
end
|
457
|
-
|
458
|
-
promise
|
459
|
-
end
|
460
|
-
|
461
|
-
#
|
462
|
-
# Delete virtual network. This operation can take a while to complete.
|
422
|
+
# Create or replace an existing virtual network. This operation can take a
|
423
|
+
# while to complete.
|
463
424
|
#
|
464
425
|
# @param resource_group_name [String] The name of the resource group.
|
465
426
|
# @param lab_name [String] The name of the lab.
|
466
427
|
# @param name [String] The name of the virtual network.
|
428
|
+
# @param virtual_network [VirtualNetwork]
|
467
429
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
468
430
|
# will be added to the HTTP request.
|
469
431
|
#
|
432
|
+
# @return [VirtualNetwork] operation results.
|
470
433
|
#
|
471
|
-
def
|
472
|
-
response =
|
473
|
-
nil
|
434
|
+
def begin_create_or_update_resource(resource_group_name, lab_name, name, virtual_network, custom_headers = nil)
|
435
|
+
response = begin_create_or_update_resource_async(resource_group_name, lab_name, name, virtual_network, custom_headers).value!
|
436
|
+
response.body unless response.nil?
|
474
437
|
end
|
475
438
|
|
476
439
|
#
|
477
|
-
#
|
440
|
+
# Create or replace an existing virtual network. This operation can take a
|
441
|
+
# while to complete.
|
478
442
|
#
|
479
443
|
# @param resource_group_name [String] The name of the resource group.
|
480
444
|
# @param lab_name [String] The name of the lab.
|
481
445
|
# @param name [String] The name of the virtual network.
|
446
|
+
# @param virtual_network [VirtualNetwork]
|
482
447
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
483
448
|
# will be added to the HTTP request.
|
484
449
|
#
|
485
450
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
486
451
|
#
|
487
|
-
def
|
488
|
-
|
452
|
+
def begin_create_or_update_resource_with_http_info(resource_group_name, lab_name, name, virtual_network, custom_headers = nil)
|
453
|
+
begin_create_or_update_resource_async(resource_group_name, lab_name, name, virtual_network, custom_headers).value!
|
489
454
|
end
|
490
455
|
|
491
456
|
#
|
492
|
-
#
|
457
|
+
# Create or replace an existing virtual network. This operation can take a
|
458
|
+
# while to complete.
|
493
459
|
#
|
494
460
|
# @param resource_group_name [String] The name of the resource group.
|
495
461
|
# @param lab_name [String] The name of the lab.
|
496
462
|
# @param name [String] The name of the virtual network.
|
463
|
+
# @param virtual_network [VirtualNetwork]
|
497
464
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
498
465
|
# to the HTTP request.
|
499
466
|
#
|
500
467
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
501
468
|
#
|
502
|
-
def
|
469
|
+
def begin_create_or_update_resource_async(resource_group_name, lab_name, name, virtual_network, custom_headers = nil)
|
503
470
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
504
471
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
505
472
|
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
506
473
|
fail ArgumentError, 'name is nil' if name.nil?
|
474
|
+
fail ArgumentError, 'virtual_network is nil' if virtual_network.nil?
|
507
475
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
508
476
|
|
509
477
|
|
@@ -512,6 +480,14 @@ module Azure::ARM::DevTestLabs
|
|
512
480
|
# Set Headers
|
513
481
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
514
482
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
483
|
+
|
484
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
485
|
+
|
486
|
+
# Serialize Request
|
487
|
+
request_mapper = VirtualNetwork.mapper()
|
488
|
+
request_content = @client.serialize(request_mapper, virtual_network, 'virtual_network')
|
489
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
490
|
+
|
515
491
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}'
|
516
492
|
|
517
493
|
request_url = @base_url || @client.base_url
|
@@ -520,21 +496,42 @@ module Azure::ARM::DevTestLabs
|
|
520
496
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
521
497
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
|
522
498
|
query_params: {'api-version' => @client.api_version},
|
499
|
+
body: request_content,
|
523
500
|
headers: request_headers.merge(custom_headers || {}),
|
524
501
|
base_url: request_url
|
525
502
|
}
|
526
|
-
promise = @client.make_request_async(:
|
503
|
+
promise = @client.make_request_async(:put, path_template, options)
|
527
504
|
|
528
505
|
promise = promise.then do |result|
|
529
506
|
http_response = result.response
|
530
507
|
status_code = http_response.status
|
531
508
|
response_content = http_response.body
|
532
|
-
unless status_code ==
|
509
|
+
unless status_code == 200 || status_code == 201
|
533
510
|
error_model = JSON.load(response_content)
|
534
511
|
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
535
512
|
end
|
536
513
|
|
537
514
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
515
|
+
# Deserialize Response
|
516
|
+
if status_code == 200
|
517
|
+
begin
|
518
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
519
|
+
result_mapper = VirtualNetwork.mapper()
|
520
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
521
|
+
rescue Exception => e
|
522
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
523
|
+
end
|
524
|
+
end
|
525
|
+
# Deserialize Response
|
526
|
+
if status_code == 201
|
527
|
+
begin
|
528
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
529
|
+
result_mapper = VirtualNetwork.mapper()
|
530
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
531
|
+
rescue Exception => e
|
532
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
533
|
+
end
|
534
|
+
end
|
538
535
|
|
539
536
|
result
|
540
537
|
end
|
@@ -543,56 +540,51 @@ module Azure::ARM::DevTestLabs
|
|
543
540
|
end
|
544
541
|
|
545
542
|
#
|
546
|
-
#
|
543
|
+
# Delete virtual network. This operation can take a while to complete.
|
547
544
|
#
|
548
545
|
# @param resource_group_name [String] The name of the resource group.
|
549
546
|
# @param lab_name [String] The name of the lab.
|
550
547
|
# @param name [String] The name of the virtual network.
|
551
|
-
# @param virtual_network [VirtualNetwork]
|
552
548
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
553
549
|
# will be added to the HTTP request.
|
554
550
|
#
|
555
|
-
# @return [VirtualNetwork] operation results.
|
556
551
|
#
|
557
|
-
def
|
558
|
-
response =
|
559
|
-
|
552
|
+
def begin_delete_resource(resource_group_name, lab_name, name, custom_headers = nil)
|
553
|
+
response = begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
|
554
|
+
nil
|
560
555
|
end
|
561
556
|
|
562
557
|
#
|
563
|
-
#
|
558
|
+
# Delete virtual network. This operation can take a while to complete.
|
564
559
|
#
|
565
560
|
# @param resource_group_name [String] The name of the resource group.
|
566
561
|
# @param lab_name [String] The name of the lab.
|
567
562
|
# @param name [String] The name of the virtual network.
|
568
|
-
# @param virtual_network [VirtualNetwork]
|
569
563
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
570
564
|
# will be added to the HTTP request.
|
571
565
|
#
|
572
566
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
573
567
|
#
|
574
|
-
def
|
575
|
-
|
568
|
+
def begin_delete_resource_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
|
569
|
+
begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
|
576
570
|
end
|
577
571
|
|
578
572
|
#
|
579
|
-
#
|
573
|
+
# Delete virtual network. This operation can take a while to complete.
|
580
574
|
#
|
581
575
|
# @param resource_group_name [String] The name of the resource group.
|
582
576
|
# @param lab_name [String] The name of the lab.
|
583
577
|
# @param name [String] The name of the virtual network.
|
584
|
-
# @param virtual_network [VirtualNetwork]
|
585
578
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
586
579
|
# to the HTTP request.
|
587
580
|
#
|
588
581
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
589
582
|
#
|
590
|
-
def
|
583
|
+
def begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers = nil)
|
591
584
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
592
585
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
593
586
|
fail ArgumentError, 'lab_name is nil' if lab_name.nil?
|
594
587
|
fail ArgumentError, 'name is nil' if name.nil?
|
595
|
-
fail ArgumentError, 'virtual_network is nil' if virtual_network.nil?
|
596
588
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
597
589
|
|
598
590
|
|
@@ -601,14 +593,6 @@ module Azure::ARM::DevTestLabs
|
|
601
593
|
# Set Headers
|
602
594
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
603
595
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
604
|
-
|
605
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
606
|
-
|
607
|
-
# Serialize Request
|
608
|
-
request_mapper = VirtualNetwork.mapper()
|
609
|
-
request_content = @client.serialize(request_mapper, virtual_network, 'virtual_network')
|
610
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
611
|
-
|
612
596
|
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{name}'
|
613
597
|
|
614
598
|
request_url = @base_url || @client.base_url
|
@@ -617,32 +601,21 @@ module Azure::ARM::DevTestLabs
|
|
617
601
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
618
602
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
|
619
603
|
query_params: {'api-version' => @client.api_version},
|
620
|
-
body: request_content,
|
621
604
|
headers: request_headers.merge(custom_headers || {}),
|
622
605
|
base_url: request_url
|
623
606
|
}
|
624
|
-
promise = @client.make_request_async(:
|
607
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
625
608
|
|
626
609
|
promise = promise.then do |result|
|
627
610
|
http_response = result.response
|
628
611
|
status_code = http_response.status
|
629
612
|
response_content = http_response.body
|
630
|
-
unless status_code ==
|
613
|
+
unless status_code == 202 || status_code == 204
|
631
614
|
error_model = JSON.load(response_content)
|
632
615
|
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
633
616
|
end
|
634
617
|
|
635
618
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
636
|
-
# Deserialize Response
|
637
|
-
if status_code == 200
|
638
|
-
begin
|
639
|
-
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
640
|
-
result_mapper = VirtualNetwork.mapper()
|
641
|
-
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
642
|
-
rescue Exception => e
|
643
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
644
|
-
end
|
645
|
-
end
|
646
619
|
|
647
620
|
result
|
648
621
|
end
|
@@ -653,8 +626,8 @@ module Azure::ARM::DevTestLabs
|
|
653
626
|
#
|
654
627
|
# List virtual networks in a given lab.
|
655
628
|
#
|
656
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
657
|
-
#
|
629
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
630
|
+
# to List operation.
|
658
631
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
659
632
|
# will be added to the HTTP request.
|
660
633
|
#
|
@@ -668,8 +641,8 @@ module Azure::ARM::DevTestLabs
|
|
668
641
|
#
|
669
642
|
# List virtual networks in a given lab.
|
670
643
|
#
|
671
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
672
|
-
#
|
644
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
645
|
+
# to List operation.
|
673
646
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
674
647
|
# will be added to the HTTP request.
|
675
648
|
#
|
@@ -682,8 +655,8 @@ module Azure::ARM::DevTestLabs
|
|
682
655
|
#
|
683
656
|
# List virtual networks in a given lab.
|
684
657
|
#
|
685
|
-
# @param next_page_link [String] The NextLink from the previous successful
|
686
|
-
#
|
658
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
659
|
+
# to List operation.
|
687
660
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
688
661
|
# to the HTTP request.
|
689
662
|
#
|
@@ -737,5 +710,32 @@ module Azure::ARM::DevTestLabs
|
|
737
710
|
promise.execute
|
738
711
|
end
|
739
712
|
|
713
|
+
#
|
714
|
+
# List virtual networks in a given lab.
|
715
|
+
#
|
716
|
+
# @param resource_group_name [String] The name of the resource group.
|
717
|
+
# @param lab_name [String] The name of the lab.
|
718
|
+
# @param filter [String] The filter to apply on the operation.
|
719
|
+
# @param top [Integer] The maximum number of resources to return from the
|
720
|
+
# operation.
|
721
|
+
# @param order_by [String] The ordering expression for the results, using OData
|
722
|
+
# notation.
|
723
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
724
|
+
# will be added to the HTTP request.
|
725
|
+
#
|
726
|
+
# @return [ResponseWithContinuationVirtualNetwork] which provide lazy access to
|
727
|
+
# pages of the response.
|
728
|
+
#
|
729
|
+
def list_as_lazy(resource_group_name, lab_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
|
730
|
+
response = list_async(resource_group_name, lab_name, filter, top, order_by, custom_headers).value!
|
731
|
+
unless response.nil?
|
732
|
+
page = response.body
|
733
|
+
page.next_method = Proc.new do |next_page_link|
|
734
|
+
list_next_async(next_page_link, custom_headers)
|
735
|
+
end
|
736
|
+
page
|
737
|
+
end
|
738
|
+
end
|
739
|
+
|
740
740
|
end
|
741
741
|
end
|