Class: Azure::DevTestLabs::Mgmt::V2016_05_15::Labs

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb

Overview

The DevTest Labs Client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Labs

Creates and initializes a new instance of the Labs class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientDevTestLabsClient (readonly)

Returns reference to the DevTestLabsClient.

Returns:



22
23
24
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 22

def client
  @client
end

Instance Method Details

#begin_claim_any_vm(resource_group_name, name, custom_headers: nil) ⇒ Object

Claim a random claimable virtual machine in the lab. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1054
1055
1056
1057
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1054

def begin_claim_any_vm(resource_group_name, name, custom_headers:nil)
  response = begin_claim_any_vm_async(resource_group_name, name, custom_headers:custom_headers).value!
  nil
end

#begin_claim_any_vm_async(resource_group_name, name, custom_headers: nil) ⇒ Concurrent::Promise

Claim a random claimable virtual machine in the lab. This operation can take a while to complete.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1085

def begin_claim_any_vm_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/claimAnyVm'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_claim_any_vm_with_http_info(resource_group_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Claim a random claimable virtual machine in the lab. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1070
1071
1072
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1070

def begin_claim_any_vm_with_http_info(resource_group_name, name, custom_headers:nil)
  begin_claim_any_vm_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#begin_create_environment(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers: nil) ⇒ Object

Create virtual machines in a lab. This operation can take a while to complete.

LabVirtualMachineCreationParameter

Properties for creating a virtual

machine. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab_virtual_machine_creation_parameter
  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1141
1142
1143
1144
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1141

def begin_create_environment(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:nil)
  response = begin_create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:custom_headers).value!
  nil
end

#begin_create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers: nil) ⇒ Concurrent::Promise

Create virtual machines in a lab. This operation can take a while to complete.

LabVirtualMachineCreationParameter

Properties for creating a virtual

machine. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab_virtual_machine_creation_parameter
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1178

def begin_create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'lab_virtual_machine_creation_parameter is nil' if lab_virtual_machine_creation_parameter.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabVirtualMachineCreationParameter.mapper()
  request_content = @client.serialize(request_mapper,  lab_virtual_machine_creation_parameter)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/createEnvironment'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_create_environment_with_http_info(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create virtual machines in a lab. This operation can take a while to complete.

LabVirtualMachineCreationParameter

Properties for creating a virtual

machine. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab_virtual_machine_creation_parameter
  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1160
1161
1162
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1160

def begin_create_environment_with_http_info(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:nil)
  begin_create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:custom_headers).value!
end

#begin_create_or_update(resource_group_name, name, lab, custom_headers: nil) ⇒ Lab

Create or replace an existing lab. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab (Lab)

    A lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Lab)

    operation results.



859
860
861
862
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 859

