class Fog::Compute::HuaweiCloud::Snapshots

Public Instance Methods

all(options = {}) click to toggle source
# File lib/fog/compute/huaweicloud/models/snapshots.rb, line 10
def all(options = {})
  if !options.kind_of?(Hash)
    if options
      Fog::Logger.deprecation('Calling HuaweiCloud[:compute].snapshots.all(true) is deprecated, use .snapshots.all')
    else
      Fog::Logger.deprecation('Calling HuaweiCloud[:compute].snapshots.all(false) is deprecated, use .snapshots.summary')
    end
    load_response(service.list_snapshots(options), 'snapshots')
  else
    load_response(service.list_snapshots_detail(options), 'snapshots')
  end
end
get(snapshot_id) click to toggle source
# File lib/fog/compute/huaweicloud/models/snapshots.rb, line 27
def get(snapshot_id)
  if snapshot = service.get_snapshot_details(snapshot_id).body['snapshot']
    new(snapshot)
  end
rescue Fog::Compute::HuaweiCloud::NotFound
  nil
end
summary(options = {}) click to toggle source
# File lib/fog/compute/huaweicloud/models/snapshots.rb, line 23
def summary(options = {})
  load_response(service.list_snapshots(options), 'snapshots')
end