Class: Rubineti::Cluster

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

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Cluster

Returns a new instance of Cluster.



3
4
5
# File 'lib/rubineti/cluster.rb', line 3

def initialize connection
  @connection = connection
end

Instance Method Details

#featuresObject

Returns a list of features supported by the RAPI server.



10
11
12
13
# File 'lib/rubineti/cluster.rb', line 10

def features
  warn "WARNING: Cluster#features not implemented."
  # get "/#{Ganeti::Version}/features"
end

#infoObject

Returns a list of cluster information.



18
19
20
# File 'lib/rubineti/cluster.rb', line 18

def info
  @connection.get "/#{Ganeti::Version}/info"
end

#os_listObject

Return a list of all OSes.



74
75
76
# File 'lib/rubineti/cluster.rb', line 74

def os_list
  @connection.get "/#{Ganeti::Version}/os"
end

#redistribute_configObject

Redistribute configuration to all nodes. Returns a job_id.



26
27
28
# File 'lib/rubineti/cluster.rb', line 26

def redistribute_config
  @connection.put "/#{Ganeti::Version}/redistribute-config"
end

#tags_create(params = {}) ⇒ Object

Adds a set of tags. Returns a job_id.

If the optional dry-run parameter (?dry-run=1) is provided, the job will not be actually executed, only the pre-execution checks will be done.



38
39
40
41
# File 'lib/rubineti/cluster.rb', line 38

def tags_create params = {}
  warn "WARNING: Cluster#tags_create not implemented."
  # put "/#{Ganeti::Version}/tags", params
end

#tags_delete(params = {}) ⇒ Object

Delete tags. Returns a job_id.

If the optional dry-run parameter (?dry-run=1) is provided, the job will not be actually executed, only the pre-execution checks will be done.



51
52
53
54
# File 'lib/rubineti/cluster.rb', line 51

def tags_delete params = {}
  warn "WARNING: Cluster#tags_delete not implemented."
  # delete "/#{Ganeti::Version}/tags", params
end

#tags_listObject

Returns the cluster tags.



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

def tags_list
  warn "WARNING: Cluster#tags_list not implemented."
  # get "/#{Ganeti::Version}/tags"
end

#versionObject

Returns the cluster API version.



67
68
69
# File 'lib/rubineti/cluster.rb', line 67

def version
  @connection.get "/version"
end