Class: Azure::Labservices::Mgmt::V2018_10_15::Environments

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb

Overview

The Managed Labs Client.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Environments

Creates and initializes a new instance of the Environments class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientManagedLabsClient (readonly)

Returns reference to the ManagedLabsClient.

Returns:



22
23
24
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 22

def client
  @client
end

Instance Method Details

#begin_delete(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Object

Delete environment. 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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that



783
784
785
786
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 783

def begin_delete(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:nil)
  response = begin_delete_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
  nil
end

#begin_delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Concurrent::Promise

Delete environment. This operation can take a while to complete

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 818

def begin_delete_async(resource_group_name, , lab_name, environment_setting_name, environment_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_account_name is nil' if .nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
  fail ArgumentError, 'environment_name is nil' if environment_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'

  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,'labAccountName' => ,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete environment. 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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



801
802
803
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 801

def begin_delete_with_http_info(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:nil)
  begin_delete_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
end

#begin_reset_password(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers: nil) ⇒ Object

Resets the user password on an environment This operation can take a while to complete

for resetting passwords. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • reset_password_payload (ResetPasswordPayload)

    Represents the payload

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

    A hash of custom headers that



879
880
881
882
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 879

def begin_reset_password(resource_group_name, , lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
  response = begin_reset_password_async(resource_group_name, , lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
  nil
end

#begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers: nil) ⇒ Concurrent::Promise

Resets the user password on an environment This operation can take a while to complete

for resetting passwords. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • reset_password_payload (ResetPasswordPayload)

    Represents the payload

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 920

def begin_reset_password_async(resource_group_name, , lab_name, environment_setting_name, environment_name, reset_password_payload, 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_account_name is nil' if .nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
  fail ArgumentError, 'environment_name is nil' if environment_name.nil?
  fail ArgumentError, 'reset_password_payload is nil' if reset_password_payload.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResetPasswordPayload.mapper()
  request_content = @client.serialize(request_mapper,  reset_password_payload)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/resetPassword'

  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,'labAccountName' => ,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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_reset_password_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Resets the user password on an environment This operation can take a while to complete

for resetting passwords. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • reset_password_payload (ResetPasswordPayload)

    Represents the payload

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



900
901
902
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 900

def begin_reset_password_with_http_info(resource_group_name, , lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
  begin_reset_password_async(resource_group_name, , lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
end

#begin_start(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Object

Starts an environment by starting all resources inside the environment. 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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that



987
988
989
990
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 987

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

#begin_start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Concurrent::Promise

Starts an environment by starting all resources inside the environment. This operation can take a while to complete

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
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
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 1024

def begin_start_async(resource_group_name, , lab_name, environment_setting_name, environment_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_account_name is nil' if .nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
  fail ArgumentError, 'environment_name is nil' if environment_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/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,'labAccountName' => ,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Starts an environment by starting all resources inside the environment. 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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1006
1007
1008
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 1006

def begin_start_with_http_info(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:nil)
  begin_start_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
end

#begin_stop(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Object

Stops an environment by stopping all resources inside the environment 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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that



1083
1084
1085
1086
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 1083

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

#begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Concurrent::Promise

Stops an environment by stopping all resources inside the environment This operation can take a while to complete

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 1120

def begin_stop_async(resource_group_name, , lab_name, environment_setting_name, environment_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_account_name is nil' if .nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
  fail ArgumentError, 'environment_name is nil' if environment_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/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,'labAccountName' => ,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Stops an environment by stopping all resources inside the environment 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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



1102
1103
1104
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 1102

def begin_stop_with_http_info(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:nil)
  begin_stop_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
end

#claim(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Object

Claims the environment and assigns it to the user

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that



551
552
553
554
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 551

def claim(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:nil)
  response = claim_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
  nil
end

#claim_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Concurrent::Promise

Claims the environment and assigns it to the user

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



586
587
588
589
590
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
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 586

def claim_async(resource_group_name, , lab_name, environment_setting_name, environment_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_account_name is nil' if .nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
  fail ArgumentError, 'environment_name is nil' if environment_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}/claim'

  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,'labAccountName' => ,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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
      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

#claim_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Claims the environment and assigns it to the user

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



569
570
571
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 569

def claim_with_http_info(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:nil)
  claim_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
end

#create_or_update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers: nil) ⇒ Environment

Create or replace an existing Environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • environment (Environment)

    Represents an environment instance

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

    A hash of custom headers that

Returns:

  • (Environment)

    operation results.



269
270
271
272
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 269

def create_or_update(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
  response = create_or_update_async(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers: nil) ⇒ Concurrent::Promise

Create or replace an existing Environment.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • environment (Environment)

    Represents an environment instance

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 306

def create_or_update_async(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, 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_account_name is nil' if .nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
  fail ArgumentError, 'environment_name is nil' if environment_name.nil?
  fail ArgumentError, 'environment is nil' if environment.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper()
  request_content = @client.serialize(request_mapper,  environment)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'

  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,'labAccountName' => ,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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 = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_or_update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Create or replace an existing Environment.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • environment (Environment)

    Represents an environment instance

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



288
289
290
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 288

def create_or_update_with_http_info(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
  create_or_update_async(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value!
end

#delete(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Object

Delete environment. 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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that



391
392
393
394
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 391

def delete(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:nil)
  response = delete_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 408

def delete_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers: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, lab_account_name, lab_name, environment_setting_name, environment_name, expand: nil, custom_headers: nil) ⇒ Environment

Get environment

‘properties($expand=networkInterface)’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

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

    A hash of custom headers that

Returns:

  • (Environment)

    operation results.



160
161
162
163
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 160

def get(resource_group_name, , lab_name, environment_setting_name, environment_name, expand:nil, custom_headers:nil)
  response = get_async(resource_group_name, , lab_name, environment_setting_name, environment_name, expand:expand, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand: nil, custom_headers: nil) ⇒ Concurrent::Promise

Get environment

‘properties($expand=networkInterface)’ to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 199

def get_async(resource_group_name, , lab_name, environment_setting_name, environment_name, expand: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_account_name is nil' if .nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
  fail ArgumentError, 'environment_name is nil' if environment_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'

  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,'labAccountName' => ,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_name},
      query_params: {'$expand' => expand,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

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

    result
  end

  promise.execute
end

#get_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, expand: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get environment

‘properties($expand=networkInterface)’ will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



180
181
182
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 180

def get_with_http_info(resource_group_name, , lab_name, environment_setting_name, environment_name, expand:nil, custom_headers:nil)
  get_async(resource_group_name, , lab_name, environment_setting_name, environment_name, expand:expand, custom_headers:custom_headers).value!
end

#list(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Array<Environment>

List environments in a given environment setting.

‘properties($expand=networkInterface)’ operation. notation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (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:

  • (Array<Environment>)

    operation results.



43
44
45
46
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 43

def list(resource_group_name, , lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  first_page = list_as_lazy(resource_group_name, , lab_name, environment_setting_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_as_lazy(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ ResponseWithContinuationEnvironment

List environments in a given environment setting.

‘properties($expand=networkInterface)’ operation. notation. will be added to the HTTP request.

pages of the response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (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:

  • (ResponseWithContinuationEnvironment)

    which provide lazy access to



1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 1274

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

#list_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ Concurrent::Promise

List environments in a given environment setting.

‘properties($expand=networkInterface)’ operation. notation. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (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.



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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 90

def list_async(resource_group_name, , lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby: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_account_name is nil' if .nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments'

  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,'labAccountName' => ,'labName' => lab_name,'environmentSettingName' => environment_setting_name},
      query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

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

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

    result
  end

  promise.execute
end

#list_next(next_page_link, custom_headers: nil) ⇒ ResponseWithContinuationEnvironment

List environments in a given environment setting.

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:

  • (ResponseWithContinuationEnvironment)

    operation results.



1176
1177
1178
1179
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 1176

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

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

List environments in a given environment setting.

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.



1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 1205

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


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end

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

List environments in a given environment setting.

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.



1191
1192
1193
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 1191

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

#list_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, expand: nil, filter: nil, top: nil, orderby: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List environments in a given environment setting.

‘properties($expand=networkInterface)’ operation. notation. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • expand (String) (defaults to: nil)

    Specify the $expand query. Example:

  • filter (String) (defaults to: nil)

    The filter to apply to the operation.

  • top (Integer) (defaults to: nil)

    The maximum number of resources to return from the

  • orderby (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.



67
68
69
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 67

def list_with_http_info(resource_group_name, , lab_name, environment_setting_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
  list_async(resource_group_name, , lab_name, environment_setting_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
end

#reset_password(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers: nil) ⇒ Object

Resets the user password on an environment This operation can take a while to complete

for resetting passwords. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • reset_password_payload (ResetPasswordPayload)

    Represents the payload

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

    A hash of custom headers that



646
647
648
649
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 646

def reset_password(resource_group_name, , lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
  response = reset_password_async(resource_group_name, , lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
  nil
end

#reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers: nil) ⇒ Concurrent::Promise

for resetting passwords. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • reset_password_payload (ResetPasswordPayload)

    Represents the payload

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 665

def reset_password_async(resource_group_name, , lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
  # Send request
  promise = begin_reset_password_async(resource_group_name, , lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers: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, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Object

Starts an environment by starting all resources inside the environment. 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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that



693
694
695
696
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 693

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

#start_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 710

def start_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers:nil)
  # Send request
  promise = begin_start_async(resource_group_name, , lab_name, environment_setting_name, environment_name, custom_headers: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_account_name, lab_name, environment_setting_name, environment_name, custom_headers: nil) ⇒ Object

Stops an environment by stopping all resources inside the environment 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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that



738
739
740
741
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 738

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

#stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_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_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 755

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

#update(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers: nil) ⇒ Environment

Modify properties of environments.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • environment (EnvironmentFragment)

    Represents an environment instance

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

    A hash of custom headers that

Returns:

  • (Environment)

    operation results.



438
439
440
441
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 438

def update(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
  response = update_async(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers: nil) ⇒ Concurrent::Promise

Modify properties of environments.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • environment (EnvironmentFragment)

    Represents an environment instance

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 475

def update_async(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, 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_account_name is nil' if .nil?
  fail ArgumentError, 'lab_name is nil' if lab_name.nil?
  fail ArgumentError, 'environment_setting_name is nil' if environment_setting_name.nil?
  fail ArgumentError, 'environment_name is nil' if environment_name.nil?
  fail ArgumentError, 'environment is nil' if environment.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::EnvironmentFragment.mapper()
  request_content = @client.serialize(request_mapper,  environment)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/labs/{labName}/environmentsettings/{environmentSettingName}/environments/{environmentName}'

  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,'labAccountName' => ,'labName' => lab_name,'environmentSettingName' => environment_setting_name,'environmentName' => environment_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 = Azure::Labservices::Mgmt::V2018_10_15::Models::Environment.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, environment, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Modify properties of environments.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • lab_account_name (String)

    The name of the lab Account.

  • lab_name (String)

    The name of the lab.

  • environment_setting_name (String)

    The name of the environment Setting.

  • environment_name (String)

    The name of the environment.

  • environment (EnvironmentFragment)

    Represents an environment instance

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



457
458
459
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb', line 457

def update_with_http_info(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, custom_headers:nil)
  update_async(resource_group_name, , lab_name, environment_setting_name, environment_name, environment, custom_headers:custom_headers).value!
end