Method: HPE3PAR_API#change_user_cpg

Defined in:
lib/puppet/util/hpe3par_api.rb

#change_user_cpg(name, user_cpg, wait_for_task_to_end, debug = false) ⇒ Object



546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'lib/puppet/util/hpe3par_api.rb', line 546

def change_user_cpg(name, user_cpg, wait_for_task_to_end, debug = false)
  cl = Hpe3parSdk::Client.new(@rest_url, debug: debug)
  begin
    cl.(@url.user, @url.password)
    task = cl.tune_volume(name, Hpe3parSdk::VolumeTuneOperation::USR_CPG,
                          {:userCPG => user_cpg})
    if wait_for_task_to_end
      Puppet.info("Waiting for change user CPG task of volume #{name} to complete")
      cl.wait_for_task_to_end(task.task_id)
    end
    Puppet.info("User CPG of Volume #{name} changed to #{user_cpg} successfully")
  rescue Hpe3parSdk::HPE3PARException => ex
    Puppet.err(ex.message)
    raise ex
  ensure
    cl.logout
  end
end