Class: Azure::Compute::Mgmt::V2019_12_01::VirtualMachineScaleSets

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

Overview

Compute Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ VirtualMachineScaleSets

Creates and initializes a new instance of the VirtualMachineScaleSets class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.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/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 22

def client
  @client
end

Instance Method Details

#begin_create_or_update(resource_group_name, vm_scale_set_name, parameters, custom_headers: nil) ⇒ VirtualMachineScaleSet

Create or update a VM scale set.

update. 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 to create or

  • parameters (VirtualMachineScaleSet)

    The scale set object.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSet)

    operation results.



1421
1422
1423
1424
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1421

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

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

Create or update a VM scale set.

update. 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 to create or

  • parameters (VirtualMachineScaleSet)

    The scale set object.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1454

def begin_create_or_update_async(resource_group_name, vm_scale_set_name, 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, '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::V2019_12_01::Models::VirtualMachineScaleSet.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}'

  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,'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 == 201
      error_model = JSON.load(response_content)
      fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end

#begin_create_or_update_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or update a VM scale set.

update. 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 to create or

  • parameters (VirtualMachineScaleSet)

    The scale set object.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1438
1439
1440
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1438

def begin_create_or_update_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
end

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

Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



1731
1732
1733
1734
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1731

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

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

Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1768
1769
1770
1771
1772
1773
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/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1768

def begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids: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, '@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::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
  request_content = @client.serialize(request_mapper,  vm_instance_ids)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/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,'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_deallocate_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1750
1751
1752
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1750

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

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

Deletes 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.

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

    A hash of custom headers that



1644
1645
1646
1647
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1644

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

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

Deletes 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.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
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
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1673

def begin_delete_async(resource_group_name, vm_scale_set_name, 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, '@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}'

  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,'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(: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_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ Object

Deletes virtual machines in a VM scale set.

of virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

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

    A hash of custom headers that



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

def begin_delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
  response = begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
  nil
end

#begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ Concurrent::Promise

Deletes virtual machines in a VM scale set.

of virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

  • 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
1909
1910
1911
1912
1913
1914
1915
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1864

def begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, 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, 'vm_instance_ids is nil' if vm_instance_ids.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::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceRequiredIDs.mapper()
  request_content = @client.serialize(request_mapper,  vm_instance_ids)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  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,'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_delete_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes virtual machines in a VM scale set.

of virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

  • 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/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1848

def begin_delete_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
  begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
end

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

Deletes 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.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1659
1660
1661
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1659

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

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

Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



2336
2337
2338
2339
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2336

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

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

Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2375

def begin_perform_maintenance_async(resource_group_name, vm_scale_set_name, vm_instance_ids: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, '@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::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
  request_content = @client.serialize(request_mapper,  vm_instance_ids)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/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,'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_perform_maintenance_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2356
2357
2358
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2356

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

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

Power off (stop) one or more virtual machines 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.

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • 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



1934
1935
1936
1937
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1934

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

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

Power off (stop) one or more virtual machines 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.

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • 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.



1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1979

def begin_power_off_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, 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, '@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::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
  request_content = @client.serialize(request_mapper,  vm_instance_ids)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/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,'subscriptionId' => @client.subscription_id},
      query_params: {'skipShutdown' => skip_shutdown,'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_power_off_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids: nil, skip_shutdown: false, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Power off (stop) one or more virtual machines 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.

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • 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.



1957
1958
1959
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1957

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

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

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

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



2235
2236
2237
2238
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2235

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

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

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

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2270

def begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids: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, '@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::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
  request_content = @client.serialize(request_mapper,  vm_instance_ids)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/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,'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_redeploy_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

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

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2253
2254
2255
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2253

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

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

Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state.

Parameters for Reimaging VM 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.

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

    A hash of custom headers that



2540
2541
2542
2543
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2540

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

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

Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



2641
2642
2643
2644
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2641

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

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

Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2676

def begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids: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, '@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::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
  request_content = @client.serialize(request_mapper,  vm_instance_ids)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/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,'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_all_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2659
2660
2661
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2659

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

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

Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state.

Parameters for Reimaging VM 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.

  • vm_scale_set_reimage_input (VirtualMachineScaleSetReimageParameters) (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.



2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2577

def begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_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, '@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::V2019_12_01::Models::VirtualMachineScaleSetReimageParameters.mapper()
  request_content = @client.serialize(request_mapper,  vm_scale_set_reimage_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}/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,'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, vm_scale_set_reimage_input: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state.

Parameters for Reimaging VM 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.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2559
2560
2561
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2559

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

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

Restarts one or more virtual machines in a VM scale set.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



2042
2043
2044
2045
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2042

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

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

Restarts one or more virtual machines in a VM scale set.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2075

def begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids: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, '@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::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
  request_content = @client.serialize(request_mapper,  vm_instance_ids)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/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,'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_restart_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Restarts one or more virtual machines in a VM scale set.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2059
2060
2061
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2059

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

#begin_set_orchestration_service_state(resource_group_name, vm_scale_set_name, parameters, custom_headers: nil) ⇒ Object

Changes ServiceState property for a given service

to create or update. SetOrchestrationServiceState API. 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 virtual machine scale set

  • parameters (OrchestrationServiceStateInput)

    The input object for

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

    A hash of custom headers that



2740
2741
2742
2743
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2740

def begin_set_orchestration_service_state(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
  response = begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

Changes ServiceState property for a given service

to create or update. SetOrchestrationServiceState API. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the virtual machine scale set

  • parameters (OrchestrationServiceStateInput)

    The input object for

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2775

def begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, 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, '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::V2019_12_01::Models::OrchestrationServiceStateInput.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}/setOrchestrationServiceState'

  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,'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_set_orchestration_service_state_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Changes ServiceState property for a given service

to create or update. SetOrchestrationServiceState API. 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 virtual machine scale set

  • parameters (OrchestrationServiceStateInput)

    The input object for

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2758
2759
2760
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2758

def begin_set_orchestration_service_state_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
  begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
end

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

Starts one or more virtual machines in a VM scale set.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



2138
2139
2140
2141
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2138

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

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

Starts one or more virtual machines in a VM scale set.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2171

def begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids: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, '@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::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceIDs.mapper()
  request_content = @client.serialize(request_mapper,  vm_instance_ids)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/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,'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_start_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Starts one or more virtual machines in a VM scale set.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2155
2156
2157
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2155

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

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

Update a VM scale set.

update. 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 to create or

  • parameters (VirtualMachineScaleSetUpdate)

    The scale set object.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSet)

    operation results.



1539
1540
1541
1542
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1539

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

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

Update a VM scale set.

update. 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 to create or

  • parameters (VirtualMachineScaleSetUpdate)

    The scale set object.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
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
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1572

def begin_update_async(resource_group_name, vm_scale_set_name, 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, '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::V2019_12_01::Models::VirtualMachineScaleSetUpdate.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}'

  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,'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(:patch, path_template, options)

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    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::V2019_12_01::Models::VirtualMachineScaleSet.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_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ Object

Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.

of virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

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

    A hash of custom headers that



2439
2440
2441
2442
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2439

def begin_update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
  response = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
  nil
end

#begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ Concurrent::Promise

Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.

of virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2474

def begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, 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, 'vm_instance_ids is nil' if vm_instance_ids.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::V2019_12_01::Models::VirtualMachineScaleSetVMInstanceRequiredIDs.mapper()
  request_content = @client.serialize(request_mapper,  vm_instance_ids)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

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

  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,'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_update_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.

of virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2457
2458
2459
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2457

def begin_update_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
  begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
end

#begin_update_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update a VM scale set.

update. 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 to create or

  • parameters (VirtualMachineScaleSetUpdate)

    The scale set object.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1556
1557
1558
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1556

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

#convert_to_single_placement_group(resource_group_name, vm_scale_set_name, parameters, custom_headers: nil) ⇒ Object

Converts SinglePlacementGroup property to true for a existing virtual machine scale set.

to create or update. object for ConvertToSinglePlacementGroup API. 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 virtual machine scale set

  • parameters (VMScaleSetConvertToSinglePlacementGroupInput)

    The input

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

    A hash of custom headers that



1275
1276
1277
1278
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1275

def convert_to_single_placement_group(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
  response = convert_to_single_placement_group_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

Converts SinglePlacementGroup property to true for a existing virtual machine scale set.

to create or update. object for ConvertToSinglePlacementGroup API. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the virtual machine scale set

  • parameters (VMScaleSetConvertToSinglePlacementGroupInput)

    The input

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1312

def convert_to_single_placement_group_async(resource_group_name, vm_scale_set_name, 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, '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::V2019_12_01::Models::VMScaleSetConvertToSinglePlacementGroupInput.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}/convertToSinglePlacementGroup'

  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,'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
      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

#convert_to_single_placement_group_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Converts SinglePlacementGroup property to true for a existing virtual machine scale set.

to create or update. object for ConvertToSinglePlacementGroup API. 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 virtual machine scale set

  • parameters (VMScaleSetConvertToSinglePlacementGroupInput)

    The input

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1294
1295
1296
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1294

def convert_to_single_placement_group_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
  convert_to_single_placement_group_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, vm_scale_set_name, parameters, custom_headers: nil) ⇒ VirtualMachineScaleSet

Create or update a VM scale set.

update. 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 to create or

  • parameters (VirtualMachineScaleSet)

    The scale set object.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSet)

    operation results.



36
37
38
39
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 36

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

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

update. 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 to create or

  • parameters (VirtualMachineScaleSet)

    The scale set object.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 52

def create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers)

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

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

Deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



260
261
262
263
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 260

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

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

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 276

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

Deletes 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.

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

    A hash of custom headers that



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

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

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



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

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

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

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

  promise
end

#delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ Object

Deletes virtual machines in a VM scale set.

of virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

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

    A hash of custom headers that



302
303
304
305
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 302

def delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
  response = delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
  nil
end

#delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ Concurrent::Promise

of virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 318

def delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
  # Send request
  promise = begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, 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

#force_recovery_service_fabric_platform_update_domain_walk(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers: nil) ⇒ RecoveryWalkResponse

Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set.

a manual recovery walk is requested 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.

  • platform_update_domain (Integer)

    The platform update domain for which

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

    A hash of custom headers that

Returns:

  • (RecoveryWalkResponse)

    operation results.



1171
1172
1173
1174
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1171

def force_recovery_service_fabric_platform_update_domain_walk(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:nil)
  response = force_recovery_service_fabric_platform_update_domain_walk_async(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#force_recovery_service_fabric_platform_update_domain_walk_async(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers: nil) ⇒ Concurrent::Promise

Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set.

a manual recovery walk is requested 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.

  • platform_update_domain (Integer)

    The platform update domain for which

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1206

def force_recovery_service_fabric_platform_update_domain_walk_async(resource_group_name, vm_scale_set_name, platform_update_domain, 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, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'platform_update_domain is nil' if platform_update_domain.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}/forceRecoveryServiceFabricPlatformUpdateDomainWalk'

  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,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version,'platformUpdateDomain' => platform_update_domain},
      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::V2019_12_01::Models::RecoveryWalkResponse.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

#force_recovery_service_fabric_platform_update_domain_walk_with_http_info(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Manual platform update domain walk to update virtual machines in a service fabric virtual machine scale set.

a manual recovery walk is requested 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.

  • platform_update_domain (Integer)

    The platform update domain for which

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1189
1190
1191
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1189

def force_recovery_service_fabric_platform_update_domain_walk_with_http_info(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:nil)
  force_recovery_service_fabric_platform_update_domain_walk_async(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:custom_headers).value!
end

#get(resource_group_name, vm_scale_set_name, custom_headers: nil) ⇒ VirtualMachineScaleSet

Display information about a virtual machine 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.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSet)

    operation results.



164
165
166
167
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 164

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

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

Display information about a virtual machine 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.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 193

def get_async(resource_group_name, vm_scale_set_name, 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, '@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}'

  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,'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::V2019_12_01::Models::VirtualMachineScaleSet.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, custom_headers: nil) ⇒ VirtualMachineScaleSetInstanceView

Gets the status of a VM scale set instance.

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.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetInstanceView)

    operation results.



344
345
346
347
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 344

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

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

Gets the status of a VM scale set instance.

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.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
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
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 373

def get_instance_view_async(resource_group_name, vm_scale_set_name, 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, '@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}/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,'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::V2019_12_01::Models::VirtualMachineScaleSetInstanceView.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, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the status of a VM scale set instance.

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.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



359
360
361
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 359

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

#get_osupgrade_history(resource_group_name, vm_scale_set_name, custom_headers: nil) ⇒ Array<UpgradeOperationHistoricalStatusInfo>

Gets list of OS upgrades on a VM scale set instance.

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.

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

    A hash of custom headers that

Returns:

  • (Array<UpgradeOperationHistoricalStatusInfo>)

    operation results.



720
721
722
723
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 720

def get_osupgrade_history(resource_group_name, vm_scale_set_name, custom_headers:nil)
  first_page = get_osupgrade_history_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#get_osupgrade_history_as_lazy(resource_group_name, vm_scale_set_name, custom_headers: nil) ⇒ VirtualMachineScaleSetListOSUpgradeHistory

Gets list of OS upgrades on a VM scale set instance.

will be added to the HTTP request.

access to pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetListOSUpgradeHistory)

    which provide lazy



3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3278

def get_osupgrade_history_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:nil)
  response = get_osupgrade_history_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Gets list of OS upgrades on a VM scale set instance.

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.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 749

def get_osupgrade_history_async(resource_group_name, vm_scale_set_name, 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, '@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}/osUpgradeHistory'

  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,'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::V2019_12_01::Models::VirtualMachineScaleSetListOSUpgradeHistory.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_osupgrade_history_next(next_page_link, custom_headers: nil) ⇒ VirtualMachineScaleSetListOSUpgradeHistory

Gets list of OS upgrades on a VM scale set instance.

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:

  • (VirtualMachineScaleSetListOSUpgradeHistory)

    operation results.



3120
3121
3122
3123
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3120

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

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

Gets list of OS upgrades on a VM scale set instance.

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.



3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3149

def get_osupgrade_history_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::V2019_12_01::Models::VirtualMachineScaleSetListOSUpgradeHistory.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_osupgrade_history_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets list of OS upgrades on a VM scale set instance.

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.



3135
3136
3137
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3135

def get_osupgrade_history_next_with_http_info(next_page_link, custom_headers:nil)
  get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Gets list of OS upgrades on a VM scale set instance.

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.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



735
736
737
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 735

def get_osupgrade_history_with_http_info(resource_group_name, vm_scale_set_name, custom_headers:nil)
  get_osupgrade_history_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
end

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

Display information about a virtual machine 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.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



179
180
181
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 179

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

#list(resource_group_name, custom_headers: nil) ⇒ Array<VirtualMachineScaleSet>

Gets a list of all VM scale sets under a resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (Array<VirtualMachineScaleSet>)

    operation results.



437
438
439
440
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 437

def list(resource_group_name, custom_headers:nil)
  first_page = list_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_all(custom_headers: nil) ⇒ Array<VirtualMachineScaleSet>

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (Array<VirtualMachineScaleSet>)

    operation results.



529
530
531
532
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 529

def list_all(custom_headers:nil)
  first_page = list_all_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end

#list_all_as_lazy(custom_headers: nil) ⇒ VirtualMachineScaleSetListWithLinkResult

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets.

will be added to the HTTP request.

to pages of the response.

Parameters:

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetListWithLinkResult)

    which provide lazy access



3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3233

def list_all_as_lazy(custom_headers:nil)
  response = list_all_async(custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_all_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_all_async(custom_headers: nil) ⇒ Concurrent::Promise

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets.

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 560

def list_all_async(custom_headers: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}/providers/Microsoft.Compute/virtualMachineScaleSets'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'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::V2019_12_01::Models::VirtualMachineScaleSetListWithLinkResult.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_all_next(next_page_link, custom_headers: nil) ⇒ VirtualMachineScaleSetListWithLinkResult

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the 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:

  • (VirtualMachineScaleSetListWithLinkResult)

    operation results.



2931
2932
2933
2934
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2931

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

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

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the 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.



2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2966

def list_all_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::V2019_12_01::Models::VirtualMachineScaleSetListWithLinkResult.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_all_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the 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.



2949
2950
2951
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2949

def list_all_next_with_http_info(next_page_link, custom_headers:nil)
  list_all_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_all_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all the VM Scale Sets.

will be added to the HTTP request.

Parameters:

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



545
546
547
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 545

def list_all_with_http_info(custom_headers:nil)
  list_all_async(custom_headers:custom_headers).value!
end

#list_as_lazy(resource_group_name, custom_headers: nil) ⇒ VirtualMachineScaleSetListResult

Gets a list of all VM scale sets under a resource group.

will be added to the HTTP request.

of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetListResult)

    which provide lazy access to pages



3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3210

def list_as_lazy(resource_group_name, custom_headers:nil)
  response = list_async(resource_group_name, 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, custom_headers: nil) ⇒ Concurrent::Promise

Gets a list of all VM scale sets under a resource group.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 464

def list_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  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'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'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::V2019_12_01::Models::VirtualMachineScaleSetListResult.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) ⇒ VirtualMachineScaleSetListResult

Gets a list of all VM scale sets under a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetListResult)

    operation results.



