Class: Azure::Compute::Mgmt::V2020_12_01::VirtualMachineScaleSetVMs

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb

Overview

Compute Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ VirtualMachineScaleSetVMs

Creates and initializes a new instance of the VirtualMachineScaleSetVMs class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientComputeManagementClient (readonly)

Returns reference to the ComputeManagementClient.

Returns:



22
23
24
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 22

def client
  @client
end

Instance Method Details

#begin_deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



1240
1241
1242
1243
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1240

def begin_deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1277

def begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_deallocate_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • 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/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1259

def begin_deallocate_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end

#begin_delete(resource_group_name, vm_scale_set_name, instance_id, force_deletion: nil, custom_headers: nil) ⇒ Object

Deletes a virtual machine from a VM scale set.

machine from a VM scale set. (Feature in Preview) will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • force_deletion (Boolean) (defaults to: nil)

    Optional parameter to force delete a virtual

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

    A hash of custom headers that



1460
1461
1462
1463
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1460

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

#begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, force_deletion: nil, custom_headers: nil) ⇒ Concurrent::Promise

Deletes a virtual machine from a VM scale set.

machine from a VM scale set. (Feature in Preview) to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • force_deletion (Boolean) (defaults to: nil)

    Optional parameter to force delete a virtual

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1495

def begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, force_deletion:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      query_params: {'forceDeletion' => force_deletion,'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 == 200 || 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_delete_with_http_info(resource_group_name, vm_scale_set_name, instance_id, force_deletion: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a virtual machine from a VM scale set.

machine from a VM scale set. (Feature in Preview) will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • force_deletion (Boolean) (defaults to: nil)

    Optional parameter to force delete a virtual

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1478
1479
1480
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1478

def begin_delete_with_http_info(resource_group_name, vm_scale_set_name, instance_id, force_deletion:nil, custom_headers:nil)
  begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, force_deletion:force_deletion, custom_headers:custom_headers).value!
end

#begin_perform_maintenance(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Performs maintenance on a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



1920
1921
1922
1923
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1920

