Method: HPE3PAR_API#modify_volume

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

#modify_volume(volume_name, new_name, expiration_time, retention_time, snap_cpg, user_cpg, ss_spc_alloc_warning_pct, ss_spc_alloc_limit_pct, usr_spc_alloc_warning_pct, usr_spc_alloc_limit_pct, rm_ss_spc_alloc_warning, rm_usr_spc_alloc_warning, rm_exp_time, rm_ss_spc_alloc_limit, rm_usr_spc_alloc_limit, debug = false) ⇒ Object

[View source]

462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/puppet/util/hpe3par_api.rb', line 462

def modify_volume(volume_name, new_name, expiration_time, retention_time, snap_cpg, user_cpg,
                  ss_spc_alloc_warning_pct, ss_spc_alloc_limit_pct, usr_spc_alloc_warning_pct, usr_spc_alloc_limit_pct,
                  rm_ss_spc_alloc_warning, rm_usr_spc_alloc_warning, rm_exp_time, rm_ss_spc_alloc_limit, rm_usr_spc_alloc_limit, debug = false)
  cl = Hpe3parSdk::Client.new(@rest_url, debug: debug, app_type: 'puppet-3par')
  begin
    cl.(@url.user, @url.password)
    volume_mods={:expirationHours => expiration_time,
                 :newName => new_name,
                 :retentionHours => retention_time,
                 :snapCPG => snap_cpg,
                 :ssSpcAllocWarningPct => ss_spc_alloc_warning_pct,
                 :ssSpcAllocLimitPct => ss_spc_alloc_limit_pct,
                 :userCPG => user_cpg,
                 :usrSpcAllocWarningPct => usr_spc_alloc_warning_pct,
                 :usrSpcAllocLimitPct => usr_spc_alloc_limit_pct,
                 :rmSsSpcAllocWarning => rm_ss_spc_alloc_warning,
                 :rmUsrSpcAllocWarning => rm_usr_spc_alloc_warning,
                 :rmExpTime => rm_exp_time,
                 :rmSsSpcAllocLimit => rm_ss_spc_alloc_limit,
                 :rmUsrSpcAllocLimit => rm_usr_spc_alloc_limit
    }
    cl.modify_volume(volume_name, volume_mods)
    Puppet.info("Volume #{volume_name} modified successfully")
  rescue Hpe3parSdk::HTTPConflict => ex
    Puppet.err(ex.message)
    Puppet.err("Unable to rename, since a volume with the name #{new_name} already exists")
    raise ex
  rescue Hpe3parSdk::HPE3PARException => ex
    Puppet.err(ex.message)
    raise ex
  ensure
    cl.logout
  end
end