def begin_create_or_update(resource_group_name, name, lab, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, name, lab, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_async(resource_group_name, name, lab, custom_headers: nil) ⇒ Concurrent::Promise

Create or replace an existing lab. This operation can take a while to complete.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab (Lab)

    A lab.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 892

def begin_create_or_update_async(resource_group_name, name, lab, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'lab is nil' if lab.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab.mapper()
  request_content = @client.serialize(request_mapper,  lab)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#begin_create_or_update_with_http_info(resource_group_name, name, lab, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or replace an existing lab. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab (Lab)

    A lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



876
877
878
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 876

def begin_create_or_update_with_http_info(resource_group_name, name, lab, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, name, lab, custom_headers:custom_headers).value!
end

#begin_delete(resource_group_name, name, custom_headers: nil) ⇒ Object

Delete lab. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



972
973
974
975
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 972

def begin_delete(resource_group_name, name, custom_headers:nil)
  response = begin_delete_async(resource_group_name, name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_async(resource_group_name, name, custom_headers: nil) ⇒ Concurrent::Promise

Delete lab. This operation can take a while to complete.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1001

def begin_delete_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 202 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_with_http_info(resource_group_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete lab. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



987
988
989
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 987

def begin_delete_with_http_info(resource_group_name, name, custom_headers:nil)
  begin_delete_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#begin_export_resource_usage(resource_group_name, name, export_resource_usage_parameters, custom_headers: nil) ⇒ Object

Exports the lab resource usage into a storage account This operation can take a while to complete.

parameters of the export operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • export_resource_usage_parameters (ExportResourceUsageParameters)

    The

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



1241
1242
1243
1244
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1241

def begin_export_resource_usage(resource_group_name, name, export_resource_usage_parameters, custom_headers:nil)
  response = begin_export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:custom_headers).value!
  nil
end

#begin_export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers: nil) ⇒ Concurrent::Promise

Exports the lab resource usage into a storage account This operation can take a while to complete.

parameters of the export operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • export_resource_usage_parameters (ExportResourceUsageParameters)

    The

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1276

def begin_export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'export_resource_usage_parameters is nil' if export_resource_usage_parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ExportResourceUsageParameters.mapper()
  request_content = @client.serialize(request_mapper,  export_resource_usage_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/exportResourceUsage'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 202
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_export_resource_usage_with_http_info(resource_group_name, name, export_resource_usage_parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Exports the lab resource usage into a storage account This operation can take a while to complete.

parameters of the export operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • export_resource_usage_parameters (ExportResourceUsageParameters)

    The

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1259
1260
1261
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1259

def begin_export_resource_usage_with_http_info(resource_group_name, name, export_resource_usage_parameters, custom_headers:nil)
  begin_export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:custom_headers).value!
end

#claim_any_vm(resource_group_name, name, custom_headers: nil) ⇒ Object

Claim a random claimable virtual machine in the lab. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



531
532
533
534
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 531

def claim_any_vm(resource_group_name, name, custom_headers:nil)
  response = claim_any_vm_async(resource_group_name, name, custom_headers:custom_headers).value!
  nil
end

#claim_any_vm_async(resource_group_name, name, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 545

def claim_any_vm_async(resource_group_name, name, custom_headers:nil)
  # Send request
  promise = begin_claim_any_vm_async(resource_group_name, name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#create_environment(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers: nil) ⇒ Object

Create virtual machines in a lab. This operation can take a while to complete.

LabVirtualMachineCreationParameter

Properties for creating a virtual

machine. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab_virtual_machine_creation_parameter
  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



573
574
575
576
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 573

def create_environment(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:nil)
  response = create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:custom_headers).value!
  nil
end

#create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers: nil) ⇒ Concurrent::Promise

LabVirtualMachineCreationParameter

Properties for creating a virtual

machine. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab_virtual_machine_creation_parameter
  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 590

def create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:nil)
  # Send request
  promise = begin_create_environment_async(resource_group_name, name, lab_virtual_machine_creation_parameter, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#create_or_update(resource_group_name, name, lab, custom_headers: nil) ⇒ Lab

Create or replace an existing lab. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab (Lab)

    A lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Lab)

    operation results.



348
349
350
351
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 348

def create_or_update(resource_group_name, name, lab, custom_headers:nil)
  response = create_or_update_async(resource_group_name, name, lab, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, name, lab, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab (Lab)

    A lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 363

def create_or_update_async(resource_group_name, name, lab, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, name, lab, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#delete(resource_group_name, name, custom_headers: nil) ⇒ Object

Delete lab. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



389
390
391
392
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 389

def delete(resource_group_name, name, custom_headers:nil)
  response = delete_async(resource_group_name, name, custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, name, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 403

def delete_async(resource_group_name, name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#export_resource_usage(resource_group_name, name, export_resource_usage_parameters, custom_headers: nil) ⇒ Object

Exports the lab resource usage into a storage account This operation can take a while to complete.

parameters of the export operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • export_resource_usage_parameters (ExportResourceUsageParameters)

    The

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



617
618
619
620
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 617

def export_resource_usage(resource_group_name, name, export_resource_usage_parameters, custom_headers:nil)
  response = export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:custom_headers).value!
  nil
end

#export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers: nil) ⇒ Concurrent::Promise

parameters of the export operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • export_resource_usage_parameters (ExportResourceUsageParameters)

    The

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 633

def export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:nil)
  # Send request
  promise = begin_export_resource_usage_async(resource_group_name, name, export_resource_usage_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#generate_upload_uri(resource_group_name, name, generate_upload_uri_parameter, custom_headers: nil) ⇒ GenerateUploadUriResponse

Generate a URI for uploading custom disk images to a Lab.

for generating an upload URI. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • generate_upload_uri_parameter (GenerateUploadUriParameter)

    Properties

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (GenerateUploadUriResponse)

    operation results.



661
662
663
664
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 661

def generate_upload_uri(resource_group_name, name, generate_upload_uri_parameter, custom_headers:nil)
  response = generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers: nil) ⇒ Concurrent::Promise

Generate a URI for uploading custom disk images to a Lab.

for generating an upload URI. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • generate_upload_uri_parameter (GenerateUploadUriParameter)

    Properties

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 694

def generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'generate_upload_uri_parameter is nil' if generate_upload_uri_parameter.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriParameter.mapper()
  request_content = @client.serialize(request_mapper,  generate_upload_uri_parameter)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/generateUploadUri'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::GenerateUploadUriResponse.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#generate_upload_uri_with_http_info(resource_group_name, name, generate_upload_uri_parameter, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Generate a URI for uploading custom disk images to a Lab.

for generating an upload URI. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • generate_upload_uri_parameter (GenerateUploadUriParameter)

    Properties

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



678
679
680
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 678

def generate_upload_uri_with_http_info(resource_group_name, name, generate_upload_uri_parameter, custom_headers:nil)
  generate_upload_uri_async(resource_group_name, name, generate_upload_uri_parameter, custom_headers:custom_headers).value!
end

#get(resource_group_name, name, expand: nil, custom_headers: nil) ⇒ Lab

Get lab.

‘properties($select=defaultStorageAccount)’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Lab)

    operation results.



250
251
252
253
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 250

def get(resource_group_name, name, expand:nil, custom_headers:nil)
  response = get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, name, expand: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get lab.

‘properties($select=defaultStorageAccount)’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 283

def get_async(resource_group_name, name, expand:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
      query_params: {'$expand' => expand,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_with_http_info(resource_group_name, name, expand: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get lab.

‘properties($select=defaultStorageAccount)’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



267
268
269
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 267

def get_with_http_info(resource_group_name, name, expand:nil, custom_headers:nil)
  get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value!
end

#list_by_resource_group(resource_group_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Array<Lab>

List labs in a resource group.

‘properties($select=defaultStorageAccount)’ operation. notation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (String) (defaults to: nil)

    The ordering expression for the results, using OData

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<Lab>)

    operation results.



145
146
147
148
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 145

def list_by_resource_group(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ ResponseWithContinuationLab

List labs in a resource group.

‘properties($select=defaultStorageAccount)’ operation. notation. will be added to the HTTP request.

the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (String) (defaults to: nil)

    The ordering expression for the results, using OData

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ResponseWithContinuationLab)

    which provide lazy access to pages of



1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1635

def list_by_resource_group_as_lazy(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise

List labs in a resource group.

‘properties($select=defaultStorageAccount)’ operation. notation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (String) (defaults to: nil)

    The ordering expression for the results, using OData

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 186

def list_by_resource_group_async(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
      query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLab.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ ResponseWithContinuationLab

List labs in a resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ResponseWithContinuationLab)

    operation results.



1425
1426
1427
1428
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1425

def list_by_resource_group_next(next_page_link, custom_headers:nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

List labs in a resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1454

def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLab.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List labs in a resource group.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1440
1441
1442
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1440

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List labs in a resource group.

‘properties($select=defaultStorageAccount)’ operation. notation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (String) (defaults to: nil)

    The ordering expression for the results, using OData

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



166
167
168
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 166

def list_by_resource_group_with_http_info(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
end

#list_by_subscription(expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Array<Lab>

List labs in a subscription.

‘properties($select=defaultStorageAccount)’ operation. notation. will be added to the HTTP request.

Parameters:

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (String) (defaults to: nil)

    The ordering expression for the results, using OData

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<Lab>)

    operation results.



39
40
41
42
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 39

def list_by_subscription(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  first_page = list_by_subscription_as_lazy(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_subscription_as_lazy(expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ ResponseWithContinuationLab

List labs in a subscription.

‘properties($select=defaultStorageAccount)’ operation. notation. will be added to the HTTP request.

the response.

Parameters:

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (String) (defaults to: nil)

    The ordering expression for the results, using OData

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ResponseWithContinuationLab)

    which provide lazy access to pages of



1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1607

def list_by_subscription_as_lazy(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  response = list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_subscription_async(expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise

List labs in a subscription.

‘properties($select=defaultStorageAccount)’ operation. notation. to the HTTP request.

Parameters:

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (String) (defaults to: nil)

    The ordering expression for the results, using OData

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 78

def list_by_subscription_async(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/labs'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLab.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_next(next_page_link, custom_headers: nil) ⇒ ResponseWithContinuationLab

List labs in a subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ResponseWithContinuationLab)

    operation results.



1337
1338
1339
1340
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1337

def list_by_subscription_next(next_page_link, custom_headers:nil)
  response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_subscription_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

List labs in a subscription.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1366

def list_by_subscription_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLab.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List labs in a subscription.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1352
1353
1354
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1352

def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_subscription_with_http_info(expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List labs in a subscription.

‘properties($select=defaultStorageAccount)’ operation. notation. will be added to the HTTP request.

Parameters:

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (String) (defaults to: nil)

    The ordering expression for the results, using OData

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



59
60
61
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 59

def list_by_subscription_with_http_info(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
end

#list_vhds(resource_group_name, name, custom_headers: nil) ⇒ Array<LabVhd>

List disk images available for custom image creation.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<LabVhd>)

    operation results.



765
766
767
768
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 765

def list_vhds(resource_group_name, name, custom_headers:nil)
  first_page = list_vhds_as_lazy(resource_group_name, name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_vhds_as_lazy(resource_group_name, name, custom_headers: nil) ⇒ ResponseWithContinuationLabVhd

List disk images available for custom image creation.

will be added to the HTTP request.

of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ResponseWithContinuationLabVhd)

    which provide lazy access to pages



1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1657

def list_vhds_as_lazy(resource_group_name, name, custom_headers:nil)
  response = list_vhds_async(resource_group_name, name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_vhds_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_vhds_async(resource_group_name, name, custom_headers: nil) ⇒ Concurrent::Promise

List disk images available for custom image creation.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 794

def list_vhds_async(resource_group_name, name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/listVhds'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVhd.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_vhds_next(next_page_link, custom_headers: nil) ⇒ ResponseWithContinuationLabVhd

List disk images available for custom image creation.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (ResponseWithContinuationLabVhd)

    operation results.



1513
1514
1515
1516
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1513

def list_vhds_next(next_page_link, custom_headers:nil)
  response = list_vhds_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_vhds_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

List disk images available for custom image creation.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1542

def list_vhds_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::ResponseWithContinuationLabVhd.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_vhds_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List disk images available for custom image creation.

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1528
1529
1530
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 1528

def list_vhds_next_with_http_info(next_page_link, custom_headers:nil)
  list_vhds_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_vhds_with_http_info(resource_group_name, name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List disk images available for custom image creation.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



780
781
782
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 780

def list_vhds_with_http_info(resource_group_name, name, custom_headers:nil)
  list_vhds_async(resource_group_name, name, custom_headers:custom_headers).value!
end

#update(resource_group_name, name, lab, custom_headers: nil) ⇒ Lab

Modify properties of labs.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab (LabFragment)

    A lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Lab)

    operation results.



430
431
432
433
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 430

def update(resource_group_name, name, lab, custom_headers:nil)
  response = update_async(resource_group_name, name, lab, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, name, lab, custom_headers: nil) ⇒ Concurrent::Promise

Modify properties of labs.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab (LabFragment)

    A lab.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 461

def update_async(resource_group_name, name, lab, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'lab is nil' if lab.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::LabFragment.mapper()
  request_content = @client.serialize(request_mapper,  lab)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::DevTestLabs::Mgmt::V2016_05_15::Models::Lab.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_with_http_info(resource_group_name, name, lab, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Modify properties of labs.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • name (String)

    The name of the lab.

  • lab (LabFragment)

    A lab.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



446
447
448
# File 'lib/2016-05-15/generated/azure_mgmt_devtestlabs/labs.rb', line 446

def update_with_http_info(resource_group_name, name, lab, custom_headers:nil)
  update_async(resource_group_name, name, lab, custom_headers:custom_headers).value!
end