2838
2839
2840
2841
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2838

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 VM scale sets under a resource group.

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2867

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::V2019_12_01::Models::VirtualMachineScaleSetListResult.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 VM scale sets under a resource group.

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



2853
2854
2855
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 2853

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_skus(resource_group_name, vm_scale_set_name, custom_headers: nil) ⇒ Array<VirtualMachineScaleSetSku>

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.

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.

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

    A hash of custom headers that

Returns:

  • (Array<VirtualMachineScaleSetSku>)

    operation results.



624
625
626
627
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 624

def list_skus(resource_group_name, vm_scale_set_name, custom_headers:nil)
  first_page = list_skus_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_skus_as_lazy(resource_group_name, vm_scale_set_name, custom_headers: nil) ⇒ VirtualMachineScaleSetListSkusResult

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.

will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetListSkusResult)

    which provide lazy access to



3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3256

def list_skus_as_lazy(resource_group_name, vm_scale_set_name, custom_headers:nil)
  response = list_skus_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_skus_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

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

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.

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.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 655

def list_skus_async(resource_group_name, vm_scale_set_name, 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, '@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}/skus'

  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,'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::V2019_12_01::Models::VirtualMachineScaleSetListSkusResult.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_skus_next(next_page_link, custom_headers: nil) ⇒ VirtualMachineScaleSetListSkusResult

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.

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:

  • (VirtualMachineScaleSetListSkusResult)

    operation results.



3028
3029
3030
3031
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3028

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

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

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.

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.



3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3059

def list_skus_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::V2019_12_01::Models::VirtualMachineScaleSetListSkusResult.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_skus_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.

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.



3044
3045
3046
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 3044

def list_skus_next_with_http_info(next_page_link, custom_headers:nil)
  list_skus_next_async(next_page_link, custom_headers:custom_headers).value!
end

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

Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed for each SKU.

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.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



640
641
642
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 640

def list_skus_with_http_info(resource_group_name, vm_scale_set_name, custom_headers:nil)
  list_skus_async(resource_group_name, vm_scale_set_name, custom_headers:custom_headers).value!
end

#list_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets a list of all VM scale sets under a resource group.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



451
452
453
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 451

def list_with_http_info(resource_group_name, custom_headers:nil)
  list_async(resource_group_name, custom_headers:custom_headers).value!
end

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

Perform maintenance on one or more virtual machines in a VM scale set. Operation on instances which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



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

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

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

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1012

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

Power off (stop) one or more virtual machines 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.

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • 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



820
821
822
823
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 820

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

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

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

  • 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



840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 840

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

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

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



951
952
953
954
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 951

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

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

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 967

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

Reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state.

Parameters for Reimaging VM 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.

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

    A hash of custom headers that



1083
1084
1085
1086
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1083

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

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

Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



1126
1127
1128
1129
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1126

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

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

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1142

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

Parameters for Reimaging VM 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.

  • vm_scale_set_reimage_input (VirtualMachineScaleSetReimageParameters) (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



1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1099

def reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
  # Send request
  promise = begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:vm_scale_set_reimage_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, vm_instance_ids: nil, custom_headers: nil) ⇒ Object

Restarts one or more virtual machines in a VM scale set.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



866
867
868
869
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 866

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

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

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 882

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

#set_orchestration_service_state(resource_group_name, vm_scale_set_name, parameters, custom_headers: nil) ⇒ Object

Changes ServiceState property for a given service

to create or update. SetOrchestrationServiceState API. 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 virtual machine scale set

  • parameters (OrchestrationServiceStateInput)

    The input object for

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

    A hash of custom headers that



1376
1377
1378
1379
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1376

def set_orchestration_service_state(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
  response = set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
  nil
end

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

to create or update. SetOrchestrationServiceState API. 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 virtual machine scale set

  • parameters (OrchestrationServiceStateInput)

    The input object for

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1393

def set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_set_orchestration_service_state_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers)

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

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

  promise
end

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

Starts one or more virtual machines in a VM scale set.

virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that



908
909
910
911
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 908

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

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

virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceIDs) (defaults to: nil)

    A list of

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 924

def start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
  # Send request
  promise = begin_start_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, 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, parameters, custom_headers: nil) ⇒ VirtualMachineScaleSet

Update a VM scale set.

update. 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 to create or

  • parameters (VirtualMachineScaleSetUpdate)

    The scale set object.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSet)

    operation results.



82
83
84
85
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 82

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

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

update. 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 to create or

  • parameters (VirtualMachineScaleSetUpdate)

    The scale set object.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 98

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

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

#update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ Object

Upgrades one or more virtual machines to the latest SKU set in the VM scale set model.

of virtual machine instance IDs from the 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

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

    A hash of custom headers that



1039
1040
1041
1042
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1039

def update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
  response = update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
  nil
end

#update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers: nil) ⇒ Concurrent::Promise

of virtual machine instance IDs from the VM scale set. 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.

  • vm_instance_ids (VirtualMachineScaleSetVMInstanceRequiredIDs)

    A list

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
# File 'lib/2019-12-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb', line 1055

def update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
  # Send request
  promise = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, 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