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

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



854
855
856
857
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 854

def begin_deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  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.



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
932
933
934
935
936
937
938
939
940
941
942
943
944
945
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 891

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # 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.



873
874
875
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 873

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

#begin_delete(resource_group_name, vm_scale_set_name, instance_id, 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.



958
959
960
961
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 958

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



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
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 989

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # 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.



974
975
976
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 974

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



1058
1059
1060
1061
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1058

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



1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1093

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # 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.



1076
1077
1078
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1076

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



650
651
652
653
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 650

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



751
752
753
754
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 751

def begin_reimage_all(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_reimage_all_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  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.



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
828
829
830
831
832
833
834
835
836
837
838
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 784

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # 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.



768
769
770
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 768

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

#begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, 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.



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
727
728
729
730
731
732
733
734
735
736
737
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 683

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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/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?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::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.



667
668
669
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 667

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



1160
1161
1162
1163
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1160

def begin_restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  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.



1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1191

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # 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.



1176
1177
1178
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1176

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

#begin_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.



1258
1259
1260
1261
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1258

def begin_start(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = begin_start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  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.



1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1289

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # 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.



1274
1275
1276
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1274

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

#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: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: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, FinalStateVia::AZURE_ASYNC_OPERATION)
  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: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: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: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
299
300
301
# 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 = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::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.



314
315
316
317
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 314

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

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

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

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
395
396
397
398
399
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 345

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::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.



330
331
332
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 330

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

#get_with_http_info(resource_group_name, vm_scale_set_name, instance_id, 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: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.



414
415
416
417
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 414

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

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

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

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



1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1449

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

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

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

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.



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
495
496
497
498
499
500
501
502
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 449

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::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.



1355
1356
1357
1358
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1355

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

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

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

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1384

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


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Compute::Mgmt::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.



1370
1371
1372
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1370

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

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

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

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.



432
433
434
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 432

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

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



517
518
519
520
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 517

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



532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 532

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: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, FinalStateVia::AZURE_ASYNC_OPERATION)
  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: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: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: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, FinalStateVia::AZURE_ASYNC_OPERATION)
  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: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, FinalStateVia::AZURE_ASYNC_OPERATION)
  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.



561
562
563
564
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 561

def restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  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



576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 576

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      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, FinalStateVia::AZURE_ASYNC_OPERATION)
  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.



605
606
607
608
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 605

def start(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
  response = start_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
  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



620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
# File 'lib/2017-03-30/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 620

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

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      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, FinalStateVia::AZURE_ASYNC_OPERATION)
  end

  promise
end