Method: HPE3PAR_API#create_snapshot

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

#create_snapshot(name, base_volume_name, read_only = nil, expiration_time = nil, retention_time = nil, expiration_unit = nil, retention_unit = nil, debug = false) ⇒ Object



143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/puppet/util/hpe3par_api.rb', line 143

def create_snapshot(name, base_volume_name, read_only=nil, expiration_time=nil, retention_time=nil, expiration_unit=nil, retention_unit=nil, debug = false)
  cl = Hpe3parSdk::Client.new(@rest_url, debug: debug)
  begin
    cl.(@url.user, @url.password)
    optional_hash= {
        :readOnly => read_only,
        :expirationHours => convert_to_hours(expiration_time, expiration_unit),
        :retentionHours => convert_to_hours(retention_time, retention_unit)
    }
    cl.create_snapshot(name, base_volume_name, optional_hash)
  ensure
    cl.logout
  end
end