Class: Fog::AWS::ElasticBeanstalk::Version

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Version

Returns a new instance of Version.



13
14
15
# File 'lib/fog/aws/models/beanstalk/version.rb', line 13

def initialize(attributes={})
  super
end

Instance Method Details

#destroy(delete_source_bundle = nil) ⇒ Object



35
36
37
38
39
# File 'lib/fog/aws/models/beanstalk/version.rb', line 35

def destroy(delete_source_bundle = nil)
  requires :label, :application_name
  service.delete_application_version(application_name, label, delete_source_bundle)
  true
end

#environmentsObject

Returns environments running this version



27
28
29
30
31
32
33
# File 'lib/fog/aws/models/beanstalk/version.rb', line 27

def environments
  requires :label, :application_name
  service.environments.all({
                            'ApplicationName' => application_name,
                            'VersionLabel' => label
                        })
end

#eventsObject

Return events related to this version



18
19
20
21
22
23
24
# File 'lib/fog/aws/models/beanstalk/version.rb', line 18

def events
  requires :label, :application_name
  service.events.all({
                            'ApplicationName' => application_name,
                            'VersionLabel' => label
                        })
end

#saveObject



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

def save
  requires :label, :application_name

  options = {
      'ApplicationName' => application_name,
      'AutoCreateApplication' => auto_create_application,
      'Description' => description,
      'SourceBundle' => source_bundle,
      'VersionLabel' => label
  }
  options.delete_if {|key, value| value.nil?}

  data = service.create_application_version(options).body['CreateApplicationVersionResult']['ApplicationVersion']
  merge_attributes(data)
  true
end

#updateObject

Updates the version label with the current property values. Currently only updates description



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/fog/aws/models/beanstalk/version.rb', line 59

def update
  requires :label, :application_name

  options = {
      'ApplicationName' => application_name,
      'Description' => description,
      'VersionLabel' => label
  }
  options.delete_if {|key, value| value.nil?}

  data = service.update_application_version(options).body['UpdateApplicationVersionResult']['ApplicationVersion']
  merge_attributes(data)
end