azure_mgmt_server_management 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generated/azure_mgmt_server_management.rb +14 -11
- data/lib/generated/azure_mgmt_server_management/gateway.rb +444 -441
- data/lib/generated/azure_mgmt_server_management/models/{auto_upgrade.rb → credential_data_format.rb} +4 -5
- data/lib/generated/azure_mgmt_server_management/models/encryption_jwk_resource.rb +74 -0
- data/lib/generated/azure_mgmt_server_management/models/error.rb +2 -2
- data/lib/generated/azure_mgmt_server_management/models/gateway_expand_option.rb +2 -1
- data/lib/generated/azure_mgmt_server_management/models/gateway_parameters.rb +12 -11
- data/lib/generated/azure_mgmt_server_management/models/gateway_profile.rb +12 -12
- data/lib/generated/azure_mgmt_server_management/models/gateway_resource.rb +39 -15
- data/lib/generated/azure_mgmt_server_management/models/gateway_resources.rb +4 -4
- data/lib/generated/azure_mgmt_server_management/models/gateway_status.rb +108 -5
- data/lib/generated/azure_mgmt_server_management/models/node_parameters.rb +7 -7
- data/lib/generated/azure_mgmt_server_management/models/node_resource.rb +4 -4
- data/lib/generated/azure_mgmt_server_management/models/node_resources.rb +4 -4
- data/lib/generated/azure_mgmt_server_management/models/power_shell_command_parameters.rb +3 -3
- data/lib/generated/azure_mgmt_server_management/models/power_shell_command_result.rb +14 -14
- data/lib/generated/azure_mgmt_server_management/models/power_shell_command_results.rb +2 -2
- data/lib/generated/azure_mgmt_server_management/models/power_shell_command_status.rb +2 -2
- data/lib/generated/azure_mgmt_server_management/models/power_shell_expand_option.rb +1 -1
- data/lib/generated/azure_mgmt_server_management/models/power_shell_session_resource.rb +7 -7
- data/lib/generated/azure_mgmt_server_management/models/power_shell_session_resources.rb +5 -5
- data/lib/generated/azure_mgmt_server_management/models/power_shell_tab_completion_parameters.rb +2 -2
- data/lib/generated/azure_mgmt_server_management/models/power_shell_tab_completion_results.rb +3 -3
- data/lib/generated/azure_mgmt_server_management/models/prompt_field_description.rb +6 -6
- data/lib/generated/azure_mgmt_server_management/models/prompt_field_type.rb +1 -1
- data/lib/generated/azure_mgmt_server_management/models/prompt_message_response.rb +3 -3
- data/lib/generated/azure_mgmt_server_management/models/retention_period.rb +16 -0
- data/lib/generated/azure_mgmt_server_management/models/session_parameters.rb +38 -4
- data/lib/generated/azure_mgmt_server_management/models/session_resource.rb +4 -4
- data/lib/generated/azure_mgmt_server_management/models/upgrade_mode.rb +16 -0
- data/lib/generated/azure_mgmt_server_management/models/version.rb +8 -8
- data/lib/generated/azure_mgmt_server_management/module_definition.rb +1 -1
- data/lib/generated/azure_mgmt_server_management/node.rb +309 -309
- data/lib/generated/azure_mgmt_server_management/power_shell.rb +280 -280
- data/lib/generated/azure_mgmt_server_management/server_management.rb +16 -3
- data/lib/generated/azure_mgmt_server_management/session.rb +128 -95
- data/lib/generated/azure_mgmt_server_management/version.rb +2 -2
- metadata +8 -5
@@ -1,11 +1,11 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator 0.
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
|
3
3
|
# Changes may cause incorrect behavior and will be lost if the code is
|
4
4
|
# regenerated.
|
5
5
|
|
6
6
|
module Azure::ARM::ServerManagement
|
7
7
|
#
|
8
|
-
# REST API for Azure Server Management Service
|
8
|
+
# REST API for Azure Server Management Service.
|
9
9
|
#
|
10
10
|
class PowerShell
|
11
11
|
include Azure::ARM::ServerManagement::Models
|
@@ -28,7 +28,7 @@ module Azure::ARM::ServerManagement
|
|
28
28
|
# @param resource_group_name [String] The resource group name uniquely
|
29
29
|
# identifies the resource group within the user subscriptionId.
|
30
30
|
# @param node_name [String] The node name (256 characters maximum).
|
31
|
-
# @param session [String] The sessionId from the user
|
31
|
+
# @param session [String] The sessionId from the user.
|
32
32
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
33
|
# will be added to the HTTP request.
|
34
34
|
#
|
@@ -45,7 +45,7 @@ module Azure::ARM::ServerManagement
|
|
45
45
|
# @param resource_group_name [String] The resource group name uniquely
|
46
46
|
# identifies the resource group within the user subscriptionId.
|
47
47
|
# @param node_name [String] The node name (256 characters maximum).
|
48
|
-
# @param session [String] The sessionId from the user
|
48
|
+
# @param session [String] The sessionId from the user.
|
49
49
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
50
50
|
# will be added to the HTTP request.
|
51
51
|
#
|
@@ -61,7 +61,7 @@ module Azure::ARM::ServerManagement
|
|
61
61
|
# @param resource_group_name [String] The resource group name uniquely
|
62
62
|
# identifies the resource group within the user subscriptionId.
|
63
63
|
# @param node_name [String] The node name (256 characters maximum).
|
64
|
-
# @param session [String] The sessionId from the user
|
64
|
+
# @param session [String] The sessionId from the user.
|
65
65
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
66
66
|
# to the HTTP request.
|
67
67
|
#
|
@@ -121,13 +121,13 @@ module Azure::ARM::ServerManagement
|
|
121
121
|
end
|
122
122
|
|
123
123
|
#
|
124
|
-
# Creates a PowerShell session
|
124
|
+
# Creates a PowerShell session.
|
125
125
|
#
|
126
126
|
# @param resource_group_name [String] The resource group name uniquely
|
127
127
|
# identifies the resource group within the user subscriptionId.
|
128
128
|
# @param node_name [String] The node name (256 characters maximum).
|
129
|
-
# @param session [String] The sessionId from the user
|
130
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
129
|
+
# @param session [String] The sessionId from the user.
|
130
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
131
131
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
132
132
|
# will be added to the HTTP request.
|
133
133
|
#
|
@@ -142,8 +142,8 @@ module Azure::ARM::ServerManagement
|
|
142
142
|
# @param resource_group_name [String] The resource group name uniquely
|
143
143
|
# identifies the resource group within the user subscriptionId.
|
144
144
|
# @param node_name [String] The node name (256 characters maximum).
|
145
|
-
# @param session [String] The sessionId from the user
|
146
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
145
|
+
# @param session [String] The sessionId from the user.
|
146
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
147
147
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
148
148
|
# will be added to the HTTP request.
|
149
149
|
#
|
@@ -169,54 +169,60 @@ module Azure::ARM::ServerManagement
|
|
169
169
|
end
|
170
170
|
|
171
171
|
#
|
172
|
-
#
|
172
|
+
# Gets the status of a command.
|
173
173
|
#
|
174
174
|
# @param resource_group_name [String] The resource group name uniquely
|
175
175
|
# identifies the resource group within the user subscriptionId.
|
176
176
|
# @param node_name [String] The node name (256 characters maximum).
|
177
|
-
# @param session [String] The sessionId from the user
|
178
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
177
|
+
# @param session [String] The sessionId from the user.
|
178
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
179
|
+
# @param expand [PowerShellExpandOption] Gets current output from an ongoing
|
180
|
+
# call. Possible values include: 'output'
|
179
181
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
180
182
|
# will be added to the HTTP request.
|
181
183
|
#
|
182
|
-
# @return [
|
184
|
+
# @return [PowerShellCommandStatus] operation results.
|
183
185
|
#
|
184
|
-
def
|
185
|
-
response =
|
186
|
+
def get_command_status(resource_group_name, node_name, session, pssession, expand = nil, custom_headers = nil)
|
187
|
+
response = get_command_status_async(resource_group_name, node_name, session, pssession, expand, custom_headers).value!
|
186
188
|
response.body unless response.nil?
|
187
189
|
end
|
188
190
|
|
189
191
|
#
|
190
|
-
#
|
192
|
+
# Gets the status of a command.
|
191
193
|
#
|
192
194
|
# @param resource_group_name [String] The resource group name uniquely
|
193
195
|
# identifies the resource group within the user subscriptionId.
|
194
196
|
# @param node_name [String] The node name (256 characters maximum).
|
195
|
-
# @param session [String] The sessionId from the user
|
196
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
197
|
+
# @param session [String] The sessionId from the user.
|
198
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
199
|
+
# @param expand [PowerShellExpandOption] Gets current output from an ongoing
|
200
|
+
# call. Possible values include: 'output'
|
197
201
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
198
202
|
# will be added to the HTTP request.
|
199
203
|
#
|
200
204
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
201
205
|
#
|
202
|
-
def
|
203
|
-
|
206
|
+
def get_command_status_with_http_info(resource_group_name, node_name, session, pssession, expand = nil, custom_headers = nil)
|
207
|
+
get_command_status_async(resource_group_name, node_name, session, pssession, expand, custom_headers).value!
|
204
208
|
end
|
205
209
|
|
206
210
|
#
|
207
|
-
#
|
211
|
+
# Gets the status of a command.
|
208
212
|
#
|
209
213
|
# @param resource_group_name [String] The resource group name uniquely
|
210
214
|
# identifies the resource group within the user subscriptionId.
|
211
215
|
# @param node_name [String] The node name (256 characters maximum).
|
212
|
-
# @param session [String] The sessionId from the user
|
213
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
216
|
+
# @param session [String] The sessionId from the user.
|
217
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
218
|
+
# @param expand [PowerShellExpandOption] Gets current output from an ongoing
|
219
|
+
# call. Possible values include: 'output'
|
214
220
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
215
221
|
# to the HTTP request.
|
216
222
|
#
|
217
223
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
218
224
|
#
|
219
|
-
def
|
225
|
+
def get_command_status_async(resource_group_name, node_name, session, pssession, expand = nil, custom_headers = nil)
|
220
226
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
221
227
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
222
228
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
@@ -237,17 +243,17 @@ module Azure::ARM::ServerManagement
|
|
237
243
|
options = {
|
238
244
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
239
245
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession},
|
240
|
-
query_params: {'api-version' => @client.api_version},
|
246
|
+
query_params: {'api-version' => @client.api_version,'$expand' => expand},
|
241
247
|
headers: request_headers.merge(custom_headers || {}),
|
242
248
|
base_url: request_url
|
243
249
|
}
|
244
|
-
promise = @client.make_request_async(:
|
250
|
+
promise = @client.make_request_async(:get, path_template, options)
|
245
251
|
|
246
252
|
promise = promise.then do |result|
|
247
253
|
http_response = result.response
|
248
254
|
status_code = http_response.status
|
249
255
|
response_content = http_response.body
|
250
|
-
unless status_code == 200
|
256
|
+
unless status_code == 200
|
251
257
|
error_model = JSON.load(response_content)
|
252
258
|
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
253
259
|
end
|
@@ -257,7 +263,7 @@ module Azure::ARM::ServerManagement
|
|
257
263
|
if status_code == 200
|
258
264
|
begin
|
259
265
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
260
|
-
result_mapper =
|
266
|
+
result_mapper = PowerShellCommandStatus.mapper()
|
261
267
|
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
262
268
|
rescue Exception => e
|
263
269
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -271,128 +277,118 @@ module Azure::ARM::ServerManagement
|
|
271
277
|
end
|
272
278
|
|
273
279
|
#
|
274
|
-
#
|
280
|
+
# Updates a running PowerShell command with more data.
|
275
281
|
#
|
276
282
|
# @param resource_group_name [String] The resource group name uniquely
|
277
283
|
# identifies the resource group within the user subscriptionId.
|
278
284
|
# @param node_name [String] The node name (256 characters maximum).
|
279
|
-
# @param session [String] The sessionId from the user
|
280
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
281
|
-
# @param expand [PowerShellExpandOption] Gets current output from an ongoing
|
282
|
-
# call. Possible values include: 'output'
|
285
|
+
# @param session [String] The sessionId from the user.
|
286
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
283
287
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
284
288
|
# will be added to the HTTP request.
|
285
289
|
#
|
286
|
-
# @return [
|
290
|
+
# @return [PowerShellCommandResults] operation results.
|
287
291
|
#
|
288
|
-
def
|
289
|
-
response =
|
292
|
+
def update_command(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
293
|
+
response = update_command_async(resource_group_name, node_name, session, pssession, custom_headers).value!
|
290
294
|
response.body unless response.nil?
|
291
295
|
end
|
292
296
|
|
293
|
-
#
|
294
|
-
# Gets the status of a command.
|
295
297
|
#
|
296
298
|
# @param resource_group_name [String] The resource group name uniquely
|
297
299
|
# identifies the resource group within the user subscriptionId.
|
298
300
|
# @param node_name [String] The node name (256 characters maximum).
|
299
|
-
# @param session [String] The sessionId from the user
|
300
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
301
|
-
# @param expand [PowerShellExpandOption] Gets current output from an ongoing
|
302
|
-
# call. Possible values include: 'output'
|
301
|
+
# @param session [String] The sessionId from the user.
|
302
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
303
303
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
304
304
|
# will be added to the HTTP request.
|
305
305
|
#
|
306
|
-
# @return [
|
306
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
307
|
+
# response.
|
307
308
|
#
|
308
|
-
def
|
309
|
-
|
309
|
+
def update_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
310
|
+
# Send request
|
311
|
+
promise = begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers)
|
312
|
+
|
313
|
+
promise = promise.then do |response|
|
314
|
+
# Defining deserialization method.
|
315
|
+
deserialize_method = lambda do |parsed_response|
|
316
|
+
result_mapper = PowerShellCommandResults.mapper()
|
317
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
318
|
+
end
|
319
|
+
|
320
|
+
# Waiting for response.
|
321
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
322
|
+
end
|
323
|
+
|
324
|
+
promise
|
310
325
|
end
|
311
326
|
|
312
327
|
#
|
313
|
-
#
|
328
|
+
# Creates a PowerShell script and invokes it.
|
314
329
|
#
|
315
330
|
# @param resource_group_name [String] The resource group name uniquely
|
316
331
|
# identifies the resource group within the user subscriptionId.
|
317
332
|
# @param node_name [String] The node name (256 characters maximum).
|
318
|
-
# @param session [String] The sessionId from the user
|
319
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
320
|
-
# @param
|
321
|
-
#
|
322
|
-
#
|
323
|
-
# to the HTTP request.
|
333
|
+
# @param session [String] The sessionId from the user.
|
334
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
335
|
+
# @param command [String] Script to execute.
|
336
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
337
|
+
# will be added to the HTTP request.
|
324
338
|
#
|
325
|
-
# @return [
|
339
|
+
# @return [PowerShellCommandResults] operation results.
|
326
340
|
#
|
327
|
-
def
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
fail ArgumentError, 'node_name is nil' if node_name.nil?
|
332
|
-
fail ArgumentError, 'session is nil' if session.nil?
|
333
|
-
fail ArgumentError, 'pssession is nil' if pssession.nil?
|
334
|
-
|
335
|
-
|
336
|
-
request_headers = {}
|
337
|
-
|
338
|
-
# Set Headers
|
339
|
-
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
340
|
-
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
341
|
-
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}'
|
342
|
-
|
343
|
-
request_url = @base_url || @client.base_url
|
344
|
-
|
345
|
-
options = {
|
346
|
-
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
347
|
-
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession},
|
348
|
-
query_params: {'api-version' => @client.api_version,'$expand' => expand},
|
349
|
-
headers: request_headers.merge(custom_headers || {}),
|
350
|
-
base_url: request_url
|
351
|
-
}
|
352
|
-
promise = @client.make_request_async(:get, path_template, options)
|
341
|
+
def invoke_command(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil)
|
342
|
+
response = invoke_command_async(resource_group_name, node_name, session, pssession, command, custom_headers).value!
|
343
|
+
response.body unless response.nil?
|
344
|
+
end
|
353
345
|
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
346
|
+
#
|
347
|
+
# @param resource_group_name [String] The resource group name uniquely
|
348
|
+
# identifies the resource group within the user subscriptionId.
|
349
|
+
# @param node_name [String] The node name (256 characters maximum).
|
350
|
+
# @param session [String] The sessionId from the user.
|
351
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
352
|
+
# @param command [String] Script to execute.
|
353
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
354
|
+
# will be added to the HTTP request.
|
355
|
+
#
|
356
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
357
|
+
# response.
|
358
|
+
#
|
359
|
+
def invoke_command_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil)
|
360
|
+
# Send request
|
361
|
+
promise = begin_invoke_command_async(resource_group_name, node_name, session, pssession, command, custom_headers)
|
362
362
|
|
363
|
-
|
364
|
-
#
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
result_mapper = PowerShellCommandStatus.mapper()
|
369
|
-
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
370
|
-
rescue Exception => e
|
371
|
-
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
372
|
-
end
|
363
|
+
promise = promise.then do |response|
|
364
|
+
# Defining deserialization method.
|
365
|
+
deserialize_method = lambda do |parsed_response|
|
366
|
+
result_mapper = PowerShellCommandResults.mapper()
|
367
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
373
368
|
end
|
374
369
|
|
375
|
-
|
370
|
+
# Waiting for response.
|
371
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
376
372
|
end
|
377
373
|
|
378
|
-
promise
|
374
|
+
promise
|
379
375
|
end
|
380
376
|
|
381
377
|
#
|
382
|
-
#
|
378
|
+
# Cancels a PowerShell command.
|
383
379
|
#
|
384
380
|
# @param resource_group_name [String] The resource group name uniquely
|
385
381
|
# identifies the resource group within the user subscriptionId.
|
386
382
|
# @param node_name [String] The node name (256 characters maximum).
|
387
|
-
# @param session [String] The sessionId from the user
|
388
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
383
|
+
# @param session [String] The sessionId from the user.
|
384
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
389
385
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
390
386
|
# will be added to the HTTP request.
|
391
387
|
#
|
392
388
|
# @return [PowerShellCommandResults] operation results.
|
393
389
|
#
|
394
|
-
def
|
395
|
-
response =
|
390
|
+
def cancel_command(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
391
|
+
response = cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers).value!
|
396
392
|
response.body unless response.nil?
|
397
393
|
end
|
398
394
|
|
@@ -400,17 +396,17 @@ module Azure::ARM::ServerManagement
|
|
400
396
|
# @param resource_group_name [String] The resource group name uniquely
|
401
397
|
# identifies the resource group within the user subscriptionId.
|
402
398
|
# @param node_name [String] The node name (256 characters maximum).
|
403
|
-
# @param session [String] The sessionId from the user
|
404
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
399
|
+
# @param session [String] The sessionId from the user.
|
400
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
405
401
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
406
402
|
# will be added to the HTTP request.
|
407
403
|
#
|
408
404
|
# @return [Concurrent::Promise] promise which provides async access to http
|
409
405
|
# response.
|
410
406
|
#
|
411
|
-
def
|
407
|
+
def cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
412
408
|
# Send request
|
413
|
-
promise =
|
409
|
+
promise = begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers)
|
414
410
|
|
415
411
|
promise = promise.then do |response|
|
416
412
|
# Defining deserialization method.
|
@@ -427,54 +423,57 @@ module Azure::ARM::ServerManagement
|
|
427
423
|
end
|
428
424
|
|
429
425
|
#
|
430
|
-
#
|
426
|
+
# Gets tab completion values for a command.
|
431
427
|
#
|
432
428
|
# @param resource_group_name [String] The resource group name uniquely
|
433
429
|
# identifies the resource group within the user subscriptionId.
|
434
430
|
# @param node_name [String] The node name (256 characters maximum).
|
435
|
-
# @param session [String] The sessionId from the user
|
436
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
431
|
+
# @param session [String] The sessionId from the user.
|
432
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
433
|
+
# @param command [String] Command to get tab completion for.
|
437
434
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
438
435
|
# will be added to the HTTP request.
|
439
436
|
#
|
440
|
-
# @return [
|
437
|
+
# @return [PowerShellTabCompletionResults] operation results.
|
441
438
|
#
|
442
|
-
def
|
443
|
-
response =
|
439
|
+
def tab_completion(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil)
|
440
|
+
response = tab_completion_async(resource_group_name, node_name, session, pssession, command, custom_headers).value!
|
444
441
|
response.body unless response.nil?
|
445
442
|
end
|
446
443
|
|
447
444
|
#
|
448
|
-
#
|
445
|
+
# Gets tab completion values for a command.
|
449
446
|
#
|
450
447
|
# @param resource_group_name [String] The resource group name uniquely
|
451
448
|
# identifies the resource group within the user subscriptionId.
|
452
449
|
# @param node_name [String] The node name (256 characters maximum).
|
453
|
-
# @param session [String] The sessionId from the user
|
454
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
450
|
+
# @param session [String] The sessionId from the user.
|
451
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
452
|
+
# @param command [String] Command to get tab completion for.
|
455
453
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
456
454
|
# will be added to the HTTP request.
|
457
455
|
#
|
458
456
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
459
457
|
#
|
460
|
-
def
|
461
|
-
|
458
|
+
def tab_completion_with_http_info(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil)
|
459
|
+
tab_completion_async(resource_group_name, node_name, session, pssession, command, custom_headers).value!
|
462
460
|
end
|
463
461
|
|
464
462
|
#
|
465
|
-
#
|
463
|
+
# Gets tab completion values for a command.
|
466
464
|
#
|
467
465
|
# @param resource_group_name [String] The resource group name uniquely
|
468
466
|
# identifies the resource group within the user subscriptionId.
|
469
467
|
# @param node_name [String] The node name (256 characters maximum).
|
470
|
-
# @param session [String] The sessionId from the user
|
471
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
468
|
+
# @param session [String] The sessionId from the user.
|
469
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
470
|
+
# @param command [String] Command to get tab completion for.
|
472
471
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
473
472
|
# to the HTTP request.
|
474
473
|
#
|
475
474
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
476
475
|
#
|
477
|
-
def
|
476
|
+
def tab_completion_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil)
|
478
477
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
479
478
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
480
479
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
@@ -482,13 +481,25 @@ module Azure::ARM::ServerManagement
|
|
482
481
|
fail ArgumentError, 'session is nil' if session.nil?
|
483
482
|
fail ArgumentError, 'pssession is nil' if pssession.nil?
|
484
483
|
|
484
|
+
power_shell_tab_completion_paramters = PowerShellTabCompletionParameters.new
|
485
|
+
unless command.nil?
|
486
|
+
power_shell_tab_completion_paramters.command = command
|
487
|
+
end
|
485
488
|
|
486
489
|
request_headers = {}
|
487
490
|
|
488
491
|
# Set Headers
|
489
492
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
490
493
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
491
|
-
|
494
|
+
|
495
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
496
|
+
|
497
|
+
# Serialize Request
|
498
|
+
request_mapper = PowerShellTabCompletionParameters.mapper()
|
499
|
+
request_content = @client.serialize(request_mapper, power_shell_tab_completion_paramters, 'power_shell_tab_completion_paramters')
|
500
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
501
|
+
|
502
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/tab'
|
492
503
|
|
493
504
|
request_url = @base_url || @client.base_url
|
494
505
|
|
@@ -496,16 +507,17 @@ module Azure::ARM::ServerManagement
|
|
496
507
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
497
508
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession},
|
498
509
|
query_params: {'api-version' => @client.api_version},
|
510
|
+
body: request_content,
|
499
511
|
headers: request_headers.merge(custom_headers || {}),
|
500
512
|
base_url: request_url
|
501
513
|
}
|
502
|
-
promise = @client.make_request_async(:
|
514
|
+
promise = @client.make_request_async(:post, path_template, options)
|
503
515
|
|
504
516
|
promise = promise.then do |result|
|
505
517
|
http_response = result.response
|
506
518
|
status_code = http_response.status
|
507
519
|
response_content = http_response.body
|
508
|
-
unless status_code == 200
|
520
|
+
unless status_code == 200
|
509
521
|
error_model = JSON.load(response_content)
|
510
522
|
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
511
523
|
end
|
@@ -515,7 +527,7 @@ module Azure::ARM::ServerManagement
|
|
515
527
|
if status_code == 200
|
516
528
|
begin
|
517
529
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
518
|
-
result_mapper =
|
530
|
+
result_mapper = PowerShellTabCompletionResults.mapper()
|
519
531
|
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
520
532
|
rescue Exception => e
|
521
533
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
@@ -529,107 +541,156 @@ module Azure::ARM::ServerManagement
|
|
529
541
|
end
|
530
542
|
|
531
543
|
#
|
532
|
-
# Creates a PowerShell
|
544
|
+
# Creates a PowerShell session.
|
533
545
|
#
|
534
546
|
# @param resource_group_name [String] The resource group name uniquely
|
535
547
|
# identifies the resource group within the user subscriptionId.
|
536
548
|
# @param node_name [String] The node name (256 characters maximum).
|
537
|
-
# @param session [String] The sessionId from the user
|
538
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
539
|
-
# @param command [String] Script to execute
|
549
|
+
# @param session [String] The sessionId from the user.
|
550
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
540
551
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
541
552
|
# will be added to the HTTP request.
|
542
553
|
#
|
543
|
-
# @return [
|
554
|
+
# @return [PowerShellSessionResource] operation results.
|
544
555
|
#
|
545
|
-
def
|
546
|
-
response =
|
556
|
+
def begin_create_session(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
557
|
+
response = begin_create_session_async(resource_group_name, node_name, session, pssession, custom_headers).value!
|
547
558
|
response.body unless response.nil?
|
548
559
|
end
|
549
560
|
|
561
|
+
#
|
562
|
+
# Creates a PowerShell session.
|
550
563
|
#
|
551
564
|
# @param resource_group_name [String] The resource group name uniquely
|
552
565
|
# identifies the resource group within the user subscriptionId.
|
553
566
|
# @param node_name [String] The node name (256 characters maximum).
|
554
|
-
# @param session [String] The sessionId from the user
|
555
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
556
|
-
# @param command [String] Script to execute
|
567
|
+
# @param session [String] The sessionId from the user.
|
568
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
557
569
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
558
570
|
# will be added to the HTTP request.
|
559
571
|
#
|
560
|
-
# @return [
|
561
|
-
# response.
|
572
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
562
573
|
#
|
563
|
-
def
|
564
|
-
|
565
|
-
|
574
|
+
def begin_create_session_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
575
|
+
begin_create_session_async(resource_group_name, node_name, session, pssession, custom_headers).value!
|
576
|
+
end
|
566
577
|
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
578
|
+
#
|
579
|
+
# Creates a PowerShell session.
|
580
|
+
#
|
581
|
+
# @param resource_group_name [String] The resource group name uniquely
|
582
|
+
# identifies the resource group within the user subscriptionId.
|
583
|
+
# @param node_name [String] The node name (256 characters maximum).
|
584
|
+
# @param session [String] The sessionId from the user.
|
585
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
586
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
587
|
+
# to the HTTP request.
|
588
|
+
#
|
589
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
590
|
+
#
|
591
|
+
def begin_create_session_async(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
592
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
593
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
594
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
595
|
+
fail ArgumentError, 'node_name is nil' if node_name.nil?
|
596
|
+
fail ArgumentError, 'session is nil' if session.nil?
|
597
|
+
fail ArgumentError, 'pssession is nil' if pssession.nil?
|
598
|
+
|
599
|
+
|
600
|
+
request_headers = {}
|
601
|
+
|
602
|
+
# Set Headers
|
603
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
604
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
605
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}'
|
606
|
+
|
607
|
+
request_url = @base_url || @client.base_url
|
608
|
+
|
609
|
+
options = {
|
610
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
611
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession},
|
612
|
+
query_params: {'api-version' => @client.api_version},
|
613
|
+
headers: request_headers.merge(custom_headers || {}),
|
614
|
+
base_url: request_url
|
615
|
+
}
|
616
|
+
promise = @client.make_request_async(:put, path_template, options)
|
617
|
+
|
618
|
+
promise = promise.then do |result|
|
619
|
+
http_response = result.response
|
620
|
+
status_code = http_response.status
|
621
|
+
response_content = http_response.body
|
622
|
+
unless status_code == 200 || status_code == 202
|
623
|
+
error_model = JSON.load(response_content)
|
624
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
572
625
|
end
|
573
626
|
|
574
|
-
|
575
|
-
|
627
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
628
|
+
# Deserialize Response
|
629
|
+
if status_code == 200
|
630
|
+
begin
|
631
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
632
|
+
result_mapper = PowerShellSessionResource.mapper()
|
633
|
+
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
634
|
+
rescue Exception => e
|
635
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
636
|
+
end
|
637
|
+
end
|
638
|
+
|
639
|
+
result
|
576
640
|
end
|
577
641
|
|
578
|
-
promise
|
642
|
+
promise.execute
|
579
643
|
end
|
580
644
|
|
581
645
|
#
|
582
|
-
#
|
646
|
+
# Updates a running PowerShell command with more data.
|
583
647
|
#
|
584
648
|
# @param resource_group_name [String] The resource group name uniquely
|
585
649
|
# identifies the resource group within the user subscriptionId.
|
586
650
|
# @param node_name [String] The node name (256 characters maximum).
|
587
|
-
# @param session [String] The sessionId from the user
|
588
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
589
|
-
# @param command [String] Script to execute
|
651
|
+
# @param session [String] The sessionId from the user.
|
652
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
590
653
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
591
654
|
# will be added to the HTTP request.
|
592
655
|
#
|
593
656
|
# @return [PowerShellCommandResults] operation results.
|
594
657
|
#
|
595
|
-
def
|
596
|
-
response =
|
658
|
+
def begin_update_command(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
659
|
+
response = begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers).value!
|
597
660
|
response.body unless response.nil?
|
598
661
|
end
|
599
662
|
|
600
663
|
#
|
601
|
-
#
|
664
|
+
# Updates a running PowerShell command with more data.
|
602
665
|
#
|
603
666
|
# @param resource_group_name [String] The resource group name uniquely
|
604
667
|
# identifies the resource group within the user subscriptionId.
|
605
668
|
# @param node_name [String] The node name (256 characters maximum).
|
606
|
-
# @param session [String] The sessionId from the user
|
607
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
608
|
-
# @param command [String] Script to execute
|
669
|
+
# @param session [String] The sessionId from the user.
|
670
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
609
671
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
610
672
|
# will be added to the HTTP request.
|
611
673
|
#
|
612
674
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
613
675
|
#
|
614
|
-
def
|
615
|
-
|
676
|
+
def begin_update_command_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
677
|
+
begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers).value!
|
616
678
|
end
|
617
679
|
|
618
680
|
#
|
619
|
-
#
|
681
|
+
# Updates a running PowerShell command with more data.
|
620
682
|
#
|
621
683
|
# @param resource_group_name [String] The resource group name uniquely
|
622
684
|
# identifies the resource group within the user subscriptionId.
|
623
685
|
# @param node_name [String] The node name (256 characters maximum).
|
624
|
-
# @param session [String] The sessionId from the user
|
625
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
626
|
-
# @param command [String] Script to execute
|
686
|
+
# @param session [String] The sessionId from the user.
|
687
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
627
688
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
628
689
|
# to the HTTP request.
|
629
690
|
#
|
630
691
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
631
692
|
#
|
632
|
-
def
|
693
|
+
def begin_update_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
633
694
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
634
695
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
635
696
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
@@ -637,25 +698,13 @@ module Azure::ARM::ServerManagement
|
|
637
698
|
fail ArgumentError, 'session is nil' if session.nil?
|
638
699
|
fail ArgumentError, 'pssession is nil' if pssession.nil?
|
639
700
|
|
640
|
-
power_shell_command_parameters = PowerShellCommandParameters.new
|
641
|
-
unless command.nil?
|
642
|
-
power_shell_command_parameters.command = command
|
643
|
-
end
|
644
701
|
|
645
702
|
request_headers = {}
|
646
703
|
|
647
704
|
# Set Headers
|
648
705
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
649
706
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
650
|
-
|
651
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
652
|
-
|
653
|
-
# Serialize Request
|
654
|
-
request_mapper = PowerShellCommandParameters.mapper()
|
655
|
-
request_content = @client.serialize(request_mapper, power_shell_command_parameters, 'power_shell_command_parameters')
|
656
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
657
|
-
|
658
|
-
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/invokeCommand'
|
707
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}'
|
659
708
|
|
660
709
|
request_url = @base_url || @client.base_url
|
661
710
|
|
@@ -663,11 +712,10 @@ module Azure::ARM::ServerManagement
|
|
663
712
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
664
713
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession},
|
665
714
|
query_params: {'api-version' => @client.api_version},
|
666
|
-
body: request_content,
|
667
715
|
headers: request_headers.merge(custom_headers || {}),
|
668
716
|
base_url: request_url
|
669
717
|
}
|
670
|
-
promise = @client.make_request_async(:
|
718
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
671
719
|
|
672
720
|
promise = promise.then do |result|
|
673
721
|
http_response = result.response
|
@@ -697,102 +745,57 @@ module Azure::ARM::ServerManagement
|
|
697
745
|
end
|
698
746
|
|
699
747
|
#
|
700
|
-
#
|
701
|
-
#
|
702
|
-
# @param resource_group_name [String] The resource group name uniquely
|
703
|
-
# identifies the resource group within the user subscriptionId.
|
704
|
-
# @param node_name [String] The node name (256 characters maximum).
|
705
|
-
# @param session [String] The sessionId from the user
|
706
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
707
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
708
|
-
# will be added to the HTTP request.
|
709
|
-
#
|
710
|
-
# @return [PowerShellCommandResults] operation results.
|
711
|
-
#
|
712
|
-
def cancel_command(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
713
|
-
response = cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers).value!
|
714
|
-
response.body unless response.nil?
|
715
|
-
end
|
716
|
-
|
717
|
-
#
|
718
|
-
# @param resource_group_name [String] The resource group name uniquely
|
719
|
-
# identifies the resource group within the user subscriptionId.
|
720
|
-
# @param node_name [String] The node name (256 characters maximum).
|
721
|
-
# @param session [String] The sessionId from the user
|
722
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
723
|
-
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
724
|
-
# will be added to the HTTP request.
|
725
|
-
#
|
726
|
-
# @return [Concurrent::Promise] promise which provides async access to http
|
727
|
-
# response.
|
728
|
-
#
|
729
|
-
def cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
730
|
-
# Send request
|
731
|
-
promise = begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers)
|
732
|
-
|
733
|
-
promise = promise.then do |response|
|
734
|
-
# Defining deserialization method.
|
735
|
-
deserialize_method = lambda do |parsed_response|
|
736
|
-
result_mapper = PowerShellCommandResults.mapper()
|
737
|
-
parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
|
738
|
-
end
|
739
|
-
|
740
|
-
# Waiting for response.
|
741
|
-
@client.get_long_running_operation_result(response, deserialize_method)
|
742
|
-
end
|
743
|
-
|
744
|
-
promise
|
745
|
-
end
|
746
|
-
|
747
|
-
#
|
748
|
-
# Cancels a PowerShell command.
|
748
|
+
# Creates a PowerShell script and invokes it.
|
749
749
|
#
|
750
750
|
# @param resource_group_name [String] The resource group name uniquely
|
751
751
|
# identifies the resource group within the user subscriptionId.
|
752
752
|
# @param node_name [String] The node name (256 characters maximum).
|
753
|
-
# @param session [String] The sessionId from the user
|
754
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
753
|
+
# @param session [String] The sessionId from the user.
|
754
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
755
|
+
# @param command [String] Script to execute.
|
755
756
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
756
757
|
# will be added to the HTTP request.
|
757
758
|
#
|
758
759
|
# @return [PowerShellCommandResults] operation results.
|
759
760
|
#
|
760
|
-
def
|
761
|
-
response =
|
761
|
+
def begin_invoke_command(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil)
|
762
|
+
response = begin_invoke_command_async(resource_group_name, node_name, session, pssession, command, custom_headers).value!
|
762
763
|
response.body unless response.nil?
|
763
764
|
end
|
764
765
|
|
765
766
|
#
|
766
|
-
#
|
767
|
+
# Creates a PowerShell script and invokes it.
|
767
768
|
#
|
768
769
|
# @param resource_group_name [String] The resource group name uniquely
|
769
770
|
# identifies the resource group within the user subscriptionId.
|
770
771
|
# @param node_name [String] The node name (256 characters maximum).
|
771
|
-
# @param session [String] The sessionId from the user
|
772
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
772
|
+
# @param session [String] The sessionId from the user.
|
773
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
774
|
+
# @param command [String] Script to execute.
|
773
775
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
774
776
|
# will be added to the HTTP request.
|
775
777
|
#
|
776
778
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
777
779
|
#
|
778
|
-
def
|
779
|
-
|
780
|
+
def begin_invoke_command_with_http_info(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil)
|
781
|
+
begin_invoke_command_async(resource_group_name, node_name, session, pssession, command, custom_headers).value!
|
780
782
|
end
|
781
783
|
|
782
784
|
#
|
783
|
-
#
|
785
|
+
# Creates a PowerShell script and invokes it.
|
784
786
|
#
|
785
787
|
# @param resource_group_name [String] The resource group name uniquely
|
786
788
|
# identifies the resource group within the user subscriptionId.
|
787
789
|
# @param node_name [String] The node name (256 characters maximum).
|
788
|
-
# @param session [String] The sessionId from the user
|
789
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
790
|
+
# @param session [String] The sessionId from the user.
|
791
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
792
|
+
# @param command [String] Script to execute.
|
790
793
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
791
794
|
# to the HTTP request.
|
792
795
|
#
|
793
796
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
794
797
|
#
|
795
|
-
def
|
798
|
+
def begin_invoke_command_async(resource_group_name, node_name, session, pssession, command = nil, custom_headers = nil)
|
796
799
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
797
800
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
798
801
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
@@ -800,13 +803,25 @@ module Azure::ARM::ServerManagement
|
|
800
803
|
fail ArgumentError, 'session is nil' if session.nil?
|
801
804
|
fail ArgumentError, 'pssession is nil' if pssession.nil?
|
802
805
|
|
806
|
+
power_shell_command_parameters = PowerShellCommandParameters.new
|
807
|
+
unless command.nil?
|
808
|
+
power_shell_command_parameters.command = command
|
809
|
+
end
|
803
810
|
|
804
811
|
request_headers = {}
|
805
812
|
|
806
813
|
# Set Headers
|
807
814
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
808
815
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
809
|
-
|
816
|
+
|
817
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
818
|
+
|
819
|
+
# Serialize Request
|
820
|
+
request_mapper = PowerShellCommandParameters.mapper()
|
821
|
+
request_content = @client.serialize(request_mapper, power_shell_command_parameters, 'power_shell_command_parameters')
|
822
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
823
|
+
|
824
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/invokeCommand'
|
810
825
|
|
811
826
|
request_url = @base_url || @client.base_url
|
812
827
|
|
@@ -814,6 +829,7 @@ module Azure::ARM::ServerManagement
|
|
814
829
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
815
830
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession},
|
816
831
|
query_params: {'api-version' => @client.api_version},
|
832
|
+
body: request_content,
|
817
833
|
headers: request_headers.merge(custom_headers || {}),
|
818
834
|
base_url: request_url
|
819
835
|
}
|
@@ -847,57 +863,54 @@ module Azure::ARM::ServerManagement
|
|
847
863
|
end
|
848
864
|
|
849
865
|
#
|
850
|
-
#
|
866
|
+
# Cancels a PowerShell command.
|
851
867
|
#
|
852
868
|
# @param resource_group_name [String] The resource group name uniquely
|
853
869
|
# identifies the resource group within the user subscriptionId.
|
854
870
|
# @param node_name [String] The node name (256 characters maximum).
|
855
|
-
# @param session [String] The sessionId from the user
|
856
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
857
|
-
# @param command [String] Command to get tab completion for.
|
871
|
+
# @param session [String] The sessionId from the user.
|
872
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
858
873
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
859
874
|
# will be added to the HTTP request.
|
860
875
|
#
|
861
|
-
# @return [
|
876
|
+
# @return [PowerShellCommandResults] operation results.
|
862
877
|
#
|
863
|
-
def
|
864
|
-
response =
|
878
|
+
def begin_cancel_command(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
879
|
+
response = begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers).value!
|
865
880
|
response.body unless response.nil?
|
866
881
|
end
|
867
882
|
|
868
883
|
#
|
869
|
-
#
|
884
|
+
# Cancels a PowerShell command.
|
870
885
|
#
|
871
886
|
# @param resource_group_name [String] The resource group name uniquely
|
872
887
|
# identifies the resource group within the user subscriptionId.
|
873
888
|
# @param node_name [String] The node name (256 characters maximum).
|
874
|
-
# @param session [String] The sessionId from the user
|
875
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
876
|
-
# @param command [String] Command to get tab completion for.
|
889
|
+
# @param session [String] The sessionId from the user.
|
890
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
877
891
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
878
892
|
# will be added to the HTTP request.
|
879
893
|
#
|
880
894
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
881
895
|
#
|
882
|
-
def
|
883
|
-
|
896
|
+
def begin_cancel_command_with_http_info(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
897
|
+
begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers).value!
|
884
898
|
end
|
885
899
|
|
886
900
|
#
|
887
|
-
#
|
901
|
+
# Cancels a PowerShell command.
|
888
902
|
#
|
889
903
|
# @param resource_group_name [String] The resource group name uniquely
|
890
904
|
# identifies the resource group within the user subscriptionId.
|
891
905
|
# @param node_name [String] The node name (256 characters maximum).
|
892
|
-
# @param session [String] The sessionId from the user
|
893
|
-
# @param pssession [String] The PowerShell sessionId from the user
|
894
|
-
# @param command [String] Command to get tab completion for.
|
906
|
+
# @param session [String] The sessionId from the user.
|
907
|
+
# @param pssession [String] The PowerShell sessionId from the user.
|
895
908
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
896
909
|
# to the HTTP request.
|
897
910
|
#
|
898
911
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
899
912
|
#
|
900
|
-
def
|
913
|
+
def begin_cancel_command_async(resource_group_name, node_name, session, pssession, custom_headers = nil)
|
901
914
|
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
902
915
|
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
903
916
|
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
@@ -905,25 +918,13 @@ module Azure::ARM::ServerManagement
|
|
905
918
|
fail ArgumentError, 'session is nil' if session.nil?
|
906
919
|
fail ArgumentError, 'pssession is nil' if pssession.nil?
|
907
920
|
|
908
|
-
power_shell_tab_completion_paramters = PowerShellTabCompletionParameters.new
|
909
|
-
unless command.nil?
|
910
|
-
power_shell_tab_completion_paramters.command = command
|
911
|
-
end
|
912
921
|
|
913
922
|
request_headers = {}
|
914
923
|
|
915
924
|
# Set Headers
|
916
925
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
917
926
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
918
|
-
|
919
|
-
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
920
|
-
|
921
|
-
# Serialize Request
|
922
|
-
request_mapper = PowerShellTabCompletionParameters.mapper()
|
923
|
-
request_content = @client.serialize(request_mapper, power_shell_tab_completion_paramters, 'power_shell_tab_completion_paramters')
|
924
|
-
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
925
|
-
|
926
|
-
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/tab'
|
927
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/nodes/{nodeName}/sessions/{session}/features/powerShellConsole/pssessions/{pssession}/cancel'
|
927
928
|
|
928
929
|
request_url = @base_url || @client.base_url
|
929
930
|
|
@@ -931,7 +932,6 @@ module Azure::ARM::ServerManagement
|
|
931
932
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
932
933
|
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'nodeName' => node_name,'session' => session,'pssession' => pssession},
|
933
934
|
query_params: {'api-version' => @client.api_version},
|
934
|
-
body: request_content,
|
935
935
|
headers: request_headers.merge(custom_headers || {}),
|
936
936
|
base_url: request_url
|
937
937
|
}
|
@@ -941,7 +941,7 @@ module Azure::ARM::ServerManagement
|
|
941
941
|
http_response = result.response
|
942
942
|
status_code = http_response.status
|
943
943
|
response_content = http_response.body
|
944
|
-
unless status_code == 200
|
944
|
+
unless status_code == 200 || status_code == 202
|
945
945
|
error_model = JSON.load(response_content)
|
946
946
|
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
947
947
|
end
|
@@ -951,7 +951,7 @@ module Azure::ARM::ServerManagement
|
|
951
951
|
if status_code == 200
|
952
952
|
begin
|
953
953
|
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
954
|
-
result_mapper =
|
954
|
+
result_mapper = PowerShellCommandResults.mapper()
|
955
955
|
result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
|
956
956
|
rescue Exception => e
|
957
957
|
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|