2012-07-27 07:06:28 -04:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/brightbox/models/compute/application'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class Brightbox
|
|
|
|
|
|
|
|
class Applications < Fog::Collection
|
|
|
|
|
|
|
|
model Fog::Compute::Brightbox::Application
|
|
|
|
|
|
|
|
def all
|
2012-12-22 18:29:21 -05:00
|
|
|
data = service.list_applications
|
2012-07-27 07:06:28 -04:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(identifier)
|
2012-12-22 18:29:21 -05:00
|
|
|
data = service.get_application(identifier)
|
2012-07-27 07:06:28 -04:00
|
|
|
new(data)
|
|
|
|
rescue Excon::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
2012-12-22 18:29:21 -05:00
|
|
|
end
|