Class: DaytonaToolboxApiClient::ProcessApi

Inherits:
Object
  • Object
show all
Defined in:
lib/daytona_toolbox_api_client/api/process_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ProcessApi

Returns a new instance of ProcessApi.



19
20
21
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#code_run(request, opts = {}) ⇒ CodeRunResponse

Execute code Execute Python, JavaScript, or TypeScript code and return output, exit code, and artifacts

Parameters:

  • request (CodeRunRequest)

    Code execution request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 27

def code_run(request, opts = {})
  data, _status_code, _headers = code_run_with_http_info(request, opts)
  data
end

#code_run_with_http_info(request, opts = {}) ⇒ Array<(CodeRunResponse, Integer, Hash)>

Execute code Execute Python, JavaScript, or TypeScript code and return output, exit code, and artifacts

Parameters:

  • request (CodeRunRequest)

    Code execution request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CodeRunResponse, Integer, Hash)>)

    CodeRunResponse data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 37

def code_run_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.code_run ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.code_run"
  end
  # resource path
  local_var_path = '/process/code-run'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

  # return_type
  return_type = opts[:debug_return_type] || 'CodeRunResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.code_run",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#code_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#connect_pty_session(session_id, opts = {}) ⇒ nil

Connect to PTY session via WebSocket Establish a WebSocket connection to interact with a pseudo-terminal session

Parameters:

  • session_id (String)

    PTY session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


95
96
97
98
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 95

def connect_pty_session(session_id, opts = {})
  connect_pty_session_with_http_info(session_id, opts)
  nil
end

#connect_pty_session_with_http_info(session_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Connect to PTY session via WebSocket Establish a WebSocket connection to interact with a pseudo-terminal session

Parameters:

  • session_id (String)

    PTY session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 105

def connect_pty_session_with_http_info(session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.connect_pty_session ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.connect_pty_session"
  end
  # resource path
  local_var_path = '/process/pty/{sessionId}/connect'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.connect_pty_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#connect_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_pty_session(request, opts = {}) ⇒ PtyCreateResponse

Create a new PTY session Create a new pseudo-terminal session with specified configuration

Parameters:

  • request (PtyCreateRequest)

    PTY session creation request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



158
159
160
161
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 158

def create_pty_session(request, opts = {})
  data, _status_code, _headers = create_pty_session_with_http_info(request, opts)
  data
end

#create_pty_session_with_http_info(request, opts = {}) ⇒ Array<(PtyCreateResponse, Integer, Hash)>

Create a new PTY session Create a new pseudo-terminal session with specified configuration

Parameters:

  • request (PtyCreateRequest)

    PTY session creation request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PtyCreateResponse, Integer, Hash)>)

    PtyCreateResponse data, response status code and response headers



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 168

def create_pty_session_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.create_pty_session ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.create_pty_session"
  end
  # resource path
  local_var_path = '/process/pty'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

  # return_type
  return_type = opts[:debug_return_type] || 'PtyCreateResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.create_pty_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#create_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_session(request, opts = {}) ⇒ nil

Create a new session Create a new shell session for command execution

Parameters:

  • request (CreateSessionRequest)

    Session creation request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


226
227
228
229
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 226

def create_session(request, opts = {})
  create_session_with_http_info(request, opts)
  nil
end

#create_session_with_http_info(request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Create a new session Create a new shell session for command execution

Parameters:

  • request (CreateSessionRequest)

    Session creation request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 236

def create_session_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.create_session ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.create_session"
  end
  # resource path
  local_var_path = '/process/session'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.create_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#create_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_pty_session(session_id, opts = {}) ⇒ Hash<String, Object>

Delete a PTY session Delete a pseudo-terminal session and terminate its process

Parameters:

  • session_id (String)

    PTY session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Hash<String, Object>)


294
295
296
297
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 294

def delete_pty_session(session_id, opts = {})
  data, _status_code, _headers = delete_pty_session_with_http_info(session_id, opts)
  data
end

#delete_pty_session_with_http_info(session_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Delete a PTY session Delete a pseudo-terminal session and terminate its process

Parameters:

  • session_id (String)

    PTY session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>)

    Hash<String, Object> data, response status code and response headers



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 304

