right_aws_api 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/HISTORY +2 -0
  3. data/LICENSE +19 -0
  4. data/README.md +164 -0
  5. data/Rakefile +38 -0
  6. data/lib/cloud/aws/as/manager.rb +118 -0
  7. data/lib/cloud/aws/base/helpers/utils.rb +328 -0
  8. data/lib/cloud/aws/base/manager.rb +186 -0
  9. data/lib/cloud/aws/base/parsers/response_error.rb +117 -0
  10. data/lib/cloud/aws/base/routines/request_signer.rb +80 -0
  11. data/lib/cloud/aws/cf/manager.rb +171 -0
  12. data/lib/cloud/aws/cf/routines/request_signer.rb +70 -0
  13. data/lib/cloud/aws/cf/wrappers/default.rb +213 -0
  14. data/lib/cloud/aws/cfm/manager.rb +90 -0
  15. data/lib/cloud/aws/cw/manager.rb +113 -0
  16. data/lib/cloud/aws/eb/manager.rb +87 -0
  17. data/lib/cloud/aws/ec/manager.rb +91 -0
  18. data/lib/cloud/aws/ec2/manager.rb +222 -0
  19. data/lib/cloud/aws/elb/manager.rb +120 -0
  20. data/lib/cloud/aws/emr/manager.rb +86 -0
  21. data/lib/cloud/aws/iam/manager.rb +100 -0
  22. data/lib/cloud/aws/rds/manager.rb +110 -0
  23. data/lib/cloud/aws/route53/manager.rb +177 -0
  24. data/lib/cloud/aws/route53/routines/request_signer.rb +70 -0
  25. data/lib/cloud/aws/route53/wrappers/default.rb +132 -0
  26. data/lib/cloud/aws/s3/manager.rb +373 -0
  27. data/lib/cloud/aws/s3/parsers/response_error.rb +76 -0
  28. data/lib/cloud/aws/s3/routines/request_signer.rb +243 -0
  29. data/lib/cloud/aws/s3/wrappers/default.rb +315 -0
  30. data/lib/cloud/aws/sdb/manager.rb +150 -0
  31. data/lib/cloud/aws/sns/manager.rb +96 -0
  32. data/lib/cloud/aws/sqs/manager.rb +335 -0
  33. data/lib/right_aws_api.rb +45 -0
  34. data/lib/right_aws_api_version.rb +40 -0
  35. data/right_aws_api.gemspec +55 -0
  36. data/spec/describe_calls.rb +92 -0
  37. metadata +118 -0
