aliyun-api 0.0.9 → 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.
- checksums.yaml +4 -4
- data/lib/aliyun/ecs.rb +5 -2
- data/lib/aliyun/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9cfb44728e20c3fe58ce65bf12de100a5b143c1
|
|
4
|
+
data.tar.gz: 3f34f591a489d4489eae34a24208d0b3e8d2123a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a386a76a23308d5b6a42eadca32e1a060f9a7bc565bec476c5d43c3fe9a1596164b10075dd8c97e570bcd880baab3363d3b47e6e3d93b1308076448917dc26ec
|
|
7
|
+
data.tar.gz: f72da64be5a24f2d1188e7f8633306bfe34267101d0b52e055d266e98427229b0e2b7d940abed028bb5f1b3cfcc9122da11f8768902c8426a6def760254ad90e
|
data/lib/aliyun/ecs.rb
CHANGED
|
@@ -12,7 +12,9 @@ module Aliyun
|
|
|
12
12
|
def initialize(options={})
|
|
13
13
|
Aliyun[:access_key_id] = options[:access_key_id] || Aliyun[:access_key_id] || ENV['ALIYUN_ACCESS_KEY_ID']
|
|
14
14
|
Aliyun[:access_key_secret] = options[:access_key_secret] || Aliyun[:access_key_secret] || ENV['ALIYUN_ACCESS_KEY_SECRET']
|
|
15
|
-
Aliyun[:endpoint_url]
|
|
15
|
+
Aliyun[:endpoint_url] = options[:endpoint_url] || Aliyun[:endpoint_url]
|
|
16
|
+
Aliyun[:request_parameters][:Version] = options[:version] || Aliyun[:version]
|
|
17
|
+
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
def method_missing(method_name, *args,&block)
|
|
@@ -29,7 +31,8 @@ module Aliyun
|
|
|
29
31
|
res = RestClient.send Aliyun[:request_method].downcase, Aliyun[:endpoint_url], {:params => params,:verify_ssl => OpenSSL::SSL::VERIFY_PEER }
|
|
30
32
|
return JSON.parse res.body if res.code == 200
|
|
31
33
|
rescue RestClient::Exception => rcex
|
|
32
|
-
|
|
34
|
+
message = JSON.parse(rcex.response)
|
|
35
|
+
raise AliyunError.new "response error: [#{message['Message']}] #{rcex.to_s}\nrequest parameters: #{params.reject{|k,v| k==:AccessKeyId}}"
|
|
33
36
|
rescue =>e
|
|
34
37
|
raise AliyunError.new e.to_s
|
|
35
38
|
end
|
data/lib/aliyun/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aliyun-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- qjpcpu
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-08-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
89
89
|
version: '0'
|
|
90
90
|
requirements: []
|
|
91
91
|
rubyforge_project:
|
|
92
|
-
rubygems_version: 2.
|
|
92
|
+
rubygems_version: 2.6.6
|
|
93
93
|
signing_key:
|
|
94
94
|
specification_version: 4
|
|
95
95
|
summary: Aliyun ECS API
|