def delete_pty_session_with_http_info(session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.delete_pty_session ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.delete_pty_session"
  end
  # resource path
  local_var_path = '/process/pty/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.delete_pty_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#delete_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_session(session_id, opts = {}) ⇒ nil

Delete a session Delete an existing shell session

Parameters:

  • session_id (String)

    Session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


357
358
359
360
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 357

def delete_session(session_id, opts = {})
  delete_session_with_http_info(session_id, opts)
  nil
end

#delete_session_with_http_info(session_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a session Delete an existing shell session

Parameters:

  • session_id (String)

    Session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 367

def delete_session_with_http_info(session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.delete_session ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.delete_session"
  end
  # resource path
  local_var_path = '/process/session/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.delete_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#delete_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#execute_command(request, opts = {}) ⇒ ExecuteResponse

Execute a command Execute a shell command and return the output and exit code

Parameters:

  • request (ExecuteRequest)

    Command execution request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



420
421
422
423
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 420

def execute_command(request, opts = {})
  data, _status_code, _headers = execute_command_with_http_info(request, opts)
  data
end

#execute_command_with_http_info(request, opts = {}) ⇒ Array<(ExecuteResponse, Integer, Hash)>

Execute a command Execute a shell command and return the output and exit code

Parameters:

  • request (ExecuteRequest)

    Command execution request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ExecuteResponse, Integer, Hash)>)

    ExecuteResponse data, response status code and response headers



430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 430

def execute_command_with_http_info(request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.execute_command ...'
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.execute_command"
  end
  # resource path
  local_var_path = '/process/execute'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

  # return_type
  return_type = opts[:debug_return_type] || 'ExecuteResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.execute_command",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#execute_command\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_entrypoint_logs(opts = {}) ⇒ SessionCommandLogsResponse

Get entrypoint logs Get logs for a sandbox entrypoint session. Returns JSON with separated stdout/stderr for SDK >= 0.161.0, plain text otherwise. Supports WebSocket streaming.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :follow (Boolean)

    Follow logs in real-time (WebSocket only)

Returns:



488
489
490
491
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 488

def get_entrypoint_logs(opts = {})
  data, _status_code, _headers = get_entrypoint_logs_with_http_info(opts)
  data
end

#get_entrypoint_logs_with_http_info(opts = {}) ⇒ Array<(SessionCommandLogsResponse, Integer, Hash)>

Get entrypoint logs Get logs for a sandbox entrypoint session. Returns JSON with separated stdout/stderr for SDK &gt;&#x3D; 0.161.0, plain text otherwise. Supports WebSocket streaming.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :follow (Boolean)

    Follow logs in real-time (WebSocket only)

Returns:

  • (Array<(SessionCommandLogsResponse, Integer, Hash)>)

    SessionCommandLogsResponse data, response status code and response headers



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
540
541
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 498

def get_entrypoint_logs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.get_entrypoint_logs ...'
  end
  # resource path
  local_var_path = '/process/session/entrypoint/logs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'follow'] = opts[:'follow'] if !opts[:'follow'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SessionCommandLogsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.get_entrypoint_logs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#get_entrypoint_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_entrypoint_session(opts = {}) ⇒ Session

Get entrypoint session details Get details of an entrypoint session including its commands

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



547
548
549
550
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 547

def get_entrypoint_session(opts = {})
  data, _status_code, _headers = get_entrypoint_session_with_http_info(opts)
  data
end

#get_entrypoint_session_with_http_info(opts = {}) ⇒ Array<(Session, Integer, Hash)>

Get entrypoint session details Get details of an entrypoint session including its commands

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Session, Integer, Hash)>)

    Session data, response status code and response headers



556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 556

def get_entrypoint_session_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.get_entrypoint_session ...'
  end
  # resource path
  local_var_path = '/process/session/entrypoint'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Session'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.get_entrypoint_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#get_entrypoint_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_pty_session(session_id, opts = {}) ⇒ PtySessionInfo

Get PTY session information Get detailed information about a specific pseudo-terminal session

Parameters:

  • session_id (String)

    PTY session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



605
606
607
608
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 605

def get_pty_session(session_id, opts = {})
  data, _status_code, _headers = get_pty_session_with_http_info(session_id, opts)
  data
end

#get_pty_session_with_http_info(session_id, opts = {}) ⇒ Array<(PtySessionInfo, Integer, Hash)>

Get PTY session information Get detailed information about a specific pseudo-terminal session

Parameters:

  • session_id (String)

    PTY session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PtySessionInfo, Integer, Hash)>)

    PtySessionInfo data, response status code and response headers



615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 615

