Class: Cerca::Resources::Sandbox
- Inherits:
-
Object
- Object
- Cerca::Resources::Sandbox
- Defined in:
- lib/cerca/resources/sandbox.rb
Instance Method Summary collapse
-
#exec_(agent_id, command:, max_buffer: nil, execution_timeout: nil, workdir: nil, request_options: {}) ⇒ Cerca::Models::ExecResult
Execute sandbox command.
-
#initialize(client:) ⇒ Sandbox
constructor
private
A new instance of Sandbox.
-
#read(agent_id, path:, limit: nil, offset: nil, request_options: {}) ⇒ Cerca::Models::ReadResponse
Read sandbox file.
-
#write(agent_id, content:, path:, request_options: {}) ⇒ Cerca::Models::SandboxWriteResponse
Write sandbox file.
Constructor Details
#initialize(client:) ⇒ Sandbox
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Sandbox.
86 87 88 |
# File 'lib/cerca/resources/sandbox.rb', line 86 def initialize(client:) @client = client end |
Instance Method Details
#exec_(agent_id, command:, max_buffer: nil, execution_timeout: nil, workdir: nil, request_options: {}) ⇒ Cerca::Models::ExecResult
Execute sandbox command
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/cerca/resources/sandbox.rb', line 25 def exec_(agent_id, params) parsed, = Cerca::SandboxExecParams.dump_request(params) @client.request( method: :post, path: ["agents/%1$s/sandbox/exec", agent_id], body: parsed, model: Cerca::ExecResult, options: ) end |
#read(agent_id, path:, limit: nil, offset: nil, request_options: {}) ⇒ Cerca::Models::ReadResponse
Read sandbox file
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cerca/resources/sandbox.rb', line 49 def read(agent_id, params) parsed, = Cerca::SandboxReadParams.dump_request(params) @client.request( method: :post, path: ["agents/%1$s/sandbox/read", agent_id], body: parsed, model: Cerca::ReadResponse, options: ) end |
#write(agent_id, content:, path:, request_options: {}) ⇒ Cerca::Models::SandboxWriteResponse
Write sandbox file
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/cerca/resources/sandbox.rb', line 72 def write(agent_id, params) parsed, = Cerca::SandboxWriteParams.dump_request(params) @client.request( method: :post, path: ["agents/%1$s/sandbox/write", agent_id], body: parsed, model: Cerca::Models::SandboxWriteResponse, options: ) end |