Class: Cloudkeeper::One::Opennebula::Handler
- Inherits:
-
Object
- Object
- Cloudkeeper::One::Opennebula::Handler
- Includes:
- Helper
- Defined in:
- lib/cloudkeeper/one/opennebula/handler.rb
Direct Known Subclasses
Constant Summary collapse
- API_POLLING_WAIT =
5
Constants included from Helper
Cloudkeeper::One::Opennebula::Helper::ERRORS
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#pool ⇒ Object
Returns the value of attribute pool.
Instance Method Summary collapse
- #exist?(id) ⇒ Boolean
- #find_all(xpaths = {}) ⇒ Object
- #find_by_id(id) ⇒ Object
- #find_by_name(name) ⇒ Object
- #find_one(xpaths = {}) ⇒ Object
-
#initialize ⇒ Handler
constructor
A new instance of Handler.
Methods included from Helper
#decode_error, #handle_opennebula_error
Constructor Details
#initialize ⇒ Handler
Returns a new instance of Handler.
11 12 13 14 |
# File 'lib/cloudkeeper/one/opennebula/handler.rb', line 11 def initialize @client = OpenNebula::Client.new Cloudkeeper::One::Settings[:'opennebula-secret'], Cloudkeeper::One::Settings[:'opennebula-endpoint'] end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/cloudkeeper/one/opennebula/handler.rb', line 6 def client @client end |
#pool ⇒ Object
Returns the value of attribute pool.
7 8 9 |
# File 'lib/cloudkeeper/one/opennebula/handler.rb', line 7 def pool @pool end |
Instance Method Details
#exist?(id) ⇒ Boolean
32 33 34 |
# File 'lib/cloudkeeper/one/opennebula/handler.rb', line 32 def exist?(id) find_by_id id end |
#find_all(xpaths = {}) ⇒ Object
20 21 22 |
# File 'lib/cloudkeeper/one/opennebula/handler.rb', line 20 def find_all(xpaths = {}) find(:find_all, xpaths) end |
#find_by_id(id) ⇒ Object
28 29 30 |
# File 'lib/cloudkeeper/one/opennebula/handler.rb', line 28 def find_by_id(id) find_one('ID' => id.to_s) end |
#find_by_name(name) ⇒ Object
24 25 26 |
# File 'lib/cloudkeeper/one/opennebula/handler.rb', line 24 def find_by_name(name) find_one('NAME' => name) end |
#find_one(xpaths = {}) ⇒ Object
16 17 18 |
# File 'lib/cloudkeeper/one/opennebula/handler.rb', line 16 def find_one(xpaths = {}) find(:find, xpaths) end |