Class: Qubole::Cluster

Inherits:
Object
  • Object
show all
Defined in:
lib/qubole/cluster.rb

Overview

To look for what all parameters need to be passed go to docs.qubole.com/en/latest/rest-api/cluster_api/ Pass the params as hash from above doc link

Class Method Summary collapse

Class Method Details

.add_node(id, params = {}) ⇒ Object

Add a node to an existing cluster docs.qubole.com/en/latest/rest-api/cluster_api/add-node.html Assign id/label of cluster to id.



87
88
89
# File 'lib/qubole/cluster.rb', line 87

def self.add_node(id, params={})
  Qubole.post("/clusters/#{id}/nodes", params)
end

.clone(id, params = {}) ⇒ Object

Clone the cluster with id/label ‘cluster_id_label` using information provided in `cluster_info`. Assign id/label of cluster to id



31
32
33
# File 'lib/qubole/cluster.rb', line 31

def self.clone(id, params={})
  Qubole.post("/clusters/#{id}/clone", params)
end

.create(params = {}) ⇒ Object



19
20
21
# File 'lib/qubole/cluster.rb', line 19

def self.create(params={})
 Qubole.post("/clusters", params)
end

.delete(id) ⇒ Object

Delete the cluster with id/label.



53
54
55
# File 'lib/qubole/cluster.rb', line 53

def self.delete(id)
  Qubole.delete("/clusters/#{id}")
end

.get_snapshot_schedule(id) ⇒ Object

Get details for snapshot schedule



114
115
116
# File 'lib/qubole/cluster.rb', line 114

def self.get_snapshot_schedule(id)
  Qubole.get("/clusters/#{id}/snapshot_schedule")
end

.listObject

List existing clusters present in your account.



8
9
10
# File 'lib/qubole/cluster.rb', line 8

def self.list
  Qubole.get("/clusters")
end

.metrics(id, params = {}) ⇒ Object

To look for cluster metrics docs.qubole.com/en/latest/rest-api/cluster_api/metrics-cluster.html Assign id/label of cluster to id.



73
74
75
# File 'lib/qubole/cluster.rb', line 73

def self.metrics(id, params={})
  Qubole.get("/clusters/#{id}/metrics", params)
end

.reassign_label(params = {}) ⇒ Object



59
60
61
# File 'lib/qubole/cluster.rb', line 59

def self.reassign_label(params={})
  Qubole.put("/clusters/reassign-label", params)
end

.remove_node(id, params = {}) ⇒ Object

Removes a slave node from a cluster docs.qubole.com/en/latest/rest-api/cluster_api/remove-node.html#parameters Assign id/label of cluster to id



102
103
104
# File 'lib/qubole/cluster.rb', line 102

def self.remove_node(id, params={})
  Qubole.delete("/clusters/#{id}/nodes", params)
end

.replace_node(id, params = {}) ⇒ Object

Replaces a slave node in a cluster docs.qubole.com/en/latest/rest-api/cluster_api/replace-node.html Assign id/label of cluster to id.



94
95
96
97
# File 'lib/qubole/cluster.rb', line 94

def self.replace_node(id, params={})
  params["command"] = "replace"
  Qubole.put("/clusters/#{id}/nodes", params)
end

.resize(id, params = {}) ⇒ Object

To change the minimum and maximum size of a running cluster docs.qubole.com/en/latest/rest-api/cluster_api/resize-cluster.html Assign id/label of cluster to id.



80
81
82
# File 'lib/qubole/cluster.rb', line 80

def self.resize(id, params={})
  Qubole.put("/clusters/#{id}",params)
end

.restore_point(id, params = {}) ⇒ Object

Restoring cluster from a given hbase snapshot id docs.qubole.com/en/latest/rest-api/cluster_api/restore-point.html#parameters Assign id/label of cluster to id



121
122
123
# File 'lib/qubole/cluster.rb', line 121

def self.restore_point(id, params={})
  Qubole.post("/clusters/#{id}/restore_point", params)
end

.run_script(id, params = {}) ⇒ Object

Run an adhoc script docs.qubole.com/en/latest/rest-api/cluster_api/run-adhoc-scripts-cluster.html Assign id/label of cluster to id.



66
67
68
# File 'lib/qubole/cluster.rb', line 66

def self.run_script(id, params={})
  Qubole.put("/clusters/#{id}/runscript.json", params)
end

.show(cluster_id_label) ⇒ Object

Show information about the cluster with id/label ‘cluster_id_label`.



13
14
15
# File 'lib/qubole/cluster.rb', line 13

def self.show(cluster_id_label)
  Qubole.get("/clusters/#{cluster_id_label}")
end

.snapshot(id, params = {}) ⇒ Object

Create hbase snapshot full/incremental docs.qubole.com/en/latest/rest-api/cluster_api/hbase-snapshot.html#parameters Assign id/label of cluster to id



109
110
111
# File 'lib/qubole/cluster.rb', line 109

def self.snapshot(id, params={})
  Qubole.post("/clusters/#{id}/snapshots", params)
end

.start(id) ⇒ Object

Start the cluster with id/label.



36
37
38
39
40
# File 'lib/qubole/cluster.rb', line 36

def self.start(id)
  params = {}
  params[:state] = "start"
  Qubole.put("/clusters/#{id}/state", {:state => "start"})
end

.status(id) ⇒ Object

Show the status of the cluster with id/label.



43
44
45
# File 'lib/qubole/cluster.rb', line 43

def self.status(id)
  Qubole.get("/clusters/#{id}/state")
end

.terminate(id) ⇒ Object

Terminate the cluster with id/label ‘cluster_id_label`.



48
49
50
# File 'lib/qubole/cluster.rb', line 48

def self.terminate(id)
  Qubole.put("/clusters/#{id}/state", {:state => "terminate"})
end

.update(id, params = {}) ⇒ Object

Update the cluster with id/label ‘cluster_id_label` using information provided in `cluster_info`. Assign id/label of cluster to id



25
26
27
# File 'lib/qubole/cluster.rb', line 25

def self.update(id, params={})
  Qubole.put("/clusters/#{id}", params)
end

.update_snapshot_schedule(id, params = {}) ⇒ Object

Update for snapshot schedule docs.qubole.com/en/latest/rest-api/cluster_api/update-snapshot-schedule.html#parameters Assign id/label of cluster to id



128
129
130
# File 'lib/qubole/cluster.rb', line 128

def self.update_snapshot_schedule(id, params={})
  Qubole.put("/clusters/#{id}/snapshot_schedule", params)
end