Class: Azure::Labservices::Mgmt::V2018_10_15::GlobalUsers
- Inherits:
-
Object
- Object
- Azure::Labservices::Mgmt::V2018_10_15::GlobalUsers
- Includes:
- MsRestAzure
- Defined in:
- lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb
Overview
The Managed Labs Client.
Instance Attribute Summary collapse
-
#client ⇒ ManagedLabsClient
readonly
Reference to the ManagedLabsClient.
Instance Method Summary collapse
-
#begin_reset_password(user_name, reset_password_payload, custom_headers: nil) ⇒ Object
Resets the user password on an environment This operation can take a while to complete.
-
#begin_reset_password_async(user_name, reset_password_payload, custom_headers: nil) ⇒ Concurrent::Promise
Resets the user password on an environment This operation can take a while to complete.
-
#begin_reset_password_with_http_info(user_name, reset_password_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Resets the user password on an environment This operation can take a while to complete.
-
#begin_start_environment(user_name, environment_operations_payload, custom_headers: nil) ⇒ Object
Starts an environment by starting all resources inside the environment.
-
#begin_start_environment_async(user_name, environment_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Starts an environment by starting all resources inside the environment.
-
#begin_start_environment_with_http_info(user_name, environment_operations_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Starts an environment by starting all resources inside the environment.
-
#begin_stop_environment(user_name, environment_operations_payload, custom_headers: nil) ⇒ Object
Stops an environment by stopping all resources inside the environment This operation can take a while to complete.
-
#begin_stop_environment_async(user_name, environment_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Stops an environment by stopping all resources inside the environment This operation can take a while to complete.
-
#begin_stop_environment_with_http_info(user_name, environment_operations_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Stops an environment by stopping all resources inside the environment This operation can take a while to complete.
-
#get_environment(user_name, environment_operations_payload, expand: nil, custom_headers: nil) ⇒ GetEnvironmentResponse
Gets the virtual machine details.
-
#get_environment_async(user_name, environment_operations_payload, expand: nil, custom_headers: nil) ⇒ Concurrent::Promise
Gets the virtual machine details.
-
#get_environment_with_http_info(user_name, environment_operations_payload, expand: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the virtual machine details.
-
#get_operation_batch_status(user_name, operation_batch_status_payload, custom_headers: nil) ⇒ OperationBatchStatusResponse
Get batch operation status.
-
#get_operation_batch_status_async(user_name, operation_batch_status_payload, custom_headers: nil) ⇒ Concurrent::Promise
Get batch operation status.
-
#get_operation_batch_status_with_http_info(user_name, operation_batch_status_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get batch operation status.
-
#get_operation_status(user_name, operation_status_payload, custom_headers: nil) ⇒ OperationStatusResponse
Gets the status of long running operation.
-
#get_operation_status_async(user_name, operation_status_payload, custom_headers: nil) ⇒ Concurrent::Promise
Gets the status of long running operation.
-
#get_operation_status_with_http_info(user_name, operation_status_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the status of long running operation.
-
#get_personal_preferences(user_name, personal_preferences_operations_payload, custom_headers: nil) ⇒ GetPersonalPreferencesResponse
Get personal preferences for a user.
-
#get_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Get personal preferences for a user.
-
#get_personal_preferences_with_http_info(user_name, personal_preferences_operations_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get personal preferences for a user.
-
#initialize(client) ⇒ GlobalUsers
constructor
Creates and initializes a new instance of the GlobalUsers class.
-
#list_environments(user_name, list_environments_payload, custom_headers: nil) ⇒ ListEnvironmentsResponse
List Environments for the user.
-
#list_environments_async(user_name, list_environments_payload, custom_headers: nil) ⇒ Concurrent::Promise
List Environments for the user.
-
#list_environments_with_http_info(user_name, list_environments_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List Environments for the user.
-
#list_labs(user_name, custom_headers: nil) ⇒ ListLabsResponse
List labs for the user.
-
#list_labs_async(user_name, custom_headers: nil) ⇒ Concurrent::Promise
List labs for the user.
-
#list_labs_with_http_info(user_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List labs for the user.
-
#register(user_name, register_payload, custom_headers: nil) ⇒ Object
Register a user to a managed lab.
-
#register_async(user_name, register_payload, custom_headers: nil) ⇒ Concurrent::Promise
Register a user to a managed lab.
-
#register_with_http_info(user_name, register_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Register a user to a managed lab.
-
#reset_password(user_name, reset_password_payload, custom_headers: nil) ⇒ Object
Resets the user password on an environment This operation can take a while to complete.
-
#reset_password_async(user_name, reset_password_payload, custom_headers: nil) ⇒ Concurrent::Promise
for resetting passwords.
-
#start_environment(user_name, environment_operations_payload, custom_headers: nil) ⇒ Object
Starts an environment by starting all resources inside the environment.
-
#start_environment_async(user_name, environment_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
-
#stop_environment(user_name, environment_operations_payload, custom_headers: nil) ⇒ Object
Stops an environment by stopping all resources inside the environment This operation can take a while to complete.
-
#stop_environment_async(user_name, environment_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
Constructor Details
#initialize(client) ⇒ GlobalUsers
Creates and initializes a new instance of the GlobalUsers class.
17 18 19 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 17 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ ManagedLabsClient (readonly)
Returns reference to the ManagedLabsClient.
22 23 24 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 22 def client @client end |
Instance Method Details
#begin_reset_password(user_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.
856 857 858 859 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 856 def begin_reset_password(user_name, reset_password_payload, custom_headers:nil) response = begin_reset_password_async(user_name, reset_password_payload, custom_headers:custom_headers).value! nil end |
#begin_reset_password_async(user_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.
889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 889 def begin_reset_password_async(user_name, reset_password_payload, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_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 = 'providers/Microsoft.LabServices/users/{userName}/resetPassword' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_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, ) 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(user_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.
873 874 875 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 873 def begin_reset_password_with_http_info(user_name, reset_password_payload, custom_headers:nil) begin_reset_password_async(user_name, reset_password_payload, custom_headers:custom_headers).value! end |
#begin_start_environment(user_name, environment_operations_payload, custom_headers: nil) ⇒ Object
Starts an environment by starting all resources inside the environment. This operation can take a while to complete
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
950 951 952 953 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 950 def begin_start_environment(user_name, environment_operations_payload, custom_headers:nil) response = begin_start_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! nil end |
#begin_start_environment_async(user_name, environment_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Starts an environment by starting all resources inside the environment. This operation can take a while to complete
Represents payload for any Environment operations like get, start, stop, connect to the HTTP request.
985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 985 def begin_start_environment_async(user_name, environment_operations_payload, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_name.nil? fail ArgumentError, 'environment_operations_payload is nil' if environment_operations_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::EnvironmentOperationsPayload.mapper() request_content = @client.serialize(request_mapper, environment_operations_payload) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'providers/Microsoft.LabServices/users/{userName}/startEnvironment' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_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, ) 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_environment_with_http_info(user_name, environment_operations_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Starts an environment by starting all resources inside the environment. This operation can take a while to complete
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
968 969 970 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 968 def begin_start_environment_with_http_info(user_name, environment_operations_payload, custom_headers:nil) begin_start_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! end |
#begin_stop_environment(user_name, environment_operations_payload, custom_headers: nil) ⇒ Object
Stops an environment by stopping all resources inside the environment This operation can take a while to complete
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
1046 1047 1048 1049 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 1046 def begin_stop_environment(user_name, environment_operations_payload, custom_headers:nil) response = begin_stop_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! nil end |
#begin_stop_environment_async(user_name, environment_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Stops an environment by stopping all resources inside the environment This operation can take a while to complete
Represents payload for any Environment operations like get, start, stop, connect to the HTTP request.
1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 1081 def begin_stop_environment_async(user_name, environment_operations_payload, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_name.nil? fail ArgumentError, 'environment_operations_payload is nil' if environment_operations_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::EnvironmentOperationsPayload.mapper() request_content = @client.serialize(request_mapper, environment_operations_payload) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'providers/Microsoft.LabServices/users/{userName}/stopEnvironment' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_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, ) 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_environment_with_http_info(user_name, environment_operations_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Stops an environment by stopping all resources inside the environment This operation can take a while to complete
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
1064 1065 1066 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 1064 def begin_stop_environment_with_http_info(user_name, environment_operations_payload, custom_headers:nil) begin_stop_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! end |
#get_environment(user_name, environment_operations_payload, expand: nil, custom_headers: nil) ⇒ GetEnvironmentResponse
Gets the virtual machine details
Represents payload for any Environment operations like get, start, stop, connect ‘properties($expand=environment)’ will be added to the HTTP request.
38 39 40 41 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 38 def get_environment(user_name, environment_operations_payload, expand:nil, custom_headers:nil) response = get_environment_async(user_name, environment_operations_payload, expand:, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_environment_async(user_name, environment_operations_payload, expand: nil, custom_headers: nil) ⇒ Concurrent::Promise
Gets the virtual machine details
Represents payload for any Environment operations like get, start, stop, connect ‘properties($expand=environment)’ to the HTTP request.
75 76 77 78 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 130 131 132 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 75 def get_environment_async(user_name, environment_operations_payload, expand:nil, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_name.nil? fail ArgumentError, 'environment_operations_payload is nil' if environment_operations_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::EnvironmentOperationsPayload.mapper() request_content = @client.serialize(request_mapper, environment_operations_payload) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'providers/Microsoft.LabServices/users/{userName}/getEnvironment' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_name}, query_params: {'$expand' => ,'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, ) 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::GetEnvironmentResponse.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_environment_with_http_info(user_name, environment_operations_payload, expand: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the virtual machine details
Represents payload for any Environment operations like get, start, stop, connect ‘properties($expand=environment)’ will be added to the HTTP request.
57 58 59 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 57 def get_environment_with_http_info(user_name, environment_operations_payload, expand:nil, custom_headers:nil) get_environment_async(user_name, environment_operations_payload, expand:, custom_headers:custom_headers).value! end |
#get_operation_batch_status(user_name, operation_batch_status_payload, custom_headers: nil) ⇒ OperationBatchStatusResponse
Get batch operation status
to get the status of an operation will be added to the HTTP request.
145 146 147 148 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 145 def get_operation_batch_status(user_name, operation_batch_status_payload, custom_headers:nil) response = get_operation_batch_status_async(user_name, operation_batch_status_payload, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_operation_batch_status_async(user_name, operation_batch_status_payload, custom_headers: nil) ⇒ Concurrent::Promise
Get batch operation status
to get the status of an operation to the HTTP request.
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 225 226 227 228 229 230 231 232 233 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 176 def get_operation_batch_status_async(user_name, operation_batch_status_payload, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_name.nil? fail ArgumentError, 'operation_batch_status_payload is nil' if operation_batch_status_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::OperationBatchStatusPayload.mapper() request_content = @client.serialize(request_mapper, operation_batch_status_payload) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'providers/Microsoft.LabServices/users/{userName}/getOperationBatchStatus' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_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, ) 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::OperationBatchStatusResponse.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_operation_batch_status_with_http_info(user_name, operation_batch_status_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get batch operation status
to get the status of an operation will be added to the HTTP request.
161 162 163 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 161 def get_operation_batch_status_with_http_info(user_name, operation_batch_status_payload, custom_headers:nil) get_operation_batch_status_async(user_name, operation_batch_status_payload, custom_headers:custom_headers).value! end |
#get_operation_status(user_name, operation_status_payload, custom_headers: nil) ⇒ OperationStatusResponse
Gets the status of long running operation
status of an operation will be added to the HTTP request.
246 247 248 249 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 246 def get_operation_status(user_name, operation_status_payload, custom_headers:nil) response = get_operation_status_async(user_name, operation_status_payload, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_operation_status_async(user_name, operation_status_payload, custom_headers: nil) ⇒ Concurrent::Promise
Gets the status of long running operation
status of an operation to the HTTP request.
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 277 def get_operation_status_async(user_name, operation_status_payload, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_name.nil? fail ArgumentError, 'operation_status_payload is nil' if operation_status_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::OperationStatusPayload.mapper() request_content = @client.serialize(request_mapper, operation_status_payload) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'providers/Microsoft.LabServices/users/{userName}/getOperationStatus' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_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, ) 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::OperationStatusResponse.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_operation_status_with_http_info(user_name, operation_status_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Gets the status of long running operation
status of an operation will be added to the HTTP request.
262 263 264 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 262 def get_operation_status_with_http_info(user_name, operation_status_payload, custom_headers:nil) get_operation_status_async(user_name, operation_status_payload, custom_headers:custom_headers).value! end |
#get_personal_preferences(user_name, personal_preferences_operations_payload, custom_headers: nil) ⇒ GetPersonalPreferencesResponse
Get personal preferences for a user
- PersonalPreferencesOperationsPayload
-
Represents payload for any Environment
operations like get, start, stop, connect will be added to the HTTP request.
348 349 350 351 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 348 def get_personal_preferences(user_name, personal_preferences_operations_payload, custom_headers:nil) response = get_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers:custom_headers).value! response.body unless response.nil? end |
#get_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Get personal preferences for a user
- PersonalPreferencesOperationsPayload
-
Represents payload for any Environment
operations like get, start, stop, connect to the HTTP request.
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 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 381 def get_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_name.nil? fail ArgumentError, 'personal_preferences_operations_payload is nil' if personal_preferences_operations_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::PersonalPreferencesOperationsPayload.mapper() request_content = @client.serialize(request_mapper, personal_preferences_operations_payload) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'providers/Microsoft.LabServices/users/{userName}/getPersonalPreferences' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_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, ) 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::GetPersonalPreferencesResponse.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#get_personal_preferences_with_http_info(user_name, personal_preferences_operations_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Get personal preferences for a user
- PersonalPreferencesOperationsPayload
-
Represents payload for any Environment
operations like get, start, stop, connect will be added to the HTTP request.
365 366 367 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 365 def get_personal_preferences_with_http_info(user_name, personal_preferences_operations_payload, custom_headers:nil) get_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers:custom_headers).value! end |
#list_environments(user_name, list_environments_payload, custom_headers: nil) ⇒ ListEnvironmentsResponse
List Environments for the user
payload to list environments owned by a user will be added to the HTTP request.
451 452 453 454 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 451 def list_environments(user_name, list_environments_payload, custom_headers:nil) response = list_environments_async(user_name, list_environments_payload, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_environments_async(user_name, list_environments_payload, custom_headers: nil) ⇒ Concurrent::Promise
List Environments for the user
payload to list environments owned by a user to the HTTP request.
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 538 539 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 482 def list_environments_async(user_name, list_environments_payload, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_name.nil? fail ArgumentError, 'list_environments_payload is nil' if list_environments_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::ListEnvironmentsPayload.mapper() request_content = @client.serialize(request_mapper, list_environments_payload) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'providers/Microsoft.LabServices/users/{userName}/listEnvironments' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_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, ) 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::ListEnvironmentsResponse.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_environments_with_http_info(user_name, list_environments_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List Environments for the user
payload to list environments owned by a user will be added to the HTTP request.
467 468 469 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 467 def list_environments_with_http_info(user_name, list_environments_payload, custom_headers:nil) list_environments_async(user_name, list_environments_payload, custom_headers:custom_headers).value! end |
#list_labs(user_name, custom_headers: nil) ⇒ ListLabsResponse
List labs for the user.
will be added to the HTTP request.
550 551 552 553 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 550 def list_labs(user_name, custom_headers:nil) response = list_labs_async(user_name, custom_headers:custom_headers).value! response.body unless response.nil? end |
#list_labs_async(user_name, custom_headers: nil) ⇒ Concurrent::Promise
List labs for the user.
to the HTTP request.
577 578 579 580 581 582 583 584 585 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 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 577 def list_labs_async(user_name, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_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 = 'providers/Microsoft.LabServices/users/{userName}/listLabs' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_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, ) 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::ListLabsResponse.mapper() result.body = @client.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e., e.backtrace, result) end end result end promise.execute end |
#list_labs_with_http_info(user_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
List labs for the user.
will be added to the HTTP request.
564 565 566 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 564 def list_labs_with_http_info(user_name, custom_headers:nil) list_labs_async(user_name, custom_headers:custom_headers).value! end |
#register(user_name, register_payload, custom_headers: nil) ⇒ Object
Register a user to a managed lab
action. will be added to the HTTP request.
638 639 640 641 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 638 def register(user_name, register_payload, custom_headers:nil) response = register_async(user_name, register_payload, custom_headers:custom_headers).value! nil end |
#register_async(user_name, register_payload, custom_headers: nil) ⇒ Concurrent::Promise
Register a user to a managed lab
action. to the HTTP request.
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 669 def register_async(user_name, register_payload, custom_headers:nil) fail ArgumentError, 'user_name is nil' if user_name.nil? fail ArgumentError, 'register_payload is nil' if register_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::RegisterPayload.mapper() request_content = @client.serialize(request_mapper, register_payload) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'providers/Microsoft.LabServices/users/{userName}/register' request_url = @base_url || @client.base_url = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'userName' => user_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, ) 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 |
#register_with_http_info(user_name, register_payload, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse
Register a user to a managed lab
action. will be added to the HTTP request.
654 655 656 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 654 def register_with_http_info(user_name, register_payload, custom_headers:nil) register_async(user_name, register_payload, custom_headers:custom_headers).value! end |
#reset_password(user_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.
728 729 730 731 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 728 def reset_password(user_name, reset_password_payload, custom_headers:nil) response = reset_password_async(user_name, reset_password_payload, custom_headers:custom_headers).value! nil end |
#reset_password_async(user_name, reset_password_payload, custom_headers: nil) ⇒ Concurrent::Promise
for resetting passwords. will be added to the HTTP request.
response.
743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 743 def reset_password_async(user_name, reset_password_payload, custom_headers:nil) # Send request promise = begin_reset_password_async(user_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_environment(user_name, environment_operations_payload, custom_headers: nil) ⇒ Object
Starts an environment by starting all resources inside the environment. This operation can take a while to complete
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
770 771 772 773 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 770 def start_environment(user_name, environment_operations_payload, custom_headers:nil) response = start_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! nil end |
#start_environment_async(user_name, environment_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
response.
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 786 def start_environment_async(user_name, environment_operations_payload, custom_headers:nil) # Send request promise = begin_start_environment_async(user_name, environment_operations_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 |
#stop_environment(user_name, environment_operations_payload, custom_headers: nil) ⇒ Object
Stops an environment by stopping all resources inside the environment This operation can take a while to complete
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
813 814 815 816 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 813 def stop_environment(user_name, environment_operations_payload, custom_headers:nil) response = stop_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value! nil end |
#stop_environment_async(user_name, environment_operations_payload, custom_headers: nil) ⇒ Concurrent::Promise
Represents payload for any Environment operations like get, start, stop, connect will be added to the HTTP request.
response.
829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 |
# File 'lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb', line 829 def stop_environment_async(user_name, environment_operations_payload, custom_headers:nil) # Send request promise = begin_stop_environment_async(user_name, environment_operations_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 |