def begin_perform_maintenance(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

Performs maintenance on a virtual machine in a VM scale set.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1951

def begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_perform_maintenance_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Performs maintenance on a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1936
1937
1938
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1936

def begin_perform_maintenance_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end

#begin_power_off(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown: false, custom_headers: nil) ⇒ Object

Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.

shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • skip_shutdown (Boolean) (defaults to: false)

    The parameter to request non-graceful VM

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

    A hash of custom headers that



1557
1558
1559
1560
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1557

def begin_power_off(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
  response = begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
  nil
end

#begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown: false, custom_headers: nil) ⇒ Concurrent::Promise

Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.

shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • skip_shutdown (Boolean) (defaults to: false)

    The parameter to request non-graceful VM

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1600

def begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      query_params: {'skipShutdown' => skip_shutdown,'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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_power_off_with_http_info(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown: false, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.

shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • skip_shutdown (Boolean) (defaults to: false)

    The parameter to request non-graceful VM

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1579
1580
1581
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1579

def begin_power_off_with_http_info(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
  begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
end

#begin_redeploy(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



1831
1832
1833
1834
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1831

def begin_redeploy(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#begin_redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1864

def begin_redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_redeploy_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1848
1849
1850
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1848

def begin_redeploy_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  begin_redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end

#begin_reimage(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input: nil, custom_headers: nil) ⇒ Object

Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.

VirtualMachineScaleSetVMReimageParameters

Parameters for the Reimaging

Virtual machine in ScaleSet. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



1045
1046
1047
1048
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1045

def begin_reimage(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
  response = begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:vm_scale_set_vmreimage_input, custom_headers:custom_headers).value!
  nil
end

#begin_reimage_all(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



1148
1149
1150
1151
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1148

def begin_reimage_all(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1181

def begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_reimage_all_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1165
1166
1167
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1165

def begin_reimage_all_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end

#begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input: nil, custom_headers: nil) ⇒ Concurrent::Promise

Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.

VirtualMachineScaleSetVMReimageParameters

Parameters for the Reimaging

Virtual machine in ScaleSet. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1084
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
1127
1128
1129
1130
1131
1132
1133
1134
1135
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1084

def begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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::Compute::Mgmt::V2020_12_01::Models::VirtualMachineScaleSetVMReimageParameters.mapper()
  request_content = @client.serialize(request_mapper,  vm_scale_set_vmreimage_input)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.

VirtualMachineScaleSetVMReimageParameters

Parameters for the Reimaging

Virtual machine in ScaleSet. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1065
1066
1067
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1065

def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
  begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:vm_scale_set_vmreimage_input, custom_headers:custom_headers).value!
end

#begin_restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Restarts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



1656
1657
1658
1659
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1656

def begin_restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

Restarts a virtual machine in a VM scale set.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1687

def begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_restart_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restarts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1672
1673
1674
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1672

def begin_restart_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end

#begin_run_command(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ RunCommandResult

Run command on a virtual machine in a VM scale set.

operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (RunCommandInput)

    Parameters supplied to the Run command

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

    A hash of custom headers that

Returns:

  • (RunCommandResult)

    operation results.



2010
2011
2012
2013
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 2010

def begin_run_command(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  response = begin_run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Run command on a virtual machine in a VM scale set.

operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (RunCommandInput)

    Parameters supplied to the Run command

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 2045

def begin_run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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::Compute::Mgmt::V2020_12_01::Models::RunCommandInput.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Compute::Mgmt::V2020_12_01::Models::RunCommandResult.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_run_command_with_http_info(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Run command on a virtual machine in a VM scale set.

operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (RunCommandInput)

    Parameters supplied to the Run command

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2028
2029
2030
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 2028

def begin_run_command_with_http_info(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  begin_run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
end

#begin_start(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Starts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



1743
1744
1745
1746
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1743

def begin_start(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

Starts a virtual machine in a VM scale set.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1774

def begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#begin_start_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Starts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1759
1760
1761
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1759

def begin_start_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end

#begin_update(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ VirtualMachineScaleSetVM

Updates a virtual machine of a VM scale set.

extension should be create or updated. Update Virtual Machine Scale Sets VM operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set where the

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (VirtualMachineScaleSetVM)

    Parameters supplied to the

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetVM)

    operation results.



1337
1338
1339
1340
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1337

def begin_update(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  response = begin_update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ Concurrent::Promise

Updates a virtual machine of a VM scale set.

extension should be create or updated. Update Virtual Machine Scale Sets VM operation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set where the

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (VirtualMachineScaleSetVM)

    Parameters supplied to the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1374

def begin_update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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::Compute::Mgmt::V2020_12_01::Models::VirtualMachineScaleSetVM.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Compute::Mgmt::V2020_12_01::Models::VirtualMachineScaleSetVM.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 == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::V2020_12_01::Models::VirtualMachineScaleSetVM.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_update_with_http_info(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updates a virtual machine of a VM scale set.

extension should be create or updated. Update Virtual Machine Scale Sets VM operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set where the

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (VirtualMachineScaleSetVM)

    Parameters supplied to the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1356
1357
1358
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1356

def begin_update_with_http_info(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  begin_update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
end

#deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the compute resources it uses. You are not billed for the compute resources of this virtual machine once it is deallocated.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



124
125
126
127
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 124

def deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 139

def deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  # Send request
  promise = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, 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

#delete(resource_group_name, vm_scale_set_name, instance_id, force_deletion: nil, custom_headers: nil) ⇒ Object

Deletes a virtual machine from a VM scale set.

machine from a VM scale set. (Feature in Preview) will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • force_deletion (Boolean) (defaults to: nil)

    Optional parameter to force delete a virtual

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

    A hash of custom headers that



216
217
218
219
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 216

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

#delete_async(resource_group_name, vm_scale_set_name, instance_id, force_deletion: nil, custom_headers: nil) ⇒ Concurrent::Promise

machine from a VM scale set. (Feature in Preview) will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • force_deletion (Boolean) (defaults to: nil)

    Optional parameter to force delete a virtual

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 233

def delete_async(resource_group_name, vm_scale_set_name, instance_id, force_deletion:nil, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, force_deletion:force_deletion, custom_headers:custom_headers)

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

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

  promise
end

#get(resource_group_name, vm_scale_set_name, instance_id, expand: nil, custom_headers: nil) ⇒ VirtualMachineScaleSetVM

Gets a virtual machine from a VM scale set.

operation. Possible values include: 'instanceView' will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • expand (InstanceViewTypes) (defaults to: nil)

    The expand expression to apply on the

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetVM)

    operation results.



262
263
264
265
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 262

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

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

Gets a virtual machine from a VM scale set.

operation. Possible values include: 'instanceView' to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • expand (InstanceViewTypes) (defaults to: nil)

    The expand expression to apply on the

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 297

def get_async(resource_group_name, vm_scale_set_name, instance_id, expand:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Compute::Mgmt::V2020_12_01::Models::VirtualMachineScaleSetVM.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_instance_view(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ VirtualMachineScaleSetVMInstanceView

Gets the status of a virtual machine from a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetVMInstanceView)

    operation results.



364
365
366
367
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 364

def get_instance_view(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

Gets the status of a virtual machine from a VM scale set.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 395

def get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      query_params: {'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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Compute::Mgmt::V2020_12_01::Models::VirtualMachineScaleSetVMInstanceView.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_instance_view_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the status of a virtual machine from a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



380
381
382
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 380

def get_instance_view_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end

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

Gets a virtual machine from a VM scale set.

operation. Possible values include: 'instanceView' will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • expand (InstanceViewTypes) (defaults to: nil)

    The expand expression to apply on the

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



280
281
282
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 280

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

#list(resource_group_name, virtual_machine_scale_set_name, filter: nil, select: nil, expand: nil, custom_headers: nil) ⇒ Array<VirtualMachineScaleSetVM>

Gets a list of all virtual machines in a VM scale sets.

are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. 'instanceView', 'instanceView/statuses'. Allowed values are 'instanceView'. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_machine_scale_set_name (String)

    The name of the VM scale set.

  • filter (String) (defaults to: nil)

    The filter to apply to the operation. Allowed values

  • select (String) (defaults to: nil)

    The list parameters. Allowed values are

  • expand (String) (defaults to: nil)

    The expand expression to apply to the operation.

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

    A hash of custom headers that

Returns:

  • (Array<VirtualMachineScaleSetVM>)

    operation results.



469
470
471
472
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 469

def list(resource_group_name, virtual_machine_scale_set_name, filter:nil, select:nil, expand:nil, custom_headers:nil)
  first_page = list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter:filter, select:select, expand:expand, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter: nil, select: nil, expand: nil, custom_headers: nil) ⇒ VirtualMachineScaleSetVMListResult

Gets a list of all virtual machines in a VM scale sets.

are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. 'instanceView', 'instanceView/statuses'. Allowed values are 'instanceView'. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_machine_scale_set_name (String)

    The name of the VM scale set.

  • filter (String) (defaults to: nil)

    The filter to apply to the operation. Allowed values

  • select (String) (defaults to: nil)

    The list parameters. Allowed values are

  • expand (String) (defaults to: nil)

    The expand expression to apply to the operation.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetVMListResult)

    which provide lazy access to



2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 2218

def list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter:nil, select:nil, expand:nil, custom_headers:nil)
  response = list_async(resource_group_name, virtual_machine_scale_set_name, filter:filter, select:select, expand:expand, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_async(resource_group_name, virtual_machine_scale_set_name, filter: nil, select: nil, expand: nil, custom_headers: nil) ⇒ Concurrent::Promise

Gets a list of all virtual machines in a VM scale sets.

are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. 'instanceView', 'instanceView/statuses'. Allowed values are 'instanceView'. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_machine_scale_set_name (String)

    The name of the VM scale set.

  • filter (String) (defaults to: nil)

    The filter to apply to the operation. Allowed values

  • select (String) (defaults to: nil)

    The list parameters. Allowed values are

  • expand (String) (defaults to: nil)

    The expand expression to apply to the operation.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 514

def list_async(resource_group_name, virtual_machine_scale_set_name, filter:nil, select:nil, expand:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_machine_scale_set_name is nil' if virtual_machine_scale_set_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'virtualMachineScaleSetName' => virtual_machine_scale_set_name,'subscriptionId' => @client.subscription_id},
      query_params: {'$filter' => filter,'$select' => select,'$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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Compute::Mgmt::V2020_12_01::Models::VirtualMachineScaleSetVMListResult.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_next(next_page_link, custom_headers: nil) ⇒ VirtualMachineScaleSetVMListResult

Gets a list of all virtual machines in a VM scale sets.

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:

  • (VirtualMachineScaleSetVMListResult)

    operation results.



2119
2120
2121
2122
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 2119

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

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

Gets a list of all virtual machines in a VM scale sets.

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.



2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 2148

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


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

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

  request_url = @base_url || @client.base_url

  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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Compute::Mgmt::V2020_12_01::Models::VirtualMachineScaleSetVMListResult.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_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a list of all virtual machines in a VM scale sets.

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.



2134
2135
2136
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 2134

def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_with_http_info(resource_group_name, virtual_machine_scale_set_name, filter: nil, select: nil, expand: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a list of all virtual machines in a VM scale sets.

are 'startswith(instanceView/statuses/code, 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. 'instanceView', 'instanceView/statuses'. Allowed values are 'instanceView'. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_machine_scale_set_name (String)

    The name of the VM scale set.

  • filter (String) (defaults to: nil)

    The filter to apply to the operation. Allowed values

  • select (String) (defaults to: nil)

    The list parameters. Allowed values are

  • expand (String) (defaults to: nil)

    The expand expression to apply to the operation.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



492
493
494
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 492

def list_with_http_info(resource_group_name, virtual_machine_scale_set_name, filter:nil, select:nil, expand:nil, custom_headers:nil)
  list_async(resource_group_name, virtual_machine_scale_set_name, filter:filter, select:select, expand:expand, custom_headers:custom_headers).value!
end

#perform_maintenance(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Performs maintenance on a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



862
863
864
865
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 862

def perform_maintenance(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 877

def perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  # Send request
  promise = begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, instance_id, 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

#power_off(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown: false, custom_headers: nil) ⇒ Object

Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.

shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • skip_shutdown (Boolean) (defaults to: false)

    The parameter to request non-graceful VM

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

    A hash of custom headers that



584
585
586
587
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 584

def power_off(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
  response = power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:skip_shutdown, custom_headers:custom_headers).value!
  nil
end

#power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown: false, custom_headers: nil) ⇒ Concurrent::Promise

shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • skip_shutdown (Boolean) (defaults to: false)

    The parameter to request non-graceful VM

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 603

def power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:false, custom_headers:nil)
  # Send request
  promise = begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, skip_shutdown:skip_shutdown, 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

#redeploy(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back on.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



709
710
711
712
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 709

def redeploy(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 724

def redeploy_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  # Send request
  promise = begin_redeploy_async(resource_group_name, vm_scale_set_name, instance_id, 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

#reimage(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input: nil, custom_headers: nil) ⇒ Object

Reimages (upgrade the operating system) a specific virtual machine in a VM scale set.

VirtualMachineScaleSetVMReimageParameters

Parameters for the Reimaging

Virtual machine in ScaleSet. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



37
38
39
40
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 37

def reimage(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
  response = reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:vm_scale_set_vmreimage_input, custom_headers:custom_headers).value!
  nil
end

#reimage_all(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This operation is only supported for managed disks.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



81
82
83
84
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 81

def reimage_all(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 96

def reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  # Send request
  promise = begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, 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

#reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input: nil, custom_headers: nil) ⇒ Concurrent::Promise

VirtualMachineScaleSetVMReimageParameters

Parameters for the Reimaging

Virtual machine in ScaleSet. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 55

def reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:nil, custom_headers:nil)
  # Send request
  promise = begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, vm_scale_set_vmreimage_input:vm_scale_set_vmreimage_input, 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

#restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Restarts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



628
629
630
631
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 628

def restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 643

def restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  # Send request
  promise = begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, 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

#retrieve_boot_diagnostics_data(resource_group_name, vm_scale_set_name, instance_id, sas_uri_expiration_time_in_minutes: nil, custom_headers: nil) ⇒ RetrieveBootDiagnosticsDataResult

The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set.

minutes for the SAS URIs with a value between 1 to 1440 minutes.
NOTE: If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • sas_uri_expiration_time_in_minutes (Integer) (defaults to: nil)

    Expiration duration in

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

    A hash of custom headers that

Returns:

  • (RetrieveBootDiagnosticsDataResult)

    operation results.



756
757
758
759
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 756

def retrieve_boot_diagnostics_data(resource_group_name, vm_scale_set_name, instance_id, sas_uri_expiration_time_in_minutes:nil, custom_headers:nil)
  response = retrieve_boot_diagnostics_data_async(resource_group_name, vm_scale_set_name, instance_id, sas_uri_expiration_time_in_minutes:sas_uri_expiration_time_in_minutes, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#retrieve_boot_diagnostics_data_async(resource_group_name, vm_scale_set_name, instance_id, sas_uri_expiration_time_in_minutes: nil, custom_headers: nil) ⇒ Concurrent::Promise

The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set.

minutes for the SAS URIs with a value between 1 to 1440 minutes.
NOTE: If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • sas_uri_expiration_time_in_minutes (Integer) (defaults to: nil)

    Expiration duration in

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
846
847
848
849
850
851
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 797

def retrieve_boot_diagnostics_data_async(resource_group_name, vm_scale_set_name, instance_id, sas_uri_expiration_time_in_minutes:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/retrieveBootDiagnosticsData'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      query_params: {'sasUriExpirationTimeInMinutes' => sas_uri_expiration_time_in_minutes,'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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::Compute::Mgmt::V2020_12_01::Models::RetrieveBootDiagnosticsDataResult.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

#retrieve_boot_diagnostics_data_with_http_info(resource_group_name, vm_scale_set_name, instance_id, sas_uri_expiration_time_in_minutes: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The operation to retrieve SAS URIs of boot diagnostic logs for a virtual machine in a VM scale set.

minutes for the SAS URIs with a value between 1 to 1440 minutes.
NOTE: If not specified, SAS URIs will be generated with a default expiration duration of 120 minutes. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • sas_uri_expiration_time_in_minutes (Integer) (defaults to: nil)

    Expiration duration in

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



777
778
779
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 777

def retrieve_boot_diagnostics_data_with_http_info(resource_group_name, vm_scale_set_name, instance_id, sas_uri_expiration_time_in_minutes:nil, custom_headers:nil)
  retrieve_boot_diagnostics_data_async(resource_group_name, vm_scale_set_name, instance_id, sas_uri_expiration_time_in_minutes:sas_uri_expiration_time_in_minutes, custom_headers:custom_headers).value!
end

#run_command(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ RunCommandResult

Run command on a virtual machine in a VM scale set.

operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (RunCommandInput)

    Parameters supplied to the Run command

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

    A hash of custom headers that

Returns:

  • (RunCommandResult)

    operation results.



996
997
998
999
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 996

def run_command(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  response = run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ Concurrent::Promise

operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (RunCommandInput)

    Parameters supplied to the Run command

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1013

def run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  # Send request
  promise = begin_run_command_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers)

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

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

  promise
end

#simulate_eviction(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

The operation to simulate the eviction of spot virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



904
905
906
907
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 904

def simulate_eviction(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = simulate_eviction_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#simulate_eviction_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

The operation to simulate the eviction of spot virtual machine in a VM scale set.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 937

def simulate_eviction_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/simulateEviction'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      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 == 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.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#simulate_eviction_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

The operation to simulate the eviction of spot virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



921
922
923
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 921

def simulate_eviction_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  simulate_eviction_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end

#start(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Object

Starts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



668
669
670
671
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 668

def start(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  nil
end

#start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 683

def start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  # Send request
  promise = begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers)

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

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

  promise
end

#update(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ VirtualMachineScaleSetVM

Updates a virtual machine of a VM scale set.

extension should be create or updated. Update Virtual Machine Scale Sets VM operation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set where the

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (VirtualMachineScaleSetVM)

    Parameters supplied to the

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetVM)

    operation results.



169
170
171
172
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 169

def update(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  response = update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers: nil) ⇒ Concurrent::Promise

extension should be create or updated. Update Virtual Machine Scale Sets VM operation. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set where the

  • instance_id (String)

    The instance ID of the virtual machine.

  • parameters (VirtualMachineScaleSetVM)

    Parameters supplied to 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



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/2020-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 187

def update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:nil)
  # Send request
  promise = begin_update_async(resource_group_name, vm_scale_set_name, instance_id, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Compute::Mgmt::V2020_12_01::Models::VirtualMachineScaleSetVM.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