mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
New file additions for AWS Elastic Beanstalk support.
This commit is contained in:
parent
4375cc77f8
commit
965fd66d2e
63 changed files with 2312 additions and 0 deletions
140
lib/fog/aws/beanstalk.rb
Normal file
140
lib/fog/aws/beanstalk.rb
Normal file
|
@ -0,0 +1,140 @@
|
|||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'aws'))
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk < Fog::Service
|
||||
|
||||
class InvalidParameterError < Fog::Errors::Error; end
|
||||
|
||||
requires :aws_access_key_id, :aws_secret_access_key
|
||||
|
||||
request_path 'fog/aws/requests/beanstalk'
|
||||
|
||||
request :check_dns_availability
|
||||
request :create_application
|
||||
request :create_application_version
|
||||
request :create_configuration_template
|
||||
request :create_environment
|
||||
request :create_storage_location
|
||||
request :delete_application
|
||||
request :delete_application_version
|
||||
request :delete_configuration_template
|
||||
request :delete_environment_configuration
|
||||
request :describe_applications
|
||||
request :describe_application_versions
|
||||
request :describe_configuration_options
|
||||
request :describe_configuration_settings
|
||||
request :describe_environment_resources
|
||||
request :describe_environments
|
||||
request :describe_events
|
||||
request :list_available_solution_stacks
|
||||
request :rebuild_environment
|
||||
request :request_environment_info
|
||||
request :restart_app_server
|
||||
request :retrieve_environment_info
|
||||
request :swap_environment_cnames
|
||||
request :terminate_environment
|
||||
request :update_application
|
||||
request :update_application_version
|
||||
request :update_configuration_template
|
||||
request :update_environment
|
||||
request :validate_configuration_settings
|
||||
|
||||
model_path 'fog/aws/models/beanstalk'
|
||||
|
||||
model :application
|
||||
collection :applications
|
||||
model :environment
|
||||
collection :environments
|
||||
model :event
|
||||
collection :events
|
||||
model :template
|
||||
collection :templates
|
||||
model :version
|
||||
collection :versions
|
||||
|
||||
class Mock
|
||||
|
||||
def initialize(options={})
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Real
|
||||
|
||||
def initialize(options={})
|
||||
require 'fog/core/parser'
|
||||
require 'multi_json'
|
||||
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
@aws_secret_access_key = options[:aws_secret_access_key]
|
||||
@hmac = Fog::HMAC.new('sha256', @aws_secret_access_key)
|
||||
|
||||
@connection_options = options[:connection_options] || {}
|
||||
options[:region] ||= 'us-east-1'
|
||||
@host = options[:host] || "elasticbeanstalk.#{options[:region]}.amazonaws.com"
|
||||
@path = options[:path] || '/'
|
||||
@persistent = options[:persistent] || false
|
||||
@port = options[:port] || 443
|
||||
@scheme = options[:scheme] || 'https'
|
||||
@connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
|
||||
end
|
||||
|
||||
def reload
|
||||
@connection.reset
|
||||
end
|
||||
|
||||
# Returns an array of available solutions stack details
|
||||
def solution_stacks
|
||||
list_available_solution_stacks.body['ListAvailableSolutionStacksResult']['SolutionStackDetails']
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def request(params)
|
||||
idempotent = params.delete(:idempotent)
|
||||
parser = params.delete(:parser)
|
||||
|
||||
body = AWS.signed_params(
|
||||
params,
|
||||
{
|
||||
:aws_access_key_id => @aws_access_key_id,
|
||||
:hmac => @hmac,
|
||||
:host => @host,
|
||||
:path => @path,
|
||||
:port => @port,
|
||||
:version => '2010-12-01'
|
||||
}
|
||||
)
|
||||
|
||||
begin
|
||||
response = @connection.request({
|
||||
:body => body,
|
||||
:expects => 200,
|
||||
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded' },
|
||||
:idempotent => idempotent,
|
||||
:host => @host,
|
||||
:method => 'POST',
|
||||
:parser => parser
|
||||
})
|
||||
rescue Excon::Errors::HTTPStatusError => error
|
||||
if match = error.response.body.match(/<Code>(.*)<\/Code>[ \t\n]*<Message>(.*)<\/Message>/)
|
||||
raise case match[1].split('.').last
|
||||
when 'InvalidParameterValue'
|
||||
Fog::AWS::ElasticBeanstalk::InvalidParameterError.slurp(error, match[2])
|
||||
else
|
||||
Fog::AWS::ElasticBeanstalk::Error.slurp(error, "#{match[1]} => #{match[2]}")
|
||||
end
|
||||
else
|
||||
raise error
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
51
lib/fog/aws/models/beanstalk/application.rb
Normal file
51
lib/fog/aws/models/beanstalk/application.rb
Normal file
|
@ -0,0 +1,51 @@
|
|||
require 'fog/core/model'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Application < Fog::Model
|
||||
identity :name, :aliases => 'ApplicationName'
|
||||
attribute :template_names, :aliases => 'ConfigurationTemplates'
|
||||
attribute :created_at, :aliases => 'DateCreated'
|
||||
attribute :updated_at, :aliases => 'DateUpdated'
|
||||
attribute :description, :aliases => 'Description'
|
||||
attribute :version_names, :aliases => 'Versions'
|
||||
|
||||
def initialize(attributes={})
|
||||
super
|
||||
end
|
||||
|
||||
def environments
|
||||
requires :name
|
||||
connection.environments(:server => self)
|
||||
end
|
||||
|
||||
def templates
|
||||
|
||||
end
|
||||
|
||||
def destroy
|
||||
requires :name
|
||||
connection.delete_application(name)
|
||||
true
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
25
lib/fog/aws/models/beanstalk/applications.rb
Normal file
25
lib/fog/aws/models/beanstalk/applications.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/aws/models/beanstalk/application'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Applications < Fog::Collection
|
||||
model Fog::AWS::ElasticBeanstalk::Application
|
||||
|
||||
def all(application_names=[])
|
||||
data = connection.describe_applications(application_names).body['DescribeApplicationsResult']['Applications']
|
||||
load(data) # data is an array of attribute hashes
|
||||
end
|
||||
|
||||
def get(application_name)
|
||||
if data = connection.describe_applications([application_name]).body['DescribeApplicationsResult']['Applications'].first
|
||||
new(data)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
129
lib/fog/aws/models/beanstalk/environment.rb
Normal file
129
lib/fog/aws/models/beanstalk/environment.rb
Normal file
|
@ -0,0 +1,129 @@
|
|||
require 'fog/core/model'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Environment < Fog::Model
|
||||
identity :id, :aliases => 'EnvironmentId'
|
||||
|
||||
attribute :application_name, :aliases => 'ApplicationName'
|
||||
attribute :cname, :aliases => 'CNAME'
|
||||
attribute :cname_prefix, :aliases => 'CNAMEPrefix'
|
||||
attribute :created_at, :aliases => 'DateCreated'
|
||||
attribute :updated_at, :aliases => 'DateUpdated'
|
||||
attribute :updated_at, :aliases => 'DateUpdated'
|
||||
attribute :description, :aliases => 'Description'
|
||||
attribute :endpoint_url, :aliases => 'EndpointURL'
|
||||
attribute :name, :aliases => 'EnvironmentName'
|
||||
attribute :health, :aliases => 'Health'
|
||||
attribute :resources, :aliases => 'Resources'
|
||||
attribute :solution_stack_name, :aliases => 'SolutionStackName'
|
||||
attribute :status, :aliases => 'Status'
|
||||
attribute :template_name, :aliases => 'TemplateName'
|
||||
attribute :version_label, :aliases => 'VersionLabel'
|
||||
attribute :option_settings, :aliases => 'OptionSettings'
|
||||
attribute :options_to_remove, :aliases => 'OptionsToRemove'
|
||||
|
||||
def healthy?
|
||||
health == 'Green'
|
||||
end
|
||||
|
||||
def ready?
|
||||
status == 'Ready'
|
||||
end
|
||||
|
||||
def terminated?
|
||||
status == 'Terminated'
|
||||
end
|
||||
|
||||
# Returns the current live resources for this environment
|
||||
def live_resources
|
||||
requires :id
|
||||
data = connection.describe_environment_resources({'EnvironmentId' => id}).body['DescribeEnvironmentResourcesResult']['EnvironmentResources']
|
||||
data.delete('EnvironmentName') # Delete the environment name from the result, only return actual resources
|
||||
data
|
||||
end
|
||||
|
||||
# Return events related to this version
|
||||
def events
|
||||
requires :id
|
||||
connection.events.all({'EnvironmentId' => id})
|
||||
end
|
||||
|
||||
# Restarts the app servers in this environment
|
||||
def restart_app_server
|
||||
requires :id
|
||||
connection.restart_app_server({'EnvironmentId' => id})
|
||||
reload
|
||||
end
|
||||
|
||||
# Rebuilds the environment
|
||||
def rebuild
|
||||
requires :id
|
||||
connection.rebuild_environment({'EnvironmentId' => id})
|
||||
reload
|
||||
end
|
||||
|
||||
# Return the version object for this environment
|
||||
def version
|
||||
requires :application_name, :version_label
|
||||
connection.versions.get(application_name, version_label)
|
||||
end
|
||||
|
||||
# Update the running version of this environment
|
||||
def version=(new_version)
|
||||
requires :id
|
||||
if new_version.is_a?(String)
|
||||
new_version_label = new_version
|
||||
elsif new_version.is_a?(Fog::AWS::ElasticBeanstalk::Version)
|
||||
new_version_label = new_version.label
|
||||
else
|
||||
raise "Unknown type for new_version, must be either String or Fog::AWS::ElasticBeanstalk::Version"
|
||||
end
|
||||
|
||||
if new_version.nil?
|
||||
raise "Version label not specified."
|
||||
end
|
||||
|
||||
data = connection.update_environment({
|
||||
'EnvironmentId' => id,
|
||||
'VersionLabel' => new_version_label
|
||||
}).body['UpdateEnvironmentResult']
|
||||
|
||||
merge_attributes(data)
|
||||
end
|
||||
|
||||
def destroy
|
||||
requires :id
|
||||
connection.terminate_environment({'EnvironmentId' => id})
|
||||
true
|
||||
end
|
||||
|
||||
def save
|
||||
requires :name, :application_name
|
||||
requires_one :template_name, :solution_stack_name
|
||||
|
||||
options = {
|
||||
'ApplicationName' => application_name,
|
||||
'CNAMEPrefix' => cname_prefix,
|
||||
'Description' => description,
|
||||
'EnvironmentName' => name,
|
||||
'OptionSettings' => option_settings,
|
||||
'OptionsToRemove' => options_to_remove,
|
||||
'SolutionStackName' => solution_stack_name,
|
||||
'TemplateName' => template_name,
|
||||
'VersionLabel' => version_label
|
||||
}
|
||||
options.delete_if {|key, value| value.nil?}
|
||||
|
||||
data = connection.create_environment(options).body['CreateEnvironmentResult']
|
||||
merge_attributes(data)
|
||||
true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
33
lib/fog/aws/models/beanstalk/environments.rb
Normal file
33
lib/fog/aws/models/beanstalk/environments.rb
Normal file
|
@ -0,0 +1,33 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/aws/models/beanstalk/environment'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Environments < Fog::Collection
|
||||
model Fog::AWS::ElasticBeanstalk::Environment
|
||||
|
||||
def all(options={})
|
||||
data = connection.describe_environments(options).body['DescribeEnvironmentsResult']['Environments']
|
||||
load(data) # data is an array of attribute hashes
|
||||
end
|
||||
|
||||
# Gets an environment given an id or name.
|
||||
#
|
||||
def get(environment_id)
|
||||
if match = environment_id.match(/e\-[a-zA-Z0-9]{10}/)
|
||||
options = { 'EnvironmentIds' => [environment_id] }
|
||||
else
|
||||
options = { 'EnvironmentNames' => [environment_id] }
|
||||
end
|
||||
|
||||
if data = connection.describe_environments(options).body['DescribeEnvironmentsResult']['Environments'].first
|
||||
new(data)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
20
lib/fog/aws/models/beanstalk/event.rb
Normal file
20
lib/fog/aws/models/beanstalk/event.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
require 'fog/core/model'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Event < Fog::Model
|
||||
attribute :application_name, :aliases => 'ApplicationName'
|
||||
attribute :environment_name, :aliases => 'EnvironmentName'
|
||||
attribute :date, :aliases => 'EventDate'
|
||||
attribute :message, :aliases => 'Message'
|
||||
attribute :request_id, :aliases => 'RequestId'
|
||||
attribute :severity, :aliases => 'Severity'
|
||||
attribute :template_name, :aliases => 'TemplateName'
|
||||
attribute :version_label, :aliases => 'VersionLabel'
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
19
lib/fog/aws/models/beanstalk/events.rb
Normal file
19
lib/fog/aws/models/beanstalk/events.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/aws/models/beanstalk/event'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Events < Fog::Collection
|
||||
model Fog::AWS::ElasticBeanstalk::Event
|
||||
|
||||
def all(options={})
|
||||
data = connection.describe_events(options).body['DescribeEventsResult']['Events']
|
||||
load(data) # data is an array of attribute hashes
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
62
lib/fog/aws/models/beanstalk/template.rb
Normal file
62
lib/fog/aws/models/beanstalk/template.rb
Normal file
|
@ -0,0 +1,62 @@
|
|||
require 'fog/core/model'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Template < Fog::Model
|
||||
attribute :name, :aliases => 'TemplateName'
|
||||
attribute :application_name, :aliases => 'ApplicationName'
|
||||
attribute :created_at, :aliases => 'DateCreated'
|
||||
attribute :updated_at, :aliases => 'DateUpdated'
|
||||
attribute :deployment_status, :aliases => 'DeploymentStatus'
|
||||
attribute :description, :aliases => 'Description'
|
||||
attribute :environment_id
|
||||
attribute :environment_name, :aliases => 'EnvironmentName'
|
||||
attribute :solution_stack_name, :aliases => 'SolutionStackName'
|
||||
attribute :source_configuration
|
||||
attribute :option_settings, :aliases => 'OptionSettings'
|
||||
|
||||
def initialize(attributes={})
|
||||
super
|
||||
end
|
||||
|
||||
# Returns an array of options that may be set on this template
|
||||
def options
|
||||
requires :name, :application_name
|
||||
data = connection.describe_configuration_options({
|
||||
'ApplicationName' => application_name,
|
||||
'TemplateName' => name
|
||||
})
|
||||
data.body['DescribeConfigurationOptionsResult']['Options']
|
||||
end
|
||||
|
||||
def destroy
|
||||
requires :name, :application_name
|
||||
connection.delete_configuration_template(application_name, name)
|
||||
true
|
||||
end
|
||||
|
||||
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 = connection.create_configuration_template(options).body['CreateConfigurationTemplateResult']
|
||||
merge_attributes(data)
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
70
lib/fog/aws/models/beanstalk/templates.rb
Normal file
70
lib/fog/aws/models/beanstalk/templates.rb
Normal file
|
@ -0,0 +1,70 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/aws/models/beanstalk/template'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Templates < Fog::Collection
|
||||
model Fog::AWS::ElasticBeanstalk::Template
|
||||
|
||||
# Describes all configuration templates, may optionally pass an ApplicationName filter
|
||||
#
|
||||
# Note: This is currently an expensive operation requiring multiple API calls due to a lack of
|
||||
# a describe configuration templates call in the AWS API.
|
||||
def all(options={})
|
||||
application_filter = []
|
||||
if options.has_key?('ApplicationName')
|
||||
application_filter << options['ApplicationName']
|
||||
end
|
||||
|
||||
# Initialize with empty array
|
||||
data = []
|
||||
|
||||
applications = connection.describe_applications(application_filter).body['DescribeApplicationsResult']['Applications']
|
||||
applications.each { |application|
|
||||
application['ConfigurationTemplates'].each { |template_name|
|
||||
begin
|
||||
options = {
|
||||
'ApplicationName' => application['ApplicationName'],
|
||||
'TemplateName' => template_name
|
||||
}
|
||||
settings = connection.describe_configuration_settings(options).body['DescribeConfigurationSettingsResult']['ConfigurationSettings']
|
||||
if settings.length == 1
|
||||
# Add to data
|
||||
data << settings.first
|
||||
end
|
||||
rescue Fog::AWS::ElasticBeanstalk::InvalidParameterError
|
||||
# Ignore
|
||||
end
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
load(data) # data is an array of attribute hashes
|
||||
end
|
||||
|
||||
def get(application_name, template_name)
|
||||
options = {
|
||||
'ApplicationName' => application_name,
|
||||
'TemplateName' => template_name
|
||||
}
|
||||
|
||||
result = nil
|
||||
# There is no describe call for templates, so we must use describe_configuration_settings. Unfortunately,
|
||||
# it throws an exception if template name doesn't exist, which is inconsistent, catch and return nil
|
||||
begin
|
||||
data = connection.describe_configuration_settings(options).body['DescribeConfigurationSettingsResult']['ConfigurationSettings']
|
||||
if data.length == 1
|
||||
result = new(data.first)
|
||||
end
|
||||
rescue Fog::AWS::ElasticBeanstalk::InvalidParameterError
|
||||
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
79
lib/fog/aws/models/beanstalk/version.rb
Normal file
79
lib/fog/aws/models/beanstalk/version.rb
Normal file
|
@ -0,0 +1,79 @@
|
|||
require 'fog/core/model'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Version < Fog::Model
|
||||
attribute :label, :aliases => 'VersionLabel'
|
||||
attribute :application_name, :aliases => 'ApplicationName'
|
||||
attribute :created_at, :aliases => 'DateCreated'
|
||||
attribute :updated_at, :aliases => 'DateUpdated'
|
||||
attribute :description, :aliases => 'Description'
|
||||
attribute :source_bundle, :aliases => 'SourceBundle'
|
||||
attribute :auto_create_application # FIXME - should be write only
|
||||
|
||||
def initialize(attributes={})
|
||||
super
|
||||
end
|
||||
|
||||
# Return events related to this version
|
||||
def events
|
||||
requires :label, :application_name
|
||||
connection.events.all({
|
||||
'ApplicationName' => application_name,
|
||||
'VersionLabel' => label
|
||||
})
|
||||
end
|
||||
|
||||
# Returns environments running this version
|
||||
def environments
|
||||
requires :label, :application_name
|
||||
connection.environments.all({
|
||||
'ApplicationName' => application_name,
|
||||
'VersionLabel' => label
|
||||
})
|
||||
end
|
||||
|
||||
def destroy(delete_source_bundle = nil)
|
||||
requires :label, :application_name
|
||||
connection.delete_application_version(application_name, label, delete_source_bundle)
|
||||
true
|
||||
end
|
||||
|
||||
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 = connection.create_application_version(options).body['CreateApplicationVersionResult']['ApplicationVersion']
|
||||
merge_attributes(data)
|
||||
true
|
||||
end
|
||||
|
||||
# Updates the version label with the current property values. Currently only updates description
|
||||
def update
|
||||
requires :label, :application_name
|
||||
|
||||
options = {
|
||||
'ApplicationName' => application_name,
|
||||
'Description' => description,
|
||||
'VersionLabel' => label
|
||||
}
|
||||
options.delete_if {|key, value| value.nil?}
|
||||
|
||||
data = connection.update_application_version(options).body['UpdateApplicationVersionResult']['ApplicationVersion']
|
||||
merge_attributes(data)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
31
lib/fog/aws/models/beanstalk/versions.rb
Normal file
31
lib/fog/aws/models/beanstalk/versions.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
require 'fog/core/collection'
|
||||
require 'fog/aws/models/beanstalk/version'
|
||||
|
||||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
|
||||
class Versions < Fog::Collection
|
||||
model Fog::AWS::ElasticBeanstalk::Version
|
||||
|
||||
def all(options={})
|
||||
data = connection.describe_application_versions(options).body['DescribeApplicationVersionsResult']['ApplicationVersions']
|
||||
load(data) # data is an array of attribute hashes
|
||||
end
|
||||
|
||||
def get(application_name, version_label)
|
||||
if data = connection.describe_application_versions({
|
||||
'ApplicationName' => application_name,
|
||||
'VersionLabels' => [version_label]
|
||||
}).body['DescribeApplicationVersionsResult']['ApplicationVersions']
|
||||
if data.length == 1
|
||||
new(data.first)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
19
lib/fog/aws/parsers/beanstalk/check_dns_availability.rb
Normal file
19
lib/fog/aws/parsers/beanstalk/check_dns_availability.rb
Normal file
|
@ -0,0 +1,19 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class CheckDNSAvailability < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("CheckDNSAvailabilityResult")
|
||||
tag 'FullyQualifiedCNAME', :string
|
||||
tag 'Available', :boolean
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
24
lib/fog/aws/parsers/beanstalk/create_application.rb
Normal file
24
lib/fog/aws/parsers/beanstalk/create_application.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class CreateApplication < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("CreateApplicationResult")
|
||||
tag 'Application', :object
|
||||
tag 'Versions', :string, :list
|
||||
tag 'ConfigurationTemplates', :string, :list
|
||||
tag 'ApplicationName', :string
|
||||
tag 'Description', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
26
lib/fog/aws/parsers/beanstalk/create_application_version.rb
Normal file
26
lib/fog/aws/parsers/beanstalk/create_application_version.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class CreateApplicationVersion < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("CreateApplicationVersionResult")
|
||||
tag 'ApplicationVersion', :object
|
||||
tag 'ApplicationName', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'Description', :string
|
||||
tag 'SourceBundle', :object
|
||||
tag 'S3Bucket', :string
|
||||
tag 'S3Key', :string
|
||||
tag 'VersionLabel', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class CreateConfigurationTemplate < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("CreateConfigurationTemplateResult")
|
||||
tag 'ApplicationName', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'DeploymentStatus', :string
|
||||
tag 'Description', :string
|
||||
tag 'EnvironmentName', :string
|
||||
tag 'OptionSettings', :object, :list
|
||||
tag 'Namespace', :string
|
||||
tag 'OptionName', :string
|
||||
tag 'Value', :string
|
||||
tag 'SolutionStackName', :string
|
||||
tag 'TemplateName', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
37
lib/fog/aws/parsers/beanstalk/create_environment.rb
Normal file
37
lib/fog/aws/parsers/beanstalk/create_environment.rb
Normal file
|
@ -0,0 +1,37 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class CreateEnvironment < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("CreateEnvironmentResult")
|
||||
tag 'ApplicationName', :string
|
||||
tag 'CNAME', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'Description', :string
|
||||
tag 'EndpointURL', :string
|
||||
tag 'EnvironmentId', :string
|
||||
tag 'EnvironmentName', :string
|
||||
tag 'Health', :string
|
||||
tag 'Resources', :object
|
||||
tag 'LoadBalancer', :object
|
||||
tag 'Domain', :string
|
||||
tag 'LoadBalancerName', :string
|
||||
tag 'Listeners', :object, :list
|
||||
tag 'Port', :integer
|
||||
tag 'Protocol', :string
|
||||
tag 'SolutionStackName', :string
|
||||
tag 'Status', :string
|
||||
tag 'TemplateName', :string
|
||||
tag 'VersionLabel', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
18
lib/fog/aws/parsers/beanstalk/create_storage_location.rb
Normal file
18
lib/fog/aws/parsers/beanstalk/create_storage_location.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class CreateStorageLocation < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("CreateStorageLocationResult")
|
||||
tag 'S3Bucket', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class DescribeApplicationVersions < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("DescribeApplicationVersionsResult")
|
||||
tag 'ApplicationVersions', :object, :list
|
||||
tag 'ApplicationName', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'Description', :string
|
||||
tag 'SourceBundle', :object
|
||||
tag 'S3Bucket', :string
|
||||
tag 'S3Key', :string
|
||||
tag 'VersionLabel', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
24
lib/fog/aws/parsers/beanstalk/describe_applications.rb
Normal file
24
lib/fog/aws/parsers/beanstalk/describe_applications.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class DescribeApplications < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("DescribeApplicationsResult")
|
||||
tag 'Applications', :object, :list
|
||||
tag 'Versions', :string, :list
|
||||
tag 'ConfigurationTemplates', :string, :list
|
||||
tag 'ApplicationName', :string
|
||||
tag 'Description', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,32 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class DescribeConfigurationOptions < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("DescribeConfigurationOptionsResult")
|
||||
tag 'SolutionStackName', :string
|
||||
tag 'Options', :object, :list
|
||||
tag 'ChangeSeverity', :string
|
||||
tag 'DefaultValue', :string
|
||||
tag 'MaxLength', :integer
|
||||
tag 'MaxValue', :integer
|
||||
tag 'MinValue', :integer
|
||||
tag 'Name', :string
|
||||
tag 'Namespace', :string
|
||||
tag 'Regex', :object
|
||||
tag 'Label', :string
|
||||
tag 'Pattern', :string
|
||||
tag 'UserDefined', :boolean
|
||||
tag 'ValueOptions', :string, :list
|
||||
tag 'ValueType', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,30 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class DescribeConfigurationSettings < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("DescribeConfigurationSettingsResult")
|
||||
tag 'ConfigurationSettings', :object, :list
|
||||
tag 'ApplicationName', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'DeploymentStatus', :string
|
||||
tag 'Description', :string
|
||||
tag 'EnvironmentName', :string
|
||||
tag 'OptionSettings', :object, :list
|
||||
tag 'Namespace', :string
|
||||
tag 'OptionName', :string
|
||||
tag 'Value', :string
|
||||
tag 'SolutionStackName', :string
|
||||
tag 'TemplateName', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class DescribeEnvironmentResources < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("DescribeEnvironmentResourcesResult")
|
||||
tag 'EnvironmentResources', :object
|
||||
tag 'AutoScalingGroups', :object, :list
|
||||
tag 'Name', :string
|
||||
tag 'EnvironmentName', :string
|
||||
tag 'Instances', :object, :list
|
||||
tag 'Id', :string
|
||||
tag 'LaunchConfigurations', :object, :list
|
||||
tag 'LoadBalancers', :object, :list
|
||||
tag 'Triggers', :object, :list
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
38
lib/fog/aws/parsers/beanstalk/describe_environments.rb
Normal file
38
lib/fog/aws/parsers/beanstalk/describe_environments.rb
Normal file
|
@ -0,0 +1,38 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class DescribeEnvironments < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("DescribeEnvironmentsResult")
|
||||
tag 'Environments', :object, :list
|
||||
tag 'ApplicationName', :string
|
||||
tag 'CNAME', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'Description', :string
|
||||
tag 'EndpointURL', :string
|
||||
tag 'EnvironmentId', :string
|
||||
tag 'EnvironmentName', :string
|
||||
tag 'Health', :string
|
||||
tag 'Resources', :object
|
||||
tag 'LoadBalancer', :object
|
||||
tag 'Domain', :string
|
||||
tag 'LoadBalancerName', :string
|
||||
tag 'Listeners', :object, :list
|
||||
tag 'Port', :integer
|
||||
tag 'Protocol', :string
|
||||
tag 'SolutionStackName', :string
|
||||
tag 'Status', :string
|
||||
tag 'TemplateName', :string
|
||||
tag 'VersionLabel', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
27
lib/fog/aws/parsers/beanstalk/describe_events.rb
Normal file
27
lib/fog/aws/parsers/beanstalk/describe_events.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class DescribeEvents < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("DescribeEventsResult")
|
||||
tag 'Events', :object, :list
|
||||
tag 'ApplicationName', :string
|
||||
tag 'EnvironmentName', :string
|
||||
tag 'EventDate', :datetime
|
||||
tag 'Message', :string
|
||||
tag 'RequestId', :string
|
||||
tag 'Severity', :string
|
||||
tag 'TemplateName', :string
|
||||
tag 'VersionLabel', :string
|
||||
tag 'NextToken', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
27
lib/fog/aws/parsers/beanstalk/empty.rb
Normal file
27
lib/fog/aws/parsers/beanstalk/empty.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
class Empty < Fog::Parsers::Base
|
||||
|
||||
def reset
|
||||
@response = { 'ResponseMetadata' => {} }
|
||||
end
|
||||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'RequestId'
|
||||
@response['ResponseMetadata'][name] = value
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class ListAvailableSolutionStacks < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("ListAvailableSolutionStacksResult")
|
||||
tag 'SolutionStackDetails', :object, :list
|
||||
tag 'PermittedFileTypes', :string, :list
|
||||
tag 'SolutionStackName', :string
|
||||
tag 'SolutionStacks', :string, :list
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
93
lib/fog/aws/parsers/beanstalk/parser.rb
Normal file
93
lib/fog/aws/parsers/beanstalk/parser.rb
Normal file
|
@ -0,0 +1,93 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
class BaseParser < Fog::Parsers::Base
|
||||
|
||||
def initialize(result_name)
|
||||
@result_name = result_name # Set before super, since super calls reset
|
||||
super()
|
||||
@tags = {}
|
||||
@list_tags = {}
|
||||
end
|
||||
|
||||
def reset
|
||||
@response = { @result_name => {}, 'ResponseMetadata' => {} }
|
||||
# Push root object to top of stack
|
||||
@parse_stack = [ { :type => :object, :value => @response[@result_name]} ]
|
||||
end
|
||||
|
||||
|
||||
def tag name, *traits
|
||||
if traits.delete(:list)
|
||||
@list_tags[name] = true
|
||||
end
|
||||
|
||||
if traits.length == 1
|
||||
@tags[name] = traits.last
|
||||
else
|
||||
raise "Too many traits specified, only specify :list or a type"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def start_element(name, attrs = [])
|
||||
super
|
||||
if name == 'member'
|
||||
if @parse_stack.last[:type] == :object
|
||||
@parse_stack.last[:value] << {} # Push any empty object
|
||||
end
|
||||
elsif @list_tags.has_key?(name)
|
||||
set_value(name, [], :array) # Set an empty array
|
||||
@parse_stack.push({ :type => @tags[name], :value => get_parent[name] })
|
||||
elsif @tags[name] == :object
|
||||
set_value(name, {}, :object)
|
||||
@parse_stack.push({ :type => @tags[name], :value => get_parent[name] })
|
||||
end
|
||||
end
|
||||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'member'
|
||||
if @parse_stack.last[:type] != :object
|
||||
@parse_stack.last[:value] << value
|
||||
end
|
||||
when 'RequestId'
|
||||
@response['ResponseMetadata'][name] = value
|
||||
else
|
||||
if @list_tags.has_key?(name) || @tags[name] == :object
|
||||
@parse_stack.pop()
|
||||
elsif @tags.has_key?(name)
|
||||
set_value(name, value, @tags[name])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def get_parent
|
||||
parent = @parse_stack.last[:value]
|
||||
parent.is_a?(Array) ? parent.last : parent
|
||||
end
|
||||
|
||||
def set_value(name, value, type)
|
||||
case type
|
||||
when :datetime
|
||||
get_parent[name] = Time.parse value
|
||||
when :boolean
|
||||
get_parent[name] = value == "true" # True only if value is true
|
||||
when :integer
|
||||
get_parent[name] = value.to_i
|
||||
else
|
||||
get_parent[name] = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
22
lib/fog/aws/parsers/beanstalk/retrieve_environment_info.rb
Normal file
22
lib/fog/aws/parsers/beanstalk/retrieve_environment_info.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class RetrieveEnvironmentInfo < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("RetrieveEnvironmentInfoResult")
|
||||
tag 'EnvironmentInfo', :object, :list
|
||||
tag 'Ec2InstanceId', :string
|
||||
tag 'InfoType', :string
|
||||
tag 'Message', :string
|
||||
tag 'SampleTimestamp', :datetime
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
37
lib/fog/aws/parsers/beanstalk/terminate_environment.rb
Normal file
37
lib/fog/aws/parsers/beanstalk/terminate_environment.rb
Normal file
|
@ -0,0 +1,37 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class TerminateEnvironment < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("TerminateEnvironmentResult")
|
||||
tag 'ApplicationName', :string
|
||||
tag 'CNAME', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'Description', :string
|
||||
tag 'EndpointURL', :string
|
||||
tag 'EnvironmentId', :string
|
||||
tag 'EnvironmentName', :string
|
||||
tag 'Health', :string
|
||||
tag 'Resources', :object
|
||||
tag 'LoadBalancer', :object
|
||||
tag 'Domain', :string
|
||||
tag 'LoadBalancerName', :string
|
||||
tag 'Listeners', :object, :list
|
||||
tag 'Port', :integer
|
||||
tag 'Protocol', :string
|
||||
tag 'SolutionStackName', :string
|
||||
tag 'Status', :string
|
||||
tag 'TemplateName', :string
|
||||
tag 'VersionLabel', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
24
lib/fog/aws/parsers/beanstalk/update_application.rb
Normal file
24
lib/fog/aws/parsers/beanstalk/update_application.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class UpdateApplication < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("UpdateApplicationResult")
|
||||
tag 'Application', :object
|
||||
tag 'Versions', :string, :list
|
||||
tag 'ConfigurationTemplates', :string, :list
|
||||
tag 'ApplicationName', :string
|
||||
tag 'Description', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
26
lib/fog/aws/parsers/beanstalk/update_application_version.rb
Normal file
26
lib/fog/aws/parsers/beanstalk/update_application_version.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class UpdateApplicationVersion < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("UpdateApplicationVersionResult")
|
||||
tag 'ApplicationVersion', :object
|
||||
tag 'ApplicationName', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'Description', :string
|
||||
tag 'SourceBundle', :object
|
||||
tag 'S3Bucket', :string
|
||||
tag 'S3Key', :string
|
||||
tag 'VersionLabel', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class UpdateConfigurationTemplate < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("UpdateConfigurationTemplateResult")
|
||||
tag 'ApplicationName', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'DeploymentStatus', :string
|
||||
tag 'Description', :string
|
||||
tag 'EnvironmentName', :string
|
||||
tag 'OptionSettings', :object, :list
|
||||
tag 'Namespace', :string
|
||||
tag 'OptionName', :string
|
||||
tag 'Value', :string
|
||||
tag 'SolutionStackName', :string
|
||||
tag 'TemplateName', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
37
lib/fog/aws/parsers/beanstalk/update_environment.rb
Normal file
37
lib/fog/aws/parsers/beanstalk/update_environment.rb
Normal file
|
@ -0,0 +1,37 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class UpdateEnvironment < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("UpdateEnvironmentResult")
|
||||
tag 'ApplicationName', :string
|
||||
tag 'CNAME', :string
|
||||
tag 'DateCreated', :datetime
|
||||
tag 'DateUpdated', :datetime
|
||||
tag 'Description', :string
|
||||
tag 'EndpointURL', :string
|
||||
tag 'EnvironmentId', :string
|
||||
tag 'EnvironmentName', :string
|
||||
tag 'Health', :string
|
||||
tag 'Resources', :object
|
||||
tag 'LoadBalancer', :object
|
||||
tag 'Domain', :string
|
||||
tag 'LoadBalancerName', :string
|
||||
tag 'Listeners', :object, :list
|
||||
tag 'Port', :integer
|
||||
tag 'Protocol', :string
|
||||
tag 'SolutionStackName', :string
|
||||
tag 'Status', :string
|
||||
tag 'TemplateName', :string
|
||||
tag 'VersionLabel', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,22 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module ElasticBeanstalk
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/parser'
|
||||
class ValidateConfigurationSettings < Fog::Parsers::AWS::ElasticBeanstalk::BaseParser
|
||||
|
||||
def initialize
|
||||
super("ValidateConfigurationSettingsResult")
|
||||
tag 'Messages', :object, :list
|
||||
tag 'Message', :string
|
||||
tag 'Namespace', :string
|
||||
tag 'OptionName', :string
|
||||
tag 'Severity', :string
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
27
lib/fog/aws/requests/beanstalk/check_dns_availability.rb
Normal file
27
lib/fog/aws/requests/beanstalk/check_dns_availability.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/check_dns_availability'
|
||||
|
||||
# Checks if the specified CNAME is available.
|
||||
#
|
||||
# ==== Options
|
||||
# * CNAMEPrefix<~String>: The prefix used when this CNAME is reserved
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CheckDNSAvailability.html
|
||||
#
|
||||
def check_dns_availability(options)
|
||||
request({
|
||||
'Operation' => 'CheckDNSAvailability',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::CheckDNSAvailability.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
29
lib/fog/aws/requests/beanstalk/create_application.rb
Normal file
29
lib/fog/aws/requests/beanstalk/create_application.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/create_application'
|
||||
|
||||
# Creates an application that has one configuration template named default and no application versions.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: The name of the application.
|
||||
# * Description<~String>: Describes the application.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CreateApplication.html
|
||||
#
|
||||
def create_application(options={})
|
||||
request({
|
||||
'Operation' => 'CreateApplication',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::CreateApplication.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
41
lib/fog/aws/requests/beanstalk/create_application_version.rb
Normal file
41
lib/fog/aws/requests/beanstalk/create_application_version.rb
Normal file
|
@ -0,0 +1,41 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/create_application_version'
|
||||
|
||||
# Creates an application version for the specified application.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: The name of the application. If no application is found with this name,
|
||||
# and AutoCreateApplication is false, returns an InvalidParameterValue error.
|
||||
# * AutoCreateApplication<~Boolean>: If true, create the application if it doesn't exist.
|
||||
# * Description<~String>: Describes this version.
|
||||
# * SourceBundle<~Hash>: The Amazon S3 bucket and key that identify the location of the source bundle
|
||||
# for this version. Use keys 'S3Bucket' and 'S3Key' to describe location.
|
||||
# * VersionLabel<~String>: A label identifying this version.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CreateApplicationVersion.html
|
||||
#
|
||||
def create_application_version(options={})
|
||||
if source_bundle = options.delete('SourceBundle')
|
||||
# flatten hash
|
||||
options.merge!({
|
||||
'SourceBundle.S3Bucket' => source_bundle['S3Bucket'],
|
||||
'SourceBundle.S3Key' => source_bundle['S3Key']
|
||||
})
|
||||
end
|
||||
request({
|
||||
'Operation' => 'CreateApplicationVersion',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::CreateApplicationVersion.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,44 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/create_configuration_template'
|
||||
|
||||
# Creates a configuration template. Templates are associated with a specific application and are used to
|
||||
# deploy different versions of the application with the same configuration settings.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: The name of the application to associate with this configuration template.
|
||||
# If no application is found with this name, AWS Elastic Beanstalk returns an InvalidParameterValue error.
|
||||
# * Description<~String>: Describes this configuration.
|
||||
# * EnvironmentId<~String>: The ID of the environment used with this configuration template.
|
||||
# * OptionSettings<~Hash>: If specified, AWS Elastic Beanstalk sets the specified configuration option
|
||||
# to the requested value. The new value overrides the value obtained from the solution stack or the
|
||||
# source configuration template.
|
||||
# * SolutionStackName<~String>: The name of the solution stack used by this configuration. The solution
|
||||
# stack specifies the operating system, architecture, and application server for a configuration template.
|
||||
# It determines the set of configuration options as well as the possible and default values.
|
||||
# * SourceConfiguration<~String>: If specified, AWS Elastic Beanstalk uses the configuration values from the
|
||||
# specified configuration template to create a new configuration.
|
||||
# * TemplateName<~String>: The name of the configuration template.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CreateConfigurationTemplate.html
|
||||
#
|
||||
def create_configuration_template(options={})
|
||||
if option_settings = options.delete('OptionSettings')
|
||||
options.merge!(AWS.indexed_param('OptionSettings.member.%d', [*option_settings]))
|
||||
end
|
||||
request({
|
||||
'Operation' => 'CreateConfigurationTemplate',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::CreateConfigurationTemplate.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
50
lib/fog/aws/requests/beanstalk/create_environment.rb
Normal file
50
lib/fog/aws/requests/beanstalk/create_environment.rb
Normal file
|
@ -0,0 +1,50 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/create_environment'
|
||||
|
||||
# Launches an environment for the specified application using the specified configuration.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: If specified, AWS Elastic Beanstalk restricts the returned descriptions
|
||||
# to include only those that are associated with this application.
|
||||
# * CNAMEPrefix<~String>: If specified, the environment attempts to use this value as the prefix for the CNAME.
|
||||
# If not specified, the environment uses the environment name.
|
||||
# * Description<~String>: Describes this environment.
|
||||
# * EnvironmentName<~String>: A unique name for the deployment environment. Used in the application URL.
|
||||
# * OptionSettings<~Array>: If specified, AWS Elastic Beanstalk sets the specified configuration options to
|
||||
# the requested value in the configuration set for the new environment. These override the values obtained
|
||||
# from the solution stack or the configuration template.
|
||||
# * OptionsToRemove<~Array>: A list of custom user-defined configuration options to remove from the
|
||||
# configuration set for this new environment.
|
||||
# * SolutionStackName<~String>: This is an alternative to specifying a configuration name. If specified,
|
||||
# AWS Elastic Beanstalk sets the configuration values to the default values associated with the
|
||||
# specified solution stack.
|
||||
# * TemplateName<~String>: The name of the configuration template to use in deployment. If no configuration
|
||||
# template is found with this name, AWS Elastic Beanstalk returns an InvalidParameterValue error.
|
||||
# * VersionLabel<~String>: The name of the application version to deploy.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CreateEnvironment.html
|
||||
#
|
||||
def create_environment(options={})
|
||||
if option_settings = options.delete('OptionSettings')
|
||||
options.merge!(AWS.indexed_param('OptionSettings.member.%d', [*option_settings]))
|
||||
end
|
||||
if options_to_remove = options.delete('OptionsToRemove')
|
||||
options.merge!(AWS.indexed_param('OptionsToRemove.member.%d', [*options_to_remove]))
|
||||
end
|
||||
request({
|
||||
'Operation' => 'CreateEnvironment',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::CreateEnvironment.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
27
lib/fog/aws/requests/beanstalk/create_storage_location.rb
Normal file
27
lib/fog/aws/requests/beanstalk/create_storage_location.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/create_storage_location'
|
||||
|
||||
# Creates the Amazon S3 storage location for the account.
|
||||
#
|
||||
# ==== Options
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CreateStorageLocation.html
|
||||
#
|
||||
def create_storage_location()
|
||||
request({
|
||||
'Operation' => 'CreateStorageLocation',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::CreateStorageLocation.new
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
29
lib/fog/aws/requests/beanstalk/delete_application.rb
Normal file
29
lib/fog/aws/requests/beanstalk/delete_application.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/empty'
|
||||
|
||||
# Deletes the specified application along with all associated versions and configurations.
|
||||
#
|
||||
# ==== Options
|
||||
# * application_name<~String>: The name of the application to delete.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DeleteApplication.html
|
||||
#
|
||||
def delete_application(application_name)
|
||||
options = { 'ApplicationName' => application_name }
|
||||
request({
|
||||
'Operation' => 'DeleteApplication',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::Empty.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
36
lib/fog/aws/requests/beanstalk/delete_application_version.rb
Normal file
36
lib/fog/aws/requests/beanstalk/delete_application_version.rb
Normal file
|
@ -0,0 +1,36 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/empty'
|
||||
|
||||
# Deletes the specified version from the specified application.
|
||||
#
|
||||
# ==== Options
|
||||
# * application_name<~String>: The name of the application to delete releases from.
|
||||
# * version_label<~String>: The label of the version to delete.
|
||||
# * delete_source_bundle<~Boolean>: Indicates whether to delete the associated source bundle from Amazon S3.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DeleteApplication.html
|
||||
#
|
||||
def delete_application_version(application_name, version_label, delete_source_bundle = nil)
|
||||
options = {
|
||||
'ApplicationName' => application_name,
|
||||
'VersionLabel' => version_label
|
||||
}
|
||||
options['DeleteSourceBundle'] = delete_source_bundle unless delete_source_bundle.nil?
|
||||
|
||||
request({
|
||||
'Operation' => 'DeleteApplicationVersion',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::Empty.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,34 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/empty'
|
||||
|
||||
# Deletes the specified configuration template.
|
||||
#
|
||||
# ==== Options
|
||||
# * application_name<~String>: The name of the application to delete the configuration template from.
|
||||
# * template_name<~String>: The name of the configuration template to delete.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DeleteConfigurationTemplate.html
|
||||
#
|
||||
def delete_configuration_template(application_name, template_name)
|
||||
options = {
|
||||
'ApplicationName' => application_name,
|
||||
'TemplateName' => template_name
|
||||
}
|
||||
|
||||
request({
|
||||
'Operation' => 'DeleteConfigurationTemplate',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::Empty.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,34 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/empty'
|
||||
|
||||
# Deletes the draft configuration associated with the running environment.
|
||||
#
|
||||
# ==== Options
|
||||
# * application_name<~String>: The name of the application the environment is associated with.
|
||||
# * environment_name<~String>: The name of the environment to delete the draft configuration from.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DeleteConfigurationTemplate.html
|
||||
#
|
||||
def delete_environment_configuration(application_name, environment_name)
|
||||
options = {
|
||||
'ApplicationName' => application_name,
|
||||
'EnvironmentName' => environment_name
|
||||
}
|
||||
|
||||
request({
|
||||
'Operation' => 'DeleteEnvironmentConfiguration',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::Empty.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,34 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/describe_application_versions'
|
||||
|
||||
# Returns descriptions for existing application versions.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: If specified, AWS Elastic Beanstalk restricts the returned descriptions to
|
||||
# only include ones that are associated with the specified application.
|
||||
# * VersionLabels<~Array>: If specified, restricts the returned descriptions to only include ones that have
|
||||
# the specified version labels.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DescribeApplicationVersions.html
|
||||
#
|
||||
def describe_application_versions(options={})
|
||||
if version_labels = options.delete('VersionLabels')
|
||||
options.merge!(AWS.indexed_param('VersionLabels.member.%d', [*version_labels]))
|
||||
end
|
||||
request({
|
||||
'Operation' => 'DescribeApplicationVersions',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeApplicationVersions.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
30
lib/fog/aws/requests/beanstalk/describe_applications.rb
Normal file
30
lib/fog/aws/requests/beanstalk/describe_applications.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/describe_applications'
|
||||
|
||||
# Returns the descriptions of existing applications.
|
||||
#
|
||||
# ==== Options
|
||||
# * application_names<~Array>: If specified, AWS Elastic Beanstalk restricts the returned descriptions
|
||||
# to only include those with the specified names.
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DescribeApplications.html
|
||||
#
|
||||
def describe_applications(application_names=[])
|
||||
options = {}
|
||||
options.merge!(AWS.indexed_param('ApplicationNames.member.%d', [*application_names]))
|
||||
request({
|
||||
'Operation' => 'DescribeApplications',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeApplications.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,40 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/describe_configuration_options'
|
||||
|
||||
# Describes the configuration options that are used in a particular configuration template or environment,
|
||||
# or that a specified solution stack defines. The description includes the values the options,
|
||||
# their default values, and an indication of the required action on a running environment
|
||||
# if an option value is changed.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: The name of the application associated with the configuration template or
|
||||
# environment. Only needed if you want to describe the configuration options associated with either the
|
||||
# configuration template or environment.
|
||||
# * EnvironmentName<~String>: The name of the environment whose configuration options you want to describe.
|
||||
# * Options<~Array>: If specified, restricts the descriptions to only the specified options.
|
||||
# * SolutionStackName<~String>: The name of the solution stack whose configuration options you want to describe.
|
||||
# * TemplateName<~String>: The name of the configuration template whose configuration options you want to describe.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DescribeConfigurationOptions.html
|
||||
#
|
||||
def describe_configuration_options(options={})
|
||||
if option_filters = options.delete('Options')
|
||||
options.merge!(AWS.indexed_param('Options.member.%d', [*option_filters]))
|
||||
end
|
||||
request({
|
||||
'Operation' => 'DescribeConfigurationOptions',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeConfigurationOptions.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,31 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/describe_configuration_settings'
|
||||
|
||||
# Returns a description of the settings for the specified configuration set, that is, either a configuration
|
||||
# template or the configuration set associated with a running environment.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: The application for the environment or configuration template.
|
||||
# * EnvironmentName<~String>: The name of the environment to describe.
|
||||
# * TemplateName<~String>: The name of the configuration template to describe.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DescribeConfigurationSettings.html
|
||||
#
|
||||
def describe_configuration_settings(options={})
|
||||
request({
|
||||
'Operation' => 'DescribeConfigurationSettings',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeConfigurationSettings.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/describe_environment_resources'
|
||||
|
||||
# Returns AWS resources for this environment.
|
||||
#
|
||||
# ==== Options
|
||||
# * EnvironmentId
|
||||
# * EnvironmentName
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DescribeEnvironmentResources.html
|
||||
#
|
||||
def describe_environment_resources(options={})
|
||||
request({
|
||||
'Operation' => 'DescribeEnvironmentResources',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeEnvironmentResources.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
40
lib/fog/aws/requests/beanstalk/describe_environments.rb
Normal file
40
lib/fog/aws/requests/beanstalk/describe_environments.rb
Normal file
|
@ -0,0 +1,40 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/describe_environments'
|
||||
|
||||
# Returns descriptions for existing environments.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: If specified, AWS Elastic Beanstalk restricts the returned descriptions
|
||||
# to include only those that are associated with this application.
|
||||
# * EnvironmentIds
|
||||
# * EnvironmentNames
|
||||
# * IncludeDeleted
|
||||
# * IncludedDeletedBackTo
|
||||
# * VersionLabel<~String>:
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html
|
||||
#
|
||||
def describe_environments(options={})
|
||||
if environment_ids = options.delete('EnvironmentIds')
|
||||
options.merge!(AWS.indexed_param('EnvironmentIds.member.%d', [*environment_ids]))
|
||||
end
|
||||
if environment_names = options.delete('EnvironmentNames')
|
||||
options.merge!(AWS.indexed_param('EnvironmentNames.member.%d', [*environment_names]))
|
||||
end
|
||||
request({
|
||||
'Operation' => 'DescribeEnvironments',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeEnvironments.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
29
lib/fog/aws/requests/beanstalk/describe_events.rb
Normal file
29
lib/fog/aws/requests/beanstalk/describe_events.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/describe_events'
|
||||
|
||||
# Returns list of event descriptions matching criteria up to the last 6 weeks.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: If specified, AWS Elastic Beanstalk restricts the returned descriptions
|
||||
# to include only those that are associated with this application.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_DescribeEnvironments.html
|
||||
#
|
||||
def describe_events(options={})
|
||||
request({
|
||||
'Operation' => 'DescribeEvents',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeEvents.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,27 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/list_available_solution_stacks'
|
||||
|
||||
# Checks if the specified CNAME is available.
|
||||
#
|
||||
# ==== Options
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CheckDNSAvailability.html
|
||||
#
|
||||
def list_available_solution_stacks()
|
||||
request({
|
||||
'Operation' => 'ListAvailableSolutionStacks',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::ListAvailableSolutionStacks.new
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
30
lib/fog/aws/requests/beanstalk/rebuild_environment.rb
Normal file
30
lib/fog/aws/requests/beanstalk/rebuild_environment.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/empty'
|
||||
|
||||
# Deletes and recreates all of the AWS resources (for example: the Auto Scaling group, load balancer, etc.)
|
||||
# for a specified environment and forces a restart.
|
||||
#
|
||||
# ==== Options
|
||||
# * EnvironmentId
|
||||
# * EnvironmentName
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_RebuildEnvironment.html
|
||||
#
|
||||
def rebuild_environment(options={})
|
||||
request({
|
||||
'Operation' => 'RebuildEnvironment',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::Empty.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
29
lib/fog/aws/requests/beanstalk/request_environment_info.rb
Normal file
29
lib/fog/aws/requests/beanstalk/request_environment_info.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/empty'
|
||||
|
||||
# Returns AWS resources for this environment.
|
||||
#
|
||||
# ==== Options
|
||||
# * EnvironmentId
|
||||
# * EnvironmentName
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_RequestEnvironmentInfo.html
|
||||
#
|
||||
def request_environment_info(options={})
|
||||
request({
|
||||
'Operation' => 'RequestEnvironmentInfo',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::Empty.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
29
lib/fog/aws/requests/beanstalk/restart_app_server.rb
Normal file
29
lib/fog/aws/requests/beanstalk/restart_app_server.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/empty'
|
||||
|
||||
# Returns AWS resources for this environment.
|
||||
#
|
||||
# ==== Options
|
||||
# * EnvironmentId
|
||||
# * EnvironmentName
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_RestartAppServer.html
|
||||
#
|
||||
def restart_app_server(options={})
|
||||
request({
|
||||
'Operation' => 'RestartAppServer',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::Empty.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
29
lib/fog/aws/requests/beanstalk/retrieve_environment_info.rb
Normal file
29
lib/fog/aws/requests/beanstalk/retrieve_environment_info.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/retrieve_environment_info'
|
||||
|
||||
# Returns AWS resources for this environment.
|
||||
#
|
||||
# ==== Options
|
||||
# * EnvironmentId
|
||||
# * EnvironmentName
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_RetrieveEnvironmentInfo.html
|
||||
#
|
||||
def retrieve_environment_info(options={})
|
||||
request({
|
||||
'Operation' => 'RetrieveEnvironmentInfo',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::RetrieveEnvironmentInfo.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
29
lib/fog/aws/requests/beanstalk/swap_environment_cnames.rb
Normal file
29
lib/fog/aws/requests/beanstalk/swap_environment_cnames.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/empty'
|
||||
|
||||
# Swaps the CNAMEs of two environments.
|
||||
#
|
||||
# ==== Options
|
||||
# * EnvironmentId
|
||||
# * EnvironmentName
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_SwapEnvironmentCNAMEs.html
|
||||
#
|
||||
def swap_environment_cnames(options={})
|
||||
request({
|
||||
'Operation' => 'SwapEnvironmentCNAMEs',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::Empty.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
31
lib/fog/aws/requests/beanstalk/terminate_environment.rb
Normal file
31
lib/fog/aws/requests/beanstalk/terminate_environment.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/terminate_environment'
|
||||
|
||||
# Terminates the specified environment.
|
||||
#
|
||||
# ==== Options
|
||||
# * EnvironmentId<~String>: The ID of the environment to terminate.
|
||||
# * EnvironmentName<~String>: The name of the environment to terminate.
|
||||
# * TerminateResources<~Boolean>: Indicates whether the associated AWS resources should shut down when the
|
||||
# environment is terminated
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_TerminateEnvironment.html
|
||||
#
|
||||
def terminate_environment(options={})
|
||||
request({
|
||||
'Operation' => 'TerminateEnvironment',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::TerminateEnvironment.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
30
lib/fog/aws/requests/beanstalk/update_application.rb
Normal file
30
lib/fog/aws/requests/beanstalk/update_application.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/update_application'
|
||||
|
||||
# Updates the specified application to have the specified properties.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: The name of the application to update. If no such application is found,
|
||||
# UpdateApplication returns an InvalidParameterValue error.
|
||||
# * Description<~String>: A new description for the application.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_UpdateApplication.html
|
||||
#
|
||||
def update_application(options)
|
||||
request({
|
||||
'Operation' => 'UpdateApplication',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::UpdateApplication.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
30
lib/fog/aws/requests/beanstalk/update_application_version.rb
Normal file
30
lib/fog/aws/requests/beanstalk/update_application_version.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/update_application_version'
|
||||
|
||||
# Updates the specified application version to have the specified properties.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: The name of the application associated with this version.
|
||||
# * VersionLabel<~String>: The name of the version to update.
|
||||
# * Description<~String>: A new description for this release.
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_UpdateApplicationVersion.html
|
||||
#
|
||||
def update_application_version(options)
|
||||
request({
|
||||
'Operation' => 'UpdateApplicationVersion',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::UpdateApplicationVersion.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,36 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/update_configuration_template'
|
||||
|
||||
# Updates the specified configuration template to have the specified properties or configuration option values.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: If specified, AWS Elastic Beanstalk restricts the returned descriptions
|
||||
# to include only those that are associated with this application.
|
||||
# * VersionLabel<~String>:
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CreateConfigurationTemplate.html
|
||||
#
|
||||
def update_configuration_template(options={})
|
||||
if option_settings = options.delete('OptionSettings')
|
||||
options.merge!(AWS.indexed_param('OptionSettings.member.%d', [*option_settings]))
|
||||
end
|
||||
if options_to_remove = options.delete('OptionsToRemove')
|
||||
options.merge!(AWS.indexed_param('OptionsToRemove.member.%d', [*options_to_remove]))
|
||||
end
|
||||
request({
|
||||
'Operation' => 'UpdateConfigurationTemplate',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::UpdateConfigurationTemplate.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
42
lib/fog/aws/requests/beanstalk/update_environment.rb
Normal file
42
lib/fog/aws/requests/beanstalk/update_environment.rb
Normal file
|
@ -0,0 +1,42 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/update_environment'
|
||||
|
||||
# Updates the environment description, deploys a new application version, updates the configuration settings
|
||||
# to an entirely new configuration template, or updates select configuration option values in
|
||||
# the running environment.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: If specified, AWS Elastic Beanstalk restricts the returned descriptions
|
||||
# to include only those that are associated with this application.
|
||||
# * EnvironmentIds
|
||||
# * EnvironmentNames
|
||||
# * IncludeDeleted
|
||||
# * IncludedDeletedBackTo
|
||||
# * VersionLabel<~String>:
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CreateEnvironment.html
|
||||
#
|
||||
def update_environment(options={})
|
||||
if option_settings = options.delete('OptionSettings')
|
||||
options.merge!(AWS.indexed_param('OptionSettings.member.%d', [*option_settings]))
|
||||
end
|
||||
if options_to_remove = options.delete('OptionsToRemove')
|
||||
options.merge!(AWS.indexed_param('OptionsToRemove.member.%d', [*options_to_remove]))
|
||||
end
|
||||
request({
|
||||
'Operation' => 'UpdateEnvironment',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::UpdateEnvironment.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,33 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class ElasticBeanstalk
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/beanstalk/validate_configuration_settings'
|
||||
|
||||
# Updates the specified configuration template to have the specified properties or configuration option values.
|
||||
#
|
||||
# ==== Options
|
||||
# * ApplicationName<~String>: If specified, AWS Elastic Beanstalk restricts the returned descriptions
|
||||
# to include only those that are associated with this application.
|
||||
# * VersionLabel<~String>:
|
||||
#
|
||||
# ==== Returns
|
||||
# * response<~Excon::Response>:
|
||||
#
|
||||
# ==== See Also
|
||||
# http://docs.amazonwebservices.com/elasticbeanstalk/latest/api/API_CreateConfigurationTemplate.html
|
||||
#
|
||||
def validate_configuration_settings(options={})
|
||||
if option_settings = options.delete('OptionSettings')
|
||||
options.merge!(AWS.indexed_param('OptionSettings.member.%d', [*option_settings]))
|
||||
end
|
||||
request({
|
||||
'Operation' => 'ValidateConfigurationSettings',
|
||||
:parser => Fog::Parsers::AWS::ElasticBeanstalk::ValidateConfigurationSettings.new
|
||||
}.merge(options))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue