Class: Azure::Compute::Mgmt::V2016_04_30_preview::VirtualMachineScaleSetVMs

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb

Overview

Compute Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ VirtualMachineScaleSetVMs

Creates and initializes a new instance of the VirtualMachineScaleSetVMs class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2016-04-30-preview/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/2016-04-30-preview/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.



843
844
845
846
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 843

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.



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
928
929
930
931
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 880

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::V2016_04_30_preview::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.



862
863
864
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 862

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.



944
945
946
947
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 944

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.



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
1023
1024
1025
1026
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 975

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::V2016_04_30_preview::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.



960
961
962
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 960

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.



1041
1042
1043
1044
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1041

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.



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
1124
1125
1126
1127
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1076

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::V2016_04_30_preview::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.



1059
1060
1061
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1059

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.



642
643
644
645
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 642

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 virtual machine 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.



741
742
743
744
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 741

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 virtual machine 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.



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
824
825
826
827
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 776

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::V2016_04_30_preview::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 virtual machine 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.



759
760
761
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 759

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.



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
726
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 675

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::V2016_04_30_preview::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.



659
660
661
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 659

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.



1140
1141
1142
1143
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1140

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.



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
1219
1220
1221
1222
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1171

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::V2016_04_30_preview::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.



1156
1157
1158
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1156

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.



1235
1236
1237
1238
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1235

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.



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
1314
1315
1316
1317
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1266

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::V2016_04_30_preview::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.



1251
1252
1253
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1251

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.



129
130
131
132
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 129

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



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

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::V2016_04_30_preview::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.



173
174
175
176
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 173

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



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

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::V2016_04_30_preview::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.



217
218
219
220
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 217

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.



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
299
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 248

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::V2016_04_30_preview::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.



312
313
314
315
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 312

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.



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
394
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 343

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::V2016_04_30_preview::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.



328
329
330
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 328

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.



233
234
235
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 233

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.



409
410
411
412
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 409

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



1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1420

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.



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
494
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 444

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::V2016_04_30_preview::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.



1329
1330
1331
1332
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1329

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.



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
1401
1402
1403
1404
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1358

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::V2016_04_30_preview::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.



1344
1345
1346
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1344

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.



427
428
429
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 427

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.



509
510
511
512
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 509

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



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

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::V2016_04_30_preview::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/2016-04-30-preview/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 virtual machine 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.



82
83
84
85
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 82

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



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

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::V2016_04_30_preview::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/2016-04-30-preview/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::V2016_04_30_preview::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.



553
554
555
556
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 553

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



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

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::V2016_04_30_preview::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.



597
598
599
600
# File 'lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 597

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



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

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::V2016_04_30_preview::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