def get_pty_session_with_http_info(session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.get_pty_session ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.get_pty_session"
  end
  # resource path
  local_var_path = '/process/pty/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PtySessionInfo'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.get_pty_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#get_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_session(session_id, opts = {}) ⇒ Session

Get session details Get details of a specific session including its commands

Parameters:

  • session_id (String)

    Session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



668
669
670
671
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 668

def get_session(session_id, opts = {})
  data, _status_code, _headers = get_session_with_http_info(session_id, opts)
  data
end

#get_session_command(session_id, command_id, opts = {}) ⇒ Command

Get session command details Get details of a specific command within a session

Parameters:

  • session_id (String)

    Session ID

  • command_id (String)

    Command ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



732
733
734
735
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 732

def get_session_command(session_id, command_id, opts = {})
  data, _status_code, _headers = get_session_command_with_http_info(session_id, command_id, opts)
  data
end

#get_session_command_logs(session_id, command_id, opts = {}) ⇒ SessionCommandLogsResponse

Get session command logs Get logs for a specific command within a session. Returns JSON with separated stdout/stderr for SDK >= 0.167.0, plain text otherwise. Supports WebSocket streaming.

Parameters:

  • session_id (String)

    Session ID

  • command_id (String)

    Command ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :follow (Boolean)

    Follow logs in real-time (WebSocket only)

Returns:



802
803
804
805
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 802

def get_session_command_logs(session_id, command_id, opts = {})
  data, _status_code, _headers = get_session_command_logs_with_http_info(session_id, command_id, opts)
  data
end

#get_session_command_logs_with_http_info(session_id, command_id, opts = {}) ⇒ Array<(SessionCommandLogsResponse, Integer, Hash)>

Get session command logs Get logs for a specific command within a session. Returns JSON with separated stdout/stderr for SDK &gt;&#x3D; 0.167.0, plain text otherwise. Supports WebSocket streaming.

Parameters:

  • session_id (String)

    Session ID

  • command_id (String)

    Command ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :follow (Boolean)

    Follow logs in real-time (WebSocket only)

Returns:

  • (Array<(SessionCommandLogsResponse, Integer, Hash)>)

    SessionCommandLogsResponse data, response status code and response headers



814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 814

def get_session_command_logs_with_http_info(session_id, command_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.get_session_command_logs ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.get_session_command_logs"
  end
  # verify the required parameter 'command_id' is set
  if @api_client.config.client_side_validation && command_id.nil?
    fail ArgumentError, "Missing the required parameter 'command_id' when calling ProcessApi.get_session_command_logs"
  end
  # resource path
  local_var_path = '/process/session/{sessionId}/command/{commandId}/logs'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'commandId' + '}', CGI.escape(command_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'follow'] = opts[:'follow'] if !opts[:'follow'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SessionCommandLogsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.get_session_command_logs",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#get_session_command_logs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_session_command_with_http_info(session_id, command_id, opts = {}) ⇒ Array<(Command, Integer, Hash)>

Get session command details Get details of a specific command within a session

Parameters:

  • session_id (String)

    Session ID

  • command_id (String)

    Command ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Command, Integer, Hash)>)

    Command data, response status code and response headers



743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 743

def get_session_command_with_http_info(session_id, command_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.get_session_command ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.get_session_command"
  end
  # verify the required parameter 'command_id' is set
  if @api_client.config.client_side_validation && command_id.nil?
    fail ArgumentError, "Missing the required parameter 'command_id' when calling ProcessApi.get_session_command"
  end
  # resource path
  local_var_path = '/process/session/{sessionId}/command/{commandId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'commandId' + '}', CGI.escape(command_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Command'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.get_session_command",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#get_session_command\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_session_with_http_info(session_id, opts = {}) ⇒ Array<(Session, Integer, Hash)>

Get session details Get details of a specific session including its commands

Parameters:

  • session_id (String)

    Session ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Session, Integer, Hash)>)

    Session data, response status code and response headers



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
717
718
719
720
721
722
723
724
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 678

def get_session_with_http_info(session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.get_session ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.get_session"
  end
  # resource path
  local_var_path = '/process/session/{sessionId}'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Session'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.get_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#get_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_pty_sessions(opts = {}) ⇒ PtyListResponse

List all PTY sessions Get a list of all active pseudo-terminal sessions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



871
872
873
874
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 871

def list_pty_sessions(opts = {})
  data, _status_code, _headers = list_pty_sessions_with_http_info(opts)
  data
end

#list_pty_sessions_with_http_info(opts = {}) ⇒ Array<(PtyListResponse, Integer, Hash)>

List all PTY sessions Get a list of all active pseudo-terminal sessions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PtyListResponse, Integer, Hash)>)

    PtyListResponse data, response status code and response headers



880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 880

def list_pty_sessions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.list_pty_sessions ...'
  end
  # resource path
  local_var_path = '/process/pty'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PtyListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.list_pty_sessions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#list_pty_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_sessions(opts = {}) ⇒ Array<Session>

List all sessions Get a list of all active shell sessions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



928
929
930
931
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 928

def list_sessions(opts = {})
  data, _status_code, _headers = list_sessions_with_http_info(opts)
  data
