Class: Fog::AWS::ElasticBeanstalk::Template

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Template

Returns a new instance of Template.



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

def initialize(attributes={})
  super
end

Instance Method Details

#destroyObject



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

def destroy
  requires :name, :application_name
  service.delete_configuration_template(application_name, name)
  true
end

#modify(new_attributes) ⇒ Object



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

def modify(new_attributes)
  requires :name, :application_name

  options = {
      'ApplicationName' => application_name,
      'Description' => new_attributes[:description],
      'OptionSettings' => new_attributes[:option_settings],
      'TemplateName' => name
  }
  options.delete_if {|key, value| value.nil?}

  data = service.update_configuration_template(options).body['UpdateConfigurationTemplateResult']
  merge_attributes(data)
  true
end

#optionsObject

Returns an array of options that may be set on this template



24
25
26
27
28
29
30
31
# File 'lib/fog/aws/models/beanstalk/template.rb', line 24

def options
  requires :name, :application_name
  data = service.describe_configuration_options({
      'ApplicationName' => application_name,
      'TemplateName' => name
                                            })
  data.body['DescribeConfigurationOptionsResult']['Options']
end

#saveObject



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

def save
  requires :name, :application_name

  options = {
      'ApplicationName' => application_name,
      'Description' => description,
      'EnvironmentId' => environment_id,
      'OptionSettings' => option_settings,
      'SolutionStackName' => solution_stack_name,
      'SourceConfiguration' => source_configuration,
      'TemplateName' => name
  }
  options.delete_if {|key, value| value.nil?}

  data = service.create_configuration_template(options).body['CreateConfigurationTemplateResult']
  merge_attributes(data)
  true
end