right_aws_api 0.3.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2015 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 "cloud/aws/base/manager"
25
+
26
+ module RightScale
27
+ module CloudApi
28
+ module MWS
29
+
30
+ module FulfillmentOutboundShipment
31
+
32
+ class Manager < MWS::Manager
33
+ end
34
+
35
+ class ApiManager < MWS::ApiManager
36
+ DEFAULT_API_VERSION = '2010-10-01'
37
+ WMS_SERVICE_PATH = 'FulfillmentOutboundShipment'
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2015 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 "cloud/aws/base/manager"
25
+
26
+ module RightScale
27
+ module CloudApi
28
+ module MWS
29
+
30
+ module Orders
31
+
32
+ class Manager < MWS::Manager
33
+ end
34
+
35
+ class ApiManager < MWS::ApiManager
36
+ DEFAULT_API_VERSION = '2013-09-01'
37
+ WMS_SERVICE_PATH = 'Orders'
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2015 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 "cloud/aws/base/manager"
25
+
26
+ module RightScale
27
+ module CloudApi
28
+ module MWS
29
+
30
+ module Products
31
+
32
+ class Manager < MWS::Manager
33
+ end
34
+
35
+ class ApiManager < MWS::ApiManager
36
+ DEFAULT_API_VERSION = '2011-10-01'
37
+ WMS_SERVICE_PATH = 'Products'
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2015 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 "cloud/aws/base/manager"
25
+
26
+ module RightScale
27
+ module CloudApi
28
+ module MWS
29
+
30
+ module Recommendations
31
+
32
+ class Manager < MWS::Manager
33
+ end
34
+
35
+ class ApiManager < MWS::ApiManager
36
+ DEFAULT_API_VERSION = '2013-04-01'
37
+ WMS_SERVICE_PATH = 'Recommendations'
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2015 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 "cloud/aws/base/manager"
25
+
26
+ module RightScale
27
+ module CloudApi
28
+ module MWS
29
+
30
+ module Reports
31
+
32
+ class Manager < MWS::Manager
33
+ end
34
+
35
+ class ApiManager < MWS::ApiManager
36
+ DEFAULT_API_VERSION = '2009-01-01'
37
+ WMS_SERVICE_PATH = nil
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2015 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 "cloud/aws/base/manager"
25
+
26
+ module RightScale
27
+ module CloudApi
28
+ module MWS
29
+
30
+ module Sellers
31
+
32
+ class Manager < MWS::Manager
33
+ end
34
+
35
+ class ApiManager < MWS::ApiManager
36
+ DEFAULT_API_VERSION = '2011-07-01'
37
+ WMS_SERVICE_PATH = 'Sellers'
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2015 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 "cloud/aws/base/manager"
25
+
26
+ module RightScale
27
+ module CloudApi
28
+ module MWS
29
+
30
+ module Subscriptions
31
+
32
+ class Manager < MWS::Manager
33
+ end
34
+
35
+ class ApiManager < MWS::ApiManager
36
+ DEFAULT_API_VERSION = '2013-07-01'
37
+ WMS_SERVICE_PATH = 'Subscriptions'
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,43 @@
1
+ #--
2
+ # Copyright (c) 2015 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 "cloud/aws/base/manager"
25
+
26
+ module RightScale
27
+ module CloudApi
28
+ module MWS
29
+
30
+ module Webstore
31
+
32
+ class Manager < MWS::Manager
33
+ end
34
+
35
+ class ApiManager < MWS::ApiManager
36
+ DEFAULT_API_VERSION = '2014-09-01'
37
+ WMS_SERVICE_PATH = 'Webstore'
38
+ end
39
+ end
40
+
41
+ end
42
+ end
43
+ end
data/lib/right_aws_api.rb CHANGED
@@ -44,4 +44,22 @@ require "cloud/aws/s3/manager"
44
44
  require "cloud/aws/s3/link/manager"
45
45
  require "cloud/aws/sdb/manager"
46
46
  require "cloud/aws/sns/manager"
47
- require "cloud/aws/sqs/manager"
47
+ require "cloud/aws/sqs/manager"
48
+
49
+ require "cloud/mws/base/manager"
50
+ require "cloud/mws/cart_information/manager"
51
+ require "cloud/mws/customer_information/manager"
52
+ require "cloud/mws/feeds/manager"
53
+ require "cloud/mws/finances/manager"
54
+ require "cloud/mws/fulfillment_inbound_shipment/manager"
55
+ require "cloud/mws/fulfillment_inventory/manager"
56
+ require "cloud/mws/fulfillment_outbound_shipment/manager"
57
+ require "cloud/mws/orders/manager"
58
+ require "cloud/mws/products/manager"
59
+ require "cloud/mws/recommendations/manager"
60
+ require "cloud/mws/reports/manager"
61
+ require "cloud/mws/sellers/manager"
62
+ require "cloud/mws/subscriptions/manager"
63
+ require "cloud/mws/webstore/manager"
64
+
65
+ require "cloud/ecs/pa/manager"
@@ -33,7 +33,7 @@ module RightScale
33
33
  # Gem version namespace
34
34
  module VERSION
35
35
  # Current version
36
- STRING = '0.3.0'
36
+ STRING = '0.3.2'
37
37
  end
