Class: Fog::AWS::ElasticBeanstalk::Application

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/beanstalk/application.rb

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Fog::Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Fog::Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

#initialize(attributes = {}) ⇒ Application

Returns a new instance of Application.



15
16
17
# File 'lib/fog/aws/models/beanstalk/application.rb', line 15

def initialize(attributes={})
  super
end

Instance Method Details

#destroyObject



39
40
41
42
43
# File 'lib/fog/aws/models/beanstalk/application.rb', line 39

def destroy
  requires :name
  connection.delete_application(name)
  true
end

#environmentsObject



19
20
21
22
# File 'lib/fog/aws/models/beanstalk/application.rb', line 19

def environments
  requires :name
  connection.environments.all({'ApplicationName' => name})
end

#eventsObject



24
25
26
27
# File 'lib/fog/aws/models/beanstalk/application.rb', line 24

def events
  requires :name
  connection.events.all({'ApplicationName' => name})
end

#saveObject



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/fog/aws/models/beanstalk/application.rb', line 45

def save
  requires :name

  options = {
      'ApplicationName' => name
  }
  options['Description'] = description unless description.nil?

  data = connection.create_application(options).body['CreateApplicationResult']['Application']
  merge_attributes(data)
  true
end

#templatesObject



29
30
31
32
# File 'lib/fog/aws/models/beanstalk/application.rb', line 29

def templates
  requires :name
  connection.templates.all({'ApplicationName' => name})
end

#versionsObject



34
35
36
37
# File 'lib/fog/aws/models/beanstalk/application.rb', line 34

def versions
  requires :name
  connection.versions.all({'ApplicationName' => name})
end