2012-03-15 17:12:30 -07:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/aws/models/beanstalk/application'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class ElasticBeanstalk
|
|
|
|
|
|
|
|
class Applications < Fog::Collection
|
|
|
|
model Fog::AWS::ElasticBeanstalk::Application
|
|
|
|
|
|
|
|
def all(application_names=[])
|
2012-12-22 23:32:13 +00:00
|
|
|
data = service.describe_applications(application_names).body['DescribeApplicationsResult']['Applications']
|
2012-03-15 17:12:30 -07:00
|
|
|
load(data) # data is an array of attribute hashes
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(application_name)
|
2012-12-22 23:32:13 +00:00
|
|
|
if data = service.describe_applications([application_name]).body['DescribeApplicationsResult']['Applications'].first
|
2012-03-15 17:12:30 -07:00
|
|
|
new(data)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|