Module: Fog::Compute::Ovirt::Shared
- Defined in:
- lib/fog/ovirt/compute.rb,
lib/fog/ovirt/requests/compute/update_volume.rb,
lib/fog/ovirt/requests/compute/update_interface.rb
Instance Method Summary collapse
- #check_arguments(id, options) ⇒ Object
-
#ovirt_attrs(obj) ⇒ Object
converts an OVIRT object into an hash for fog to consume.
Instance Method Details
#check_arguments(id, options) ⇒ Object
6 7 8 9 |
# File 'lib/fog/ovirt/requests/compute/update_volume.rb', line 6 def check_arguments(id, ) raise ArgumentError, "instance id is a required parameter" unless id raise ArgumentError, "disk id is a required parameter for update-volume" unless .has_key? :id end |
#ovirt_attrs(obj) ⇒ Object
converts an OVIRT object into an hash for fog to consume.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/fog/ovirt/compute.rb', line 70 def ovirt_attrs obj opts = {:raw => obj} obj.instance_variables.each do |v| key = v.to_s.gsub("@","").to_sym value = obj.instance_variable_get(v) #ignore nil values next if value.nil? opts[key] = case value when OVIRT::Link value.id when OVIRT::TemplateVersion value when Array value when Hash value else value.to_s.strip end end opts end |