Class: Azure::ARM::Compute::VirtualMachineScaleSetVMs

Inherits:
Object
  • Object
show all
Includes:
Models, MsRestAzure
Defined in:
lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb

Overview

Composite Swagger for 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.



18
19
20
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 18

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientComputeManagementClient (readonly)

Returns reference to the ComputeManagementClient.

Returns:



23
24
25
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 23

def client
  @client
end

Instance Method Details

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

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



661
662
663
664
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 661

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



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
738
739
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 698

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?
  api_version = '2016-03-30'
  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' => 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 == 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
  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.



680
681
682
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 680

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) ⇒ Object

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



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

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



782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 782

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?
  api_version = '2016-03-30'
  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' => 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
  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.



767
768
769
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 767

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) ⇒ Object

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

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



837
838
839
840
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 837

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



872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 872

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?
  api_version = '2016-03-30'
  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' => 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 == 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
  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.



855
856
857
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 855

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) ⇒ Object

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



572
573
574
575
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 572

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!
  nil
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.



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 605

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?
  api_version = '2016-03-30'
  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' => 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 == 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
  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.



589
590
591
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 589

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) ⇒ Object

Restarts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



925
926
927
928
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 925

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



956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 956

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?
  api_version = '2016-03-30'
  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' => 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 == 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
  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.



941
942
943
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 941

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) ⇒ Object

Starts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



1009
1010
1011
1012
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1009

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



1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1040

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?
  api_version = '2016-03-30'
  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' => 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 == 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
  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.



1025
1026
1027
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1025

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) ⇒ Object

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

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



78
79
80
81
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 78

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



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 93

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|
    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) ⇒ Object

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



118
119
120
121
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 118

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



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 133

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



160
161
162
163
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 160

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.



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

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?
  api_version = '2016-03-30'
  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' => 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 = VirtualMachineScaleSetVM.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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:



255
256
257
258
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 255

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.



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 286

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?
  api_version = '2016-03-30'
  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' => 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 = VirtualMachineScaleSetVMInstanceView.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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.



271
272
273
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 271

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.



176
177
178
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 176

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:



352
353
354
355
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 352

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:



1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1184

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.



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 387

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?
  api_version = '2016-03-30'
  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' => 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 = VirtualMachineScaleSetVMListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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:



1093
1094
1095
1096
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1093

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.



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
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1122

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 = VirtualMachineScaleSetVMListResult.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
      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.



1108
1109
1110
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 1108

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.



370
371
372
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 370

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) ⇒ Object

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

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



450
451
452
453
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 450

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



465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 465

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|
    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) ⇒ Object

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



35
36
37
38
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 35

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!
  nil
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



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 50

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

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

  promise
end

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

Restarts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



490
491
492
493
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 490

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



505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 505

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|
    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) ⇒ Object

Starts a virtual machine in a VM scale set.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • vm_scale_set_name (String)

    The name of the VM scale set.

  • instance_id (String)

    The instance ID of the virtual machine.

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

    A hash of custom headers that



530
531
532
533
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 530

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



545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb', line 545

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

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

  promise
end