38
38
  end
39
39
  end
@@ -67,6 +67,27 @@ describe RightScale::CloudApi::Utils::AWS do
67
67
  ).to eq ['ec2', 'region-1']
68
68
  end
69
69
  end
70
+
71
+ context "for China region" do
72
+ it "parses service endpoints" do
73
+ expect(
74
+ subject.sign_v4_get_service_and_region("ec2.cn-north-1.amazonaws.com.cn")
75
+ ).to eq ["ec2", "cn-north-1"]
76
+ expect(
77
+ subject.sign_v4_get_service_and_region("s3.cn-north-1.amazonaws.com.cn")
78
+ ).to eq ["s3", "cn-north-1"]
79
+ expect(
80
+ subject.sign_v4_get_service_and_region("s3-website.cn-north-1.amazonaws.com.cn")
81
+ ).to eq ["s3", "cn-north-1"]
82
+
83
+ expect(
84
+ subject.sign_v4_get_service_and_region("iam.cn-north-1.amazonaws.com.cn")
85
+ ).to eq ["iam", "cn-north-1"]
86
+ expect(
87
+ subject.sign_v4_get_service_and_region("ec2.cn-north-1.amazonaws.com.cn")
88
+ ).to eq ["ec2", "cn-north-1"]
89
+ end
90
+ end
70
91
  end
71
92
 
72
93
 
@@ -225,7 +246,7 @@ describe RightScale::CloudApi::Utils::AWS do
225
246
  :params => { 'A' => 'B' },
226
247
  :body => "banana"
227
248
  }
228
- Timecop.freeze(Time.local(2014)) do
249
+ Timecop.freeze(Time.utc(2014)) do
229
250
  subject.sign_v4_signature(
230
251
  'aws_access_key',
231
252
  'aws_secret_access_key',
@@ -241,10 +262,10 @@ describe RightScale::CloudApi::Utils::AWS do
241
262
  "content-type" => ["application/x-www-form-urlencoded; charset=utf-8"],
242
263
  "content-md5" => ["crMCvyl6Iop1cwEj7+98QQ=="],
243
264
  "x-amz-content-sha256" => ["b493d48364afe44d11c0165cf470a4164d1e2609911ef998be868d46ade3de4e"],
244
- "x-amz-date" => ["20140101T080000Z"],
265
+ "x-amz-date" => ["20140101T000000Z"],
245
266
  "x-amz-expires" => [3600],
246
267
  "host" => ["ec2.us-region-1.amazonaws.com"],
247
- "authorization" => ["AWS4-HMAC-SHA256 Credential=aws_access_key/20140101/us-region-1/ec2/aws4_request, SignedHeaders=content-length;content-md5;content-type;host;x-amz-content-sha256;x-amz-date;x-amz-expires, Signature=c7814d3865b530322742b73670475ac5adb0c1bd4ab39ecf9b80d672283fc177"]
268
+ "authorization" => ["AWS4-HMAC-SHA256 Credential=aws_access_key/20140101/us-region-1/ec2/aws4_request, SignedHeaders=content-length;content-md5;content-type;host;x-amz-content-sha256;x-amz-date;x-amz-expires, Signature=60e830ba801836039a61cad6a1c300431f913aa81bd832cc340959a140586aa6"]
248
269
  },
249
270
  :params => {"A" => "B"},
250
271
  :path => "/foo/bar?A=B",
@@ -264,7 +285,7 @@ describe RightScale::CloudApi::Utils::AWS do
264
285
  :params => { 'A' => 'B' },
265
286
  :body => "banana"
266
287
  }
267
- Timecop.freeze(Time.local(2014)) do
288
+ Timecop.freeze(Time.utc(2014)) do
268
289
  subject.sign_v4_signature(
269
290
  'aws_access_key',
270
291
  'aws_secret_access_key',
@@ -279,13 +300,13 @@ describe RightScale::CloudApi::Utils::AWS do
279
300
  :headers => {"host"=>["ec2.us-region-1.amazonaws.com"]},
280
301
  :params => {
281
302
  "A" => "B",
282
- "X-Amz-Date" => "20140101T080000Z",
303
+ "X-Amz-Date" => "20140101T000000Z",
283
304
  "X-Amz-Expires" => 3600,
284
305
  "X-Amz-Algorithm" => "AWS4-HMAC-SHA256",
285
306
  "X-Amz-SignedHeaders" => "host",
286
307
  "X-Amz-Credential" => "aws_access_key/20140101/us-region-1/ec2/aws4_request"
287
308
  },
288
- :path => "/foo/bar?A=B&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=aws_access_key%2F20140101%2Fus-region-1%2Fec2%2Faws4_request&X-Amz-Date=20140101T080000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=0fcac655717af1f947fc0942cc2a2e98fddfe71cf669b0a344235bb83684c9cf",
309
+ :path => "/foo/bar?A=B&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=aws_access_key%2F20140101%2Fus-region-1%2Fec2%2Faws4_request&X-Amz-Date=20140101T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=62ef6599fbacd4869a517857cdbb95763c00b8397cb551c374c3320285df9e87",
289
310
  :verb => :post
290
311
  }
291
312
  )