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.



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

def initialize(attributes={})
  super
end

Instance Method Details

#destroy(delete_source_bundle = nil) ⇒ Object



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

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



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

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

#eventsObject

Return events related to this version



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

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

#saveObject



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

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



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

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