Class: Fog::AWS::ElasticBeanstalk::Template
- Defined in:
- lib/rackspace-fog/aws/models/beanstalk/template.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ Template
constructor
A new instance of Template.
- #modify(new_attributes) ⇒ Object
-
#options ⇒ Object
Returns an array of options that may be set on this template.
- #save ⇒ Object
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 = {}) ⇒ Template
Returns a new instance of Template.
20 21 22 |
# File 'lib/rackspace-fog/aws/models/beanstalk/template.rb', line 20 def initialize(attributes={}) super end |
Instance Method Details
#destroy ⇒ Object
34 35 36 37 38 |
# File 'lib/rackspace-fog/aws/models/beanstalk/template.rb', line 34 def destroy requires :name, :application_name connection.delete_configuration_template(application_name, name) true end |
#modify(new_attributes) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/rackspace-fog/aws/models/beanstalk/template.rb', line 59 def modify(new_attributes) requires :name, :application_name = { 'ApplicationName' => application_name, 'Description' => new_attributes[:description], 'OptionSettings' => new_attributes[:option_settings], 'TemplateName' => name } .delete_if {|key, value| value.nil?} data = connection.update_configuration_template().body['UpdateConfigurationTemplateResult'] merge_attributes(data) true end |
#options ⇒ Object
Returns an array of options that may be set on this template
25 26 27 28 29 30 31 32 |
# File 'lib/rackspace-fog/aws/models/beanstalk/template.rb', line 25 def requires :name, :application_name data = connection.({ 'ApplicationName' => application_name, 'TemplateName' => name }) data.body['DescribeConfigurationOptionsResult']['Options'] end |
#save ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/rackspace-fog/aws/models/beanstalk/template.rb', line 40 def save requires :name, :application_name = { 'ApplicationName' => application_name, 'Description' => description, 'EnvironmentId' => environment_id, 'OptionSettings' => option_settings, 'SolutionStackName' => solution_stack_name, 'SourceConfiguration' => source_configuration, 'TemplateName' => name } .delete_if {|key, value| value.nil?} data = connection.create_configuration_template().body['CreateConfigurationTemplateResult'] merge_attributes(data) true end |