class HammerCLIForeman::ComputeAttribute::RemoveVolume

Using the Update command because removing a volume is done by modifying existing compute_attribute

Public Instance Methods

request_params() click to toggle source
# File lib/hammer_cli_foreman/compute_attribute.rb, line 284
def request_params
  params = HammerCLIForeman::ComputeAttribute.get_params(options)
  raise ArgumentError, "Compute profile value to update does not exist yet; it needs to be created first" if !params['compute_attribute'].key?('id')
  params['id'] = params['compute_attribute']['id']
  if params['compute_attribute']['vm_attrs']['volumes_attributes'].has_key?(option_volume_id.to_s)
    params['compute_attribute']['vm_attrs']['volumes_attributes'].delete(option_volume_id.to_s)
  else
    signal_usage_error _('unknown volume id')
  end
  params
end
validate_options() click to toggle source
Calls superclass method
# File lib/hammer_cli_foreman/compute_attribute.rb, line 278
def validate_options
  super
  validator.any(:option_compute_profile_id, :option_compute_profile_name).required
  validator.any(:option_compute_resource_id, :option_compute_resource_name).required
end