Class: Qubole::Command
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Qubole::Command
- Defined in:
- lib/qubole/command.rb
Direct Known Subclasses
Qubole::Commands::Composite, Qubole::Commands::DbExport, Qubole::Commands::DbImport, Qubole::Commands::DbTapQuery, Qubole::Commands::Hadoop, Qubole::Commands::Hive, Qubole::Commands::Pig, Qubole::Commands::Presto, Qubole::Commands::Shell, Qubole::Commands::Spark
Class Method Summary collapse
-
.find(id) ⇒ Command
Find command by id.
-
.page(page, opts = {}) ⇒ Array<Command>
Paginated commands history.
Instance Method Summary collapse
-
#cancel ⇒ Object
Cancel command.
-
#jobs ⇒ Hash
Hadoop jobs spawned by command.
-
#logs ⇒ String
Fetch command logs.
-
#parse(attrs) ⇒ Command
Update command attributes.
-
#refresh! ⇒ Command
Refresh command attributes.
-
#results ⇒ Hash
Fetch command results.
-
#submit(params = {}) ⇒ Command
Submit command to Qubole.
Class Method Details
Instance Method Details
#cancel ⇒ Object
Cancel command
87 88 89 |
# File 'lib/qubole/command.rb', line 87 def cancel Qubole.put("/commands/#{id}") end |
#jobs ⇒ Hash
Hadoop jobs spawned by command
80 81 82 |
# File 'lib/qubole/command.rb', line 80 def jobs Qubole.get("/commands/#{id}/jobs") end |
#logs ⇒ String
Fetch command logs
72 73 74 |
# File 'lib/qubole/command.rb', line 72 def logs Qubole.get("/commands/#{id}/logs") end |
#parse(attrs) ⇒ Command
Update command attributes
34 35 36 37 38 |
# File 'lib/qubole/command.rb', line 34 def parse(attrs) attrs.each do |key, value| send("#{key}=", value) end end |
#refresh! ⇒ Command
Refresh command attributes
55 56 57 58 |
# File 'lib/qubole/command.rb', line 55 def refresh! command = Qubole.get("/commands/#{id}") parse(command) end |
#results ⇒ Hash
Fetch command results
64 65 66 |
# File 'lib/qubole/command.rb', line 64 def results Qubole.get("/commands/#{id}/results") end |