@@ -0,0 +1,45 @@
1
+ #--
2
+ # Copyright (c) 2013 RightScale, Inc.
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # 'Software'), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ require 'right_cloud_api_base'
25
+
26
+ $:.unshift(File::expand_path(File::dirname(__FILE__)))
27
+
28
+ require "right_aws_api_version"
29
+
30
+ require "cloud/aws/as/manager"
31
+ require "cloud/aws/cf/manager"
32
+ require "cloud/aws/cfm/manager"
33
+ require "cloud/aws/cw/manager"
34
+ require "cloud/aws/eb/manager"
35
+ require "cloud/aws/ec/manager"
36
+ require "cloud/aws/ec2/manager"
37
+ require "cloud/aws/elb/manager"
38
+ require "cloud/aws/emr/manager"
39
+ require "cloud/aws/iam/manager"
40
+ require "cloud/aws/rds/manager"
41
+ require "cloud/aws/route53/manager"
42
+ require "cloud/aws/s3/manager"
43
+ require "cloud/aws/sdb/manager"
44
+ require "cloud/aws/sns/manager"
45
+ require "cloud/aws/sqs/manager"
@@ -0,0 +1,40 @@
1
+ #--
2
+ # Copyright (c) 2013 RightScale, Inc.
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # 'Software'), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ # Rightscale namespace
25
+ #
26
+ # @api public
27
+ #
28
+ module RightScale
29
+ # CloudApi gem namespace
30
+ module CloudApi
31
+ # AWS namespace
32
+ module AWS
33
+ # Gem version namespace
34
+ module VERSION
35
+ # Current version
36
+ STRING = '0.1.0'
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,55 @@
1
+ #-- -*- mode: ruby; encoding: utf-8 -*-
2
+ # Copyright (c) 2013 RightScale, Inc.
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining
5
+ # a copy of this software and associated documentation files (the
6
+ # 'Software'), to deal in the Software without restriction, including
7
+ # without limitation the rights to use, copy, modify, merge, publish,
8
+ # distribute, sublicense, and/or sell copies of the Software, and to
9
+ # permit persons to whom the Software is furnished to do so, subject to
10
+ # the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be
13
+ # included in all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
16
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+ # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
+ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
+ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ #++
23
+
24
+ require 'rubygems'
25
+ require File.expand_path(File.join(File.dirname(__FILE__), 'lib/right_aws_api_version'))
26
+
27
+ Gem::Specification.new do |spec|
28
+ spec.name = 'right_aws_api'
29
+ spec.version = RightScale::CloudApi::AWS::VERSION::STRING
30
+ spec.authors = ['RightScale, Inc.']
31
+ spec.email = 'support@rightscale.com'
32
+ spec.summary = 'The gem provides interface to AWS cloud services.'
33
+ spec.rdoc_options = ['--main', 'README.md', '--title', '']
34
+ spec.extra_rdoc_files = ['README.md']
35
+ spec.require_path = 'lib'
36
+ spec.required_ruby_version = '>= 1.8.7'
37
+
38
+ spec.add_dependency 'right_cloud_api_base', '>= 0.1.0'
39
+
40
+ spec.add_development_dependency 'rake'
41
+
42
+ spec.description = <<-EOF
43
+ == DESCRIPTION:
44
+
45
+ right_aws_api gem.
46
+
47
+ The gem provides interface to AWS cloud services.
48
+
49
+ EOF
50
+
51
+ candidates = Dir.glob('{lib,spec}/**/*') +
52
+ ['LICENSE', 'HISTORY', 'README.md', 'Rakefile', 'right_aws_api.gemspec']
53
+ spec.files = candidates.sort
54
+ spec.test_files = Dir.glob('spec/**/*')
55
+ end
@@ -0,0 +1,92 @@
1
+ require 'cloud/aws/ec2/manager'
2
+ require 'rspec'
3
+
4
+ describe RightScale::CloudApi::AWS do
5
+ context "describe calls" do
6
+
7
+ SCENARIOS = {
8
+ :describe_instances => {
9
+ :action => :DescribeInstances,
10
+ :params => {},
11
+ :setkey => 'reservationSet'
12
+ },
13
+ :describe_addresses => {
14
+ :action => :DescribeAddresses,
15
+ :params => {},
16
+ :setkey => 'addressesSet'
17
+ },
18
+ :describe_availability_zones => {
19
+ :action => :DescribeAvailabilityZones,
20
+ :params => {},
21
+ :setkey => 'availabilityZoneInfo'
22
+ },
23
+ :describe_internet_gateways => {
24
+ :action => :DescribeInternetGateways,
25
+ :params => {},
26
+ :setkey => 'internetGatewaySet'
27
+ },
28
+ :describe_key_pairs => {
29
+ :action => :DescribeKeyPairs,
30
+ :params => {},
31
+ :setkey => 'keySet'
32
+ },
33
+ :describe_network_acls => {
34
+ :action => :DescribeNetworkAcls,
35
+ :params => {},
36
+ :setkey => 'networkAclSet'
37
+ },
38
+ :describe_placement_groups => {
39
+ :action => :DescribePlacementGroups,
40
+ :params => {},
41
+ :setkey => 'placementGroupSet'
42
+ },
43
+ :describe_route_tables => {
44
+ :action => :DescribeRouteTables,
45
+ :params => {},
46
+ :setkey => 'routeTableSet'
47
+ },
48
+ :describe_security_groups => {
49
+ :action => :DescribeSecurityGroups,
50
+ :params => {},
51
+ :setkey => 'securityGroupInfo'
52
+ },
53
+ :describe_snapshots => {
54
+ :action => :DescribeSnapshots,
55
+ :params => {},
56
+ :setkey => 'snapshotSet'
57
+ },
58
+ :describe_subnets => {
59
+ :action => :DescribeSubnets,
60
+ :params => {},
61
+ :setkey => 'subnetSet'
62
+ },
63
+ :describe_volumes => {
64
+ :action => :DescribeVolumes,
65
+ :params => {},
66
+ :setkey => 'volumeSet'
67
+ },
68
+ :describe_vpcs => {
69
+ :action => :DescribeVpcs,
70
+ :params => {},
71
+ :setkey => 'vpcSet'
72
+ },
73
+ }
74
+
75
+ it "work as expected when real creds are provided through ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']" do
76
+ ec2 = RightScale::CloudApi::AWS::EC2::Manager::new(
77
+ ENV['AWS_ACCESS_KEY_ID'],
78
+ ENV['AWS_SECRET_ACCESS_KEY'],
79
+ 'https://us-east-1.ec2.amazonaws.com/',
80
+ :api_version => '2011-07-15',
81
+ :logger => nil )
82
+
83
+ SCENARIOS.each_pair do | scenario_name, scenario_data |
84
+ begin
85
+ action = scenario_data[:action]
86
+ response = ec2.__send__(action, scenario_data[:params])
87
+ response["#{action}Response"].should_not be(ni)
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: right_aws_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - RightScale, Inc.
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: right_cloud_api_base
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: |+
42
+ == DESCRIPTION:
43
+
44
+ right_aws_api gem.
45
+
46
+ The gem provides interface to AWS cloud services.
47
+
48
+ email: support@rightscale.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files:
52
+ - README.md
53
+ files:
54
+ - HISTORY
55
+ - LICENSE
56
+ - README.md
57
+ - Rakefile
58
+ - lib/cloud/aws/as/manager.rb
59
+ - lib/cloud/aws/base/helpers/utils.rb
60
+ - lib/cloud/aws/base/manager.rb
61
+ - lib/cloud/aws/base/parsers/response_error.rb
62
+ - lib/cloud/aws/base/routines/request_signer.rb
63
+ - lib/cloud/aws/cf/manager.rb
64
+ - lib/cloud/aws/cf/routines/request_signer.rb
65
+ - lib/cloud/aws/cf/wrappers/default.rb
66
+ - lib/cloud/aws/cfm/manager.rb
67
+ - lib/cloud/aws/cw/manager.rb
68
+ - lib/cloud/aws/eb/manager.rb
69
+ - lib/cloud/aws/ec/manager.rb
70
+ - lib/cloud/aws/ec2/manager.rb
71
+ - lib/cloud/aws/elb/manager.rb
72
+ - lib/cloud/aws/emr/manager.rb
73
+ - lib/cloud/aws/iam/manager.rb
74
+ - lib/cloud/aws/rds/manager.rb
75
+ - lib/cloud/aws/route53/manager.rb
76
+ - lib/cloud/aws/route53/routines/request_signer.rb
77
+ - lib/cloud/aws/route53/wrappers/default.rb
78
+ - lib/cloud/aws/s3/manager.rb
79
+ - lib/cloud/aws/s3/parsers/response_error.rb
80
+ - lib/cloud/aws/s3/routines/request_signer.rb
81
+ - lib/cloud/aws/s3/wrappers/default.rb
82
+ - lib/cloud/aws/sdb/manager.rb
83
+ - lib/cloud/aws/sns/manager.rb
84
+ - lib/cloud/aws/sqs/manager.rb
85
+ - lib/right_aws_api.rb
86
+ - lib/right_aws_api_version.rb
87
+ - right_aws_api.gemspec
88
+ - spec/describe_calls.rb
89
+ homepage:
90
+ licenses: []
91
+ metadata: {}
92
+ post_install_message:
93
+ rdoc_options:
94
+ - "--main"
95
+ - README.md
96
+ - "--title"
97
+ - ''
98
+ require_paths:
99
+ - lib
100
+ required_ruby_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 1.8.7
105
+ required_rubygems_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ requirements: []
111
+ rubyforge_project:
112
+ rubygems_version: 2.1.11
113
+ signing_key:
114
+ specification_version: 4
115
+ summary: The gem provides interface to AWS cloud services.
116
+ test_files:
117
+ - spec/describe_calls.rb
118
+ has_rdoc: