Class: Azure::ARM::DevTestLabs::VirtualMachine

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

Overview

Azure DevTest Labs REST API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ VirtualMachine

Creates and initializes a new instance of the VirtualMachine class.

Parameters:

  • client

    service class for accessing basic functionality.



18
19
20
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 18

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientDevTestLabsClient (readonly)

Returns reference to the DevTestLabsClient.

Returns:



23
24
25
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 23

def client
  @client
end

Instance Method Details

#apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil) ⇒ Object

Apply artifacts to Lab VM. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that



431
432
433
434
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 431

def apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil)
  response = apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers).value!
  nil
end

#apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 447

def apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil)
  # Send request
  promise = begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, 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

#begin_apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil) ⇒ Object

Apply artifacts to Lab VM. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that



759
760
761
762
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 759

def begin_apply_artifacts(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil)
  response = begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers).value!
  nil
end

#begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil) ⇒ Concurrent::Promise

Apply artifacts to Lab VM. This operation can take a while to complete.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

  • apply_artifacts_request (ApplyArtifactsRequest)
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
839
840
841
842
843
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 792

def begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'apply_artifacts_request is nil' if apply_artifacts_request.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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?

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

  # Serialize Request
  request_mapper = ApplyArtifactsRequest.mapper()
  request_content = @client.serialize(request_mapper,  apply_artifacts_request, 'apply_artifacts_request')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/applyArtifacts'

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?

    result
  end

  promise.execute
end

#begin_apply_artifacts_with_http_info(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Apply artifacts to Lab VM. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



776
777
778
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 776

def begin_apply_artifacts_with_http_info(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers = nil)
  begin_apply_artifacts_async(resource_group_name, lab_name, name, apply_artifacts_request, custom_headers).value!
end

#begin_create_or_update_resource(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil) ⇒ LabVirtualMachine

Create or replace an existing Virtual Machine. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:



556
557
558
559
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 556

def begin_create_or_update_resource(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
  response = begin_create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers).value!
  response.body unless response.nil?
end

#begin_create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil) ⇒ Concurrent::Promise

Create or replace an existing Virtual Machine. This operation can take a while to complete.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

  • lab_virtual_machine (LabVirtualMachine)
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



591
592
593
594
595
596
597
598
599
600
601
602
603
604
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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 591

def begin_create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'lab_virtual_machine is nil' if lab_virtual_machine.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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?

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

  # Serialize Request
  request_mapper = LabVirtualMachine.mapper()
  request_content = @client.serialize(request_mapper,  lab_virtual_machine, 'lab_virtual_machine')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

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

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

#begin_create_or_update_resource_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Create or replace an existing Virtual Machine. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



574
575
576
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 574

def begin_create_or_update_resource_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
  begin_create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers).value!
end

#begin_delete_resource(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Object

Delete virtual machine. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that



674
675
676
677
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 674

def begin_delete_resource(resource_group_name, lab_name, name, custom_headers = nil)
  response = begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
  nil
end

#begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Concurrent::Promise

Delete virtual machine. This operation can take a while to complete.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name 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.



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
740
741
742
743
744
745
746
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 705

def begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DevTestLab/labs/{labName}/virtualmachines/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
      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 == 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_resource_with_http_info(resource_group_name, lab_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Delete virtual machine. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



690
691
692
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 690

def begin_delete_resource_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
  begin_delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
end

#begin_start(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Object

Start a Lab VM. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that



855
856
857
858
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 855

def begin_start(resource_group_name, lab_name, name, custom_headers = nil)
  response = begin_start_async(resource_group_name, lab_name, name, custom_headers).value!
  nil
end

#begin_start_async(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Concurrent::Promise

Start a Lab VM. This operation can take a while to complete.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name 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.



886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 886

def begin_start_async(resource_group_name, lab_name, name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DevTestLab/labs/{labName}/virtualmachines/{name}/start'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
      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
  end

  promise.execute
end

#begin_start_with_http_info(resource_group_name, lab_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Start a Lab VM. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



871
872
873
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 871

def begin_start_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
  begin_start_async(resource_group_name, lab_name, name, custom_headers).value!
end

#begin_stop(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Object

Stop a Lab VM. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that



939
940
941
942
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 939

def begin_stop(resource_group_name, lab_name, name, custom_headers = nil)
  response = begin_stop_async(resource_group_name, lab_name, name, custom_headers).value!
  nil
end

#begin_stop_async(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Concurrent::Promise

Stop a Lab VM. This operation can take a while to complete.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name 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.



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
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 970

def begin_stop_async(resource_group_name, lab_name, name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DevTestLab/labs/{labName}/virtualmachines/{name}/stop'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
      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
  end

  promise.execute
end

#begin_stop_with_http_info(resource_group_name, lab_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Stop a Lab VM. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



955
956
957
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 955

def begin_stop_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
  begin_stop_async(resource_group_name, lab_name, name, custom_headers).value!
end

#create_or_update_resource(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil) ⇒ LabVirtualMachine

Create or replace an existing Virtual Machine. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:



239
240
241
242
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 239

def create_or_update_resource(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
  response = create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 255

def create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
  # Send request
  promise = begin_create_or_update_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = LabVirtualMachine.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
    end

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

  promise
end

#delete_resource(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Object

Delete virtual machine. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that



282
283
284
285
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 282

def delete_resource(resource_group_name, lab_name, name, custom_headers = nil)
  response = delete_resource_async(resource_group_name, lab_name, name, custom_headers).value!
  nil
end

#delete_resource_async(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name 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



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 297

def delete_resource_async(resource_group_name, lab_name, name, custom_headers = nil)
  # Send request
  promise = begin_delete_resource_async(resource_group_name, lab_name, name, 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(resource_group_name, lab_name, name, custom_headers = nil) ⇒ LabVirtualMachine

Get virtual machine.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:



142
143
144
145
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 142

def get_resource(resource_group_name, lab_name, name, custom_headers = nil)
  response = get_resource_async(resource_group_name, lab_name, name, custom_headers).value!
  response.body unless response.nil?
end

#get_resource_async(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Concurrent::Promise

Get virtual machine.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name 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.



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
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
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 173

def get_resource_async(resource_group_name, lab_name, name, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DevTestLab/labs/{labName}/virtualmachines/{name}'

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = LabVirtualMachine.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_resource_with_http_info(resource_group_name, lab_name, name, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Get virtual machine.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



158
159
160
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 158

def get_resource_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
  get_resource_async(resource_group_name, lab_name, name, custom_headers).value!
end

#list(resource_group_name, lab_name, filter = nil, top = nil, order_by = nil, custom_headers = nil) ⇒ Array<LabVirtualMachine>

List virtual machines in a given lab.

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • order_by (String) (defaults to: nil)

    The ordering expression for the results, using OData

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

    A hash of custom headers that

Returns:



40
41
42
43
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 40

def list(resource_group_name, lab_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
  first_page = list_as_lazy(resource_group_name, lab_name, filter, top, order_by, custom_headers)
  first_page.get_all_items
end

#list_as_lazy(resource_group_name, lab_name, filter = nil, top = nil, order_by = nil, custom_headers = nil) ⇒ ResponseWithContinuationLabVirtualMachine

List virtual machines in a given lab.

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

to pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • order_by (String) (defaults to: nil)

    The ordering expression for the results, using OData

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

    A hash of custom headers that

Returns:



1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 1116

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

List virtual machines in a given lab.

operation. notation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • order_by (String) (defaults to: nil)

    The ordering expression for the results, using OData

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 79

def list_async(resource_group_name, lab_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.DevTestLab/labs/{labName}/virtualmachines'

  request_url = @base_url || @client.base_url

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

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

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

List virtual machines in a given lab.

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:



1023
1024
1025
1026
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 1023

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

List virtual machines in a given lab.

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.



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
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 1052

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 = ResponseWithContinuationLabVirtualMachine.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

List virtual machines in a given lab.

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.



1038
1039
1040
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 1038

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, lab_name, filter = nil, top = nil, order_by = nil, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

List virtual machines in a given lab.

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

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • filter (String) (defaults to: nil)

    The filter to apply on the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • order_by (String) (defaults to: nil)

    The ordering expression for the results, using OData

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



60
61
62
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 60

def list_with_http_info(resource_group_name, lab_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
  list_async(resource_group_name, lab_name, filter, top, order_by, custom_headers).value!
end

#patch_resource(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil) ⇒ LabVirtualMachine

Modify properties of virtual machines.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:



325
326
327
328
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 325

def patch_resource(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
  response = patch_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers).value!
  response.body unless response.nil?
end

#patch_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil) ⇒ Concurrent::Promise

Modify properties of virtual machines.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

  • lab_virtual_machine (LabVirtualMachine)
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 358

def patch_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'lab_virtual_machine is nil' if lab_virtual_machine.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.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?

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

  # Serialize Request
  request_mapper = LabVirtualMachine.mapper()
  request_content = @client.serialize(request_mapper,  lab_virtual_machine, 'lab_virtual_machine')
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

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

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

#patch_resource_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil) ⇒ MsRestAzure::AzureOperationResponse

Modify properties of virtual machines.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



342
343
344
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 342

def patch_resource_with_http_info(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers = nil)
  patch_resource_async(resource_group_name, lab_name, name, lab_virtual_machine, custom_headers).value!
end

#start(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Object

Start a Lab VM. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that



472
473
474
475
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 472

def start(resource_group_name, lab_name, name, custom_headers = nil)
  response = start_async(resource_group_name, lab_name, name, custom_headers).value!
  nil
end

#start_async(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name 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



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 487

def start_async(resource_group_name, lab_name, name, custom_headers = nil)
  # Send request
  promise = begin_start_async(resource_group_name, lab_name, name, 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

#stop(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Object

Stop a Lab VM. This operation can take a while to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name of the virtual Machine.

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

    A hash of custom headers that



512
513
514
515
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 512

def stop(resource_group_name, lab_name, name, custom_headers = nil)
  response = stop_async(resource_group_name, lab_name, name, custom_headers).value!
  nil
end

#stop_async(resource_group_name, lab_name, name, custom_headers = nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_name (String)

    The name of the lab.

  • name (String)

    The name 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



527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
# File 'lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb', line 527

def stop_async(resource_group_name, lab_name, name, custom_headers = nil)
  # Send request
  promise = begin_stop_async(resource_group_name, lab_name, name, 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