Revision 58ad9620 src/oca/ruby/OpenNebula/System.rb
src/oca/ruby/OpenNebula/System.rb | ||
---|---|---|
27 | 27 |
:userquotainfo => "userquota.info", |
28 | 28 |
:userquotaupdate => "userquota.update", |
29 | 29 |
:groupquotainfo => "groupquota.info", |
30 |
:groupquotaupdate => "groupquota.update" |
|
30 |
:groupquotaupdate => "groupquota.update", |
|
31 |
:version => "system.version", |
|
32 |
:config => "system.config" |
|
31 | 33 |
} |
32 | 34 |
|
33 | 35 |
####################################################################### |
... | ... | |
44 | 46 |
# XML-RPC Methods |
45 | 47 |
####################################################################### |
46 | 48 |
|
49 |
# Gets the oned version |
|
50 |
# |
|
51 |
# @return [String, OpenNebula::Error] the oned version in case |
|
52 |
# of success, Error otherwise |
|
53 |
def get_oned_version() |
|
54 |
return @client.call("system.version") |
|
55 |
end |
|
56 |
|
|
57 |
# Returns whether of not the oned version is the same as the OCA version |
|
58 |
# |
|
59 |
# @return [true, false, OpenNebula::Error] true if oned is the same |
|
60 |
# version |
|
61 |
def compatible_version() |
|
62 |
no_revision = VERSION[/^\d+\.\d+\./] |
|
63 |
oned_v = get_oned_version |
|
64 |
|
|
65 |
if OpenNebula.is_error?(oned_v) |
|
66 |
return oned_v |
|
67 |
end |
|
68 |
|
|
69 |
return (oned_v =~ /#{no_revision}/) != nil |
|
70 |
end |
|
71 |
|
|
72 |
# Gets the oned configuration |
|
73 |
# |
|
74 |
# @return [XMLElement, OpenNebula::Error] the oned configuration in case |
|
75 |
# of success, Error otherwise |
|
76 |
def get_configuration() |
|
77 |
rc = @client.call(SYSTEM_METHODS[:config]) |
|
78 |
|
|
79 |
if OpenNebula.is_error?(rc) |
|
80 |
return rc |
|
81 |
end |
|
82 |
|
|
83 |
config = XMLElement.new |
|
84 |
config.initialize_xml(rc, 'TEMPLATE') |
|
85 |
|
|
86 |
return config |
|
87 |
end |
|
88 |
|
|
47 | 89 |
# Gets the default user quota limits |
48 | 90 |
# |
49 | 91 |
# @return [XMLElement, OpenNebula::Error] the default user quota in case |
Also available in: Unified diff