Class: Cloudkeeper::One::Opennebula::ApplianceHandler
- Inherits:
-
Handler
- Object
- Handler
- Cloudkeeper::One::Opennebula::ApplianceHandler
show all
- Defined in:
- lib/cloudkeeper/one/opennebula/appliance_handler.rb
Constant Summary
collapse
- LEAVE_ID_AS_IS =
-1
- ONEADMIN_ID =
0
Constants inherited
from Handler
Handler::API_POLLING_WAIT
Constants included
from Helper
Helper::ERRORS
Instance Attribute Summary collapse
Attributes inherited from Handler
#client, #pool
Instance Method Summary
collapse
Methods inherited from Handler
#exist?, #find_all, #find_by_id, #find_by_name, #find_one
Methods included from Helper
#decode_error, #handle_opennebula_error
Constructor Details
Returns a new instance of ApplianceHandler.
12
13
14
15
16
|
# File 'lib/cloudkeeper/one/opennebula/appliance_handler.rb', line 12
def initialize
super
@identifier = Cloudkeeper::One::Settings[:identifier]
end
|
Instance Attribute Details
#identifier ⇒ Object
Returns the value of attribute identifier.
7
8
9
|
# File 'lib/cloudkeeper/one/opennebula/appliance_handler.rb', line 7
def identifier
@identifier
end
|
Instance Method Details
#chmod(element, permissions) ⇒ Object
35
36
37
38
39
40
41
42
|
# File 'lib/cloudkeeper/one/opennebula/appliance_handler.rb', line 35
def chmod(element, permissions)
raise Cloudkeeper::One::Errors::ArgumentError, 'element cannot be nil' unless element
handle_opennebula_error do
element.chmod_octet permissions
element.info!
end
end
|
#delete(element) ⇒ Object
#find_by_appliance_id(appliance_id) ⇒ Object
18
19
20
|
# File 'lib/cloudkeeper/one/opennebula/appliance_handler.rb', line 18
def find_by_appliance_id(appliance_id)
find_all_by "TEMPLATE/#{Tags::APPLIANCE_ID}" => appliance_id
end
|
#find_by_image_list_id(image_list_id) ⇒ Object
22
23
24
|
# File 'lib/cloudkeeper/one/opennebula/appliance_handler.rb', line 22
def find_by_image_list_id(image_list_id)
find_all_by "TEMPLATE/#{Tags::APPLIANCE_IMAGE_LIST_ID}" => image_list_id
end
|
#update(element, template) ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'lib/cloudkeeper/one/opennebula/appliance_handler.rb', line 44
def update(element, template)
raise Cloudkeeper::One::Errors::ArgumentError, 'element cannot be nil' unless element
handle_opennebula_error do
element.update template, true
element.info!
end
end
|