File: create_application_version.rb

package info (click to toggle)
ruby-fog-aws 3.3.0-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,816 kB
  • sloc: ruby: 68,587; makefile: 6
file content (40 lines) | stat: -rw-r--r-- 1,729 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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