Class: Azure::Compute::Mgmt::V2017_03_30::VirtualMachineScaleSetVMs

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb

Overview

VirtualMachineScaleSetVMs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ VirtualMachineScaleSetVMs

Creates and initializes a new instance of the VirtualMachineScaleSetVMs class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientComputeManagementClient (readonly)

Returns reference to the ComputeManagementClient.

Returns:



22
23
24
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 22

def client
  @client
end

Instance Method Details

#begin_deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



839
840
841
842
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 839

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

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

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

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 876

def begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::V2017_03_30::Models::OperationStatusResponse.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_deallocate_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



858
859
860
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 858

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

#begin_delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

Deletes a virtual machine from a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



940
941
942
943
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 940

def begin_delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  response = begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
  response.body unless response.nil?
end

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

Deletes a virtual machine from a VM scale set.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 971

def begin_delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      query_params: {'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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::V2017_03_30::Models::OperationStatusResponse.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_delete_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Deletes a virtual machine from a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



956
957
958
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 956

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

#begin_power_off(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



1037
1038
1039
1040
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1037

def begin_power_off(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  response = begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
  response.body unless response.nil?
end

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

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

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1072

def begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::V2017_03_30::Models::OperationStatusResponse.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_power_off_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1055
1056
1057
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1055

def begin_power_off_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
end

#begin_reimage(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



641
642
643
644
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 641

def begin_reimage(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  response = begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
  response.body unless response.nil?
end

#begin_reimage_all(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



739
740
741
742
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 739

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

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

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

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 772

def begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::V2017_03_30::Models::OperationStatusResponse.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_reimage_all_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



756
757
758
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 756

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

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

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

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 674

def begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'vmScaleSetName' => vm_scale_set_name,'instanceId' => instance_id,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      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?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::V2017_03_30::Models::OperationStatusResponse.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_reimage_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



658
659
660
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 658

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

#begin_restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

Restarts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



1136
1137
1138
1139
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1136

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

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

Restarts a virtual machine in a VM scale set.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1167

def begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::V2017_03_30::Models::OperationStatusResponse.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_restart_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Restarts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1152
1153
1154
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1152

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

#begin_start(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

Starts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



1231
1232
1233
1234
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1231

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

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

Starts a virtual machine in a VM scale set.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1262

def begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::V2017_03_30::Models::OperationStatusResponse.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_start_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Starts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1247
1248
1249
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1247

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

#deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



128
129
130
131
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 128

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

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 143

def deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  # Send request
  promise = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)

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

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

  promise
end

#delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

Deletes a virtual machine from a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



172
173
174
175
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 172

def delete(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  response = delete_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
  response.body unless response.nil?
end

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



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

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

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

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

Gets a virtual machine from a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetVM)

    operation results.



216
217
218
219
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 216

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

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

Gets a virtual machine from a VM scale set.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 247

def get_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#get_instance_view(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ VirtualMachineScaleSetVMInstanceView

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetVMInstanceView)

    operation results.



311
312
313
314
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 311

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

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

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

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 342

def get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'vm_scale_set_name is nil' if vm_scale_set_name.nil?
  fail ArgumentError, 'instance_id is nil' if instance_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



327
328
329
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 327

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

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

Gets a virtual machine from a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



232
233
234
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 232

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

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

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_machine_scale_set_name (String)

    The name of the VM scale set.

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • select (String) (defaults to: nil)

    The list parameters.

  • expand (String) (defaults to: nil)

    The expand expression to apply to the operation.

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

    A hash of custom headers that

Returns:

  • (Array<VirtualMachineScaleSetVM>)

    operation results.



408
409
410
411
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 408

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

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

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

will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_machine_scale_set_name (String)

    The name of the VM scale set.

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • select (String) (defaults to: nil)

    The list parameters.

  • expand (String) (defaults to: nil)

    The expand expression to apply to the operation.

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetVMListResult)

    which provide lazy access to



1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1416

def list_as_lazy(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
  response = list_async(resource_group_name, virtual_machine_scale_set_name, filter, select, expand, 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)
    end
    page
  end
end

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

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

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_machine_scale_set_name (String)

    The name of the VM scale set.

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • select (String) (defaults to: nil)

    The list parameters.

  • expand (String) (defaults to: nil)

    The expand expression to apply to the operation.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 443

def list_async(resource_group_name, virtual_machine_scale_set_name, filter = nil, select = nil, expand = nil, custom_headers = nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'virtual_machine_scale_set_name is nil' if virtual_machine_scale_set_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_next(next_page_link, custom_headers = nil) ⇒ VirtualMachineScaleSetVMListResult

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

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (VirtualMachineScaleSetVMListResult)

    operation results.



1325
1326
1327
1328
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1325

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

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

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

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1354

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


  request_headers = {}

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

#list_next_with_http_info(next_page_link, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

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

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

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1340
1341
1342
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1340

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

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

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • virtual_machine_scale_set_name (String)

    The name of the VM scale set.

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • select (String) (defaults to: nil)

    The list parameters.

  • expand (String) (defaults to: nil)

    The expand expression to apply to the operation.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



426
427
428
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 426

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

#power_off(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



508
509
510
511
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 508

def power_off(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  response = power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
  response.body unless response.nil?
end

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 523

def power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  # Send request
  promise = begin_power_off_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)

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

#reimage(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



36
37
38
39
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 36

def reimage(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  response = reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers).value!
  response.body unless response.nil?
end

#reimage_all(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



81
82
83
84
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 81

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

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 96

def reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  # Send request
  promise = begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)

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

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 51

def reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  # Send request
  promise = begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)

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

#restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

Restarts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



552
553
554
555
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 552

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

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 567

def restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil)
  # Send request
  promise = begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers)

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

#start(resource_group_name, vm_scale_set_name, instance_id, custom_headers = nil) ⇒ OperationStatusResponse

Starts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (OperationStatusResponse)

    operation results.



596
597
598
599
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 596

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

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

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 611

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

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