end

#list_sessions_with_http_info(opts = {}) ⇒ Array<(Array<Session>, Integer, Hash)>

List all sessions Get a list of all active shell sessions

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<Session>, Integer, Hash)>)

    Array<Session> data, response status code and response headers



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 937

def list_sessions_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.list_sessions ...'
  end
  # resource path
  local_var_path = '/process/session'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Session>'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.list_sessions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#list_sessions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#resize_pty_session(session_id, request, opts = {}) ⇒ PtySessionInfo

Resize a PTY session Resize the terminal dimensions of a pseudo-terminal session

Parameters:

  • session_id (String)

    PTY session ID

  • request (PtyResizeRequest)

    Resize request with new dimensions

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



987
988
989
990
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 987

def resize_pty_session(session_id, request, opts = {})
  data, _status_code, _headers = resize_pty_session_with_http_info(session_id, request, opts)
  data
end

#resize_pty_session_with_http_info(session_id, request, opts = {}) ⇒ Array<(PtySessionInfo, Integer, Hash)>

Resize a PTY session Resize the terminal dimensions of a pseudo-terminal session

Parameters:

  • session_id (String)

    PTY session ID

  • request (PtyResizeRequest)

    Resize request with new dimensions

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PtySessionInfo, Integer, Hash)>)

    PtySessionInfo data, response status code and response headers



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
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 998

def resize_pty_session_with_http_info(session_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.resize_pty_session ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.resize_pty_session"
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.resize_pty_session"
  end
  # resource path
  local_var_path = '/process/pty/{sessionId}/resize'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

  # return_type
  return_type = opts[:debug_return_type] || 'PtySessionInfo'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.resize_pty_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#resize_pty_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_input(session_id, command_id, request, opts = {}) ⇒ nil

Send input to command Send input data to a running command in a session for interactive execution

Parameters:

  • session_id (String)

    Session ID

  • command_id (String)

    Command ID

  • request (SessionSendInputRequest)

    Input send request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


1062
1063
1064
1065
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 1062

def send_input(session_id, command_id, request, opts = {})
  send_input_with_http_info(session_id, command_id, request, opts)
  nil
end

#send_input_with_http_info(session_id, command_id, request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Send input to command Send input data to a running command in a session for interactive execution

Parameters:

  • session_id (String)

    Session ID

  • command_id (String)

    Command ID

  • request (SessionSendInputRequest)

    Input send request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
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
1129
1130
1131
1132
1133
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 1074

def send_input_with_http_info(session_id, command_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.send_input ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.send_input"
  end
  # verify the required parameter 'command_id' is set
  if @api_client.config.client_side_validation && command_id.nil?
    fail ArgumentError, "Missing the required parameter 'command_id' when calling ProcessApi.send_input"
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.send_input"
  end
  # resource path
  local_var_path = '/process/session/{sessionId}/command/{commandId}/input'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s)).sub('{' + 'commandId' + '}', CGI.escape(command_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['*/*']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.send_input",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#send_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#session_execute_command(session_id, request, opts = {}) ⇒ SessionExecuteResponse

Execute command in session Execute a command within an existing shell session

Parameters:

  • session_id (String)

    Session ID

  • request (SessionExecuteRequest)

    Command execution request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1141
1142
1143
1144
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 1141

def session_execute_command(session_id, request, opts = {})
  data, _status_code, _headers = session_execute_command_with_http_info(session_id, request, opts)
  data
end

#session_execute_command_with_http_info(session_id, request, opts = {}) ⇒ Array<(SessionExecuteResponse, Integer, Hash)>

Execute command in session Execute a command within an existing shell session

Parameters:

  • session_id (String)

    Session ID

  • request (SessionExecuteRequest)

    Command execution request

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SessionExecuteResponse, Integer, Hash)>)

    SessionExecuteResponse data, response status code and response headers



1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
# File 'lib/daytona_toolbox_api_client/api/process_api.rb', line 1152

def session_execute_command_with_http_info(session_id, request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ProcessApi.session_execute_command ...'
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling ProcessApi.session_execute_command"
  end
  # verify the required parameter 'request' is set
  if @api_client.config.client_side_validation && request.nil?
    fail ArgumentError, "Missing the required parameter 'request' when calling ProcessApi.session_execute_command"
  end
  # resource path
  local_var_path = '/process/session/{sessionId}/exec'.sub('{' + 'sessionId' + '}', CGI.escape(session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(request)

  # return_type
  return_type = opts[:debug_return_type] || 'SessionExecuteResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ProcessApi.session_execute_command",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ProcessApi#session_execute_command\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end