mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
environment now uses name as identity.
This commit is contained in:
parent
64341926b4
commit
00e504ee74
2 changed files with 5 additions and 9 deletions
|
@ -5,7 +5,8 @@ module Fog
|
|||
class ElasticBeanstalk
|
||||
|
||||
class Environment < Fog::Model
|
||||
identity :id, :aliases => 'EnvironmentId'
|
||||
identity :name, :aliases => 'EnvironmentName'
|
||||
attribute :id, :aliases => 'EnvironmentId'
|
||||
|
||||
attribute :application_name, :aliases => 'ApplicationName'
|
||||
attribute :cname, :aliases => 'CNAME'
|
||||
|
@ -15,7 +16,6 @@ module Fog
|
|||
attribute :updated_at, :aliases => 'DateUpdated'
|
||||
attribute :description, :aliases => 'Description'
|
||||
attribute :endpoint_url, :aliases => 'EndpointURL'
|
||||
attribute :name, :aliases => 'EnvironmentName'
|
||||
attribute :health, :aliases => 'Health'
|
||||
attribute :resources, :aliases => 'Resources'
|
||||
attribute :solution_stack_name, :aliases => 'SolutionStackName'
|
||||
|
|
|
@ -13,14 +13,10 @@ module Fog
|
|||
load(data) # data is an array of attribute hashes
|
||||
end
|
||||
|
||||
# Gets an environment given an id or name.
|
||||
# Gets an environment given a name.
|
||||
#
|
||||
def get(environment_id)
|
||||
if match = environment_id.match(/e\-[a-zA-Z0-9]{10}/)
|
||||
options = { 'EnvironmentIds' => [environment_id] }
|
||||
else
|
||||
options = { 'EnvironmentNames' => [environment_id] }
|
||||
end
|
||||
def get(environment_name)
|
||||
options = { 'EnvironmentNames' => [environment_name] }
|
||||
|
||||
if data = connection.describe_environments(options).body['DescribeEnvironmentsResult']['Environments'].first
|
||||
new(data)
|
||||
|
|
Loading…
Add table
Reference in a new issue