aliyun 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2dc5e0595cf65cbc2bf6d43fa1332f025143be87
4
- data.tar.gz: cd067473afc476ba9c400787c7ce65943c162c7e
3
+ metadata.gz: 5d2b7f70ccfa8d798cb6dbdc229eacaf48353add
4
+ data.tar.gz: ec6d8f0f4a80c730e755683421b607fd2070a838
5
5
  SHA512:
6
- metadata.gz: fa762f088fb80c27b196f2e65e7b8e3f3c3971eb6045fce149710e614b910f3ec64f5b5b87b860fd4a0a1c003c60728c524d2a8fe98c9082bc33a1604e0b327a
7
- data.tar.gz: 336643ed67cbacfe091043cd0999938e6459c4430f048bf645854351bbad2a0a187a904ec51640db93d98ed1efe06a32944e0f0303bca74b78a0424a23cb2056
6
+ metadata.gz: a478015d9189b134cffa5ea83deb6a6e03d9f2ba29f34d88526a9fe4f255bda307158e386449b7a5e06f16a50c9280cf0b45bbba1c9457dbfbd069a7068b2723
7
+ data.tar.gz: 9d0f6ba07bb1628d866e43e1b8a4a93fec96a5bde8d3bcfb91145cff8e01f5eae9a4e65e43ee9653a4c1eeec907572b43ba4f080a891bc30371c5ec6bef974d7
@@ -0,0 +1,2 @@
1
+ export ACCESS_KEY_ID=
2
+ export ACCESS_KEY_SECRET=
data/.gitignore CHANGED
@@ -20,4 +20,4 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
- .aliyun.yml
23
+ .aliyun.env
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0
5
+ - 2.1
6
+ - 2.2
7
+ - ruby-head
data/README.md CHANGED
@@ -1,20 +1,26 @@
1
1
  # Aliyun
2
2
 
3
- Ruby wrapper of Aliyun API for system adminstrator.
3
+ [![Fury](https://badge.fury.io/rb/aliyun.png)](http://badge.fury.io/rb/aliyun)
4
+ [![Code Climate](https://codeclimate.com/github/Lax/aliyun/badges/gpa.svg)](https://codeclimate.com/github/Lax/aliyun)
5
+ [![Test Coverage](https://codeclimate.com/github/Lax/aliyun/badges/coverage.svg)](https://codeclimate.com/github/Lax/aliyun/coverage)
6
+ [![Travis](https://travis-ci.org/Lax/aliyun.svg?branch=master)](https://travis-ci.org/Lax/aliyun)
7
+ [![CircleCI](https://circleci.com/gh/Lax/aliyun/tree/master.png?style=shield)](https://circleci.com/gh/Lax/aliyun)
8
+ [![security](https://hakiri.io/github/Lax/aliyun/master.svg)](https://hakiri.io/github/Lax/aliyun/master)
9
+ [![Dependency Status](https://gemnasium.com/Lax/aliyun.svg)](https://gemnasium.com/Lax/aliyun)
4
10
 
5
- [![Gem Version](https://badge.fury.io/rb/aliyun.png)](http://badge.fury.io/rb/aliyun)
11
+ Ruby wrapper of Aliyun API for system adminstrator.
6
12
 
7
13
  ## Installation
8
14
 
9
- Add this line to your application's Gemfile:
15
+ Add `gem 'aliyun'` to your application's Gemfile:
10
16
 
11
17
  gem 'aliyun'
12
18
 
13
- And then execute:
19
+ And then run:
14
20
 
15
- $ bundle
21
+ $ bundle install
16
22
 
17
- Or install it yourself as:
23
+ Or install it with gem command:
18
24
 
19
25
  $ gem install aliyun
20
26
 
data/aliyun.gemspec CHANGED
@@ -23,5 +23,6 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 1.6"
24
24
  spec.add_development_dependency "rake"
25
25
  spec.add_development_dependency "rspec"
26
+ spec.add_development_dependency "rspec_junit_formatter"
26
27
  spec.add_dependency "ruby-hmac"
27
28
  end
@@ -0,0 +1,24 @@
1
+ module Aliyun
2
+ class CDNConfig < APIConfig
3
+ def self.info
4
+ "Aliyu CDN Service"
5
+ end
6
+ def self.endpoint
7
+ 'https://cdn.aliyuncs.com/'
8
+ end
9
+ def self.default_parameters
10
+ {
11
+ :Format=>"JSON",
12
+ :Version=>"2014-11-11",
13
+ :SignatureMethod=>"HMAC-SHA1",
14
+ :SignatureVersion=>"1.0"
15
+ }
16
+ end
17
+ def self.separator
18
+ super
19
+ end
20
+ def self.http_method
21
+ super
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module Aliyun
2
+ class ECSConfig < APIConfig
3
+ def self.info
4
+ "Aliyu ECS Service"
5
+ end
6
+ def self.endpoint
7
+ 'https://ecs.aliyuncs.com/'
8
+ end
9
+ def self.default_parameters
10
+ {
11
+ :Format=>"JSON",
12
+ :Version=>"2014-05-26",
13
+ :SignatureMethod=>"HMAC-SHA1",
14
+ :SignatureVersion=>"1.0"
15
+ }
16
+ end
17
+ def self.separator
18
+ super
19
+ end
20
+ def self.http_method
21
+ super
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module Aliyun
2
+ class RDSConfig < APIConfig
3
+ def self.info
4
+ "Aliyu RDS Service"
5
+ end
6
+ def self.endpoint
7
+ 'https://rds.aliyuncs.com/'
8
+ end
9
+ def self.default_parameters
10
+ {
11
+ :Format=>"JSON",
12
+ :Version=>"2014-08-15",
13
+ :SignatureMethod=>"HMAC-SHA1",
14
+ :SignatureVersion=>"1.0"
15
+ }
16
+ end
17
+ def self.separator
18
+ super
19
+ end
20
+ def self.http_method
21
+ super
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ module Aliyun
2
+ class SLBConfig < APIConfig
3
+ def self.info
4
+ "Aliyu SLB Service"
5
+ end
6
+ def self.endpoint
7
+ 'https://slb.aliyuncs.com/'
8
+ end
9
+ def self.default_parameters
10
+ {
11
+ :Format=>"JSON",
12
+ :Version=>"2014-05-15",
13
+ :SignatureMethod=>"HMAC-SHA1",
14
+ :SignatureVersion=>"1.0"
15
+ }
16
+ end
17
+ def self.separator
18
+ super
19
+ end
20
+ def self.http_method
21
+ super
22
+ end
23
+ end
24
+ end
@@ -1,76 +1,13 @@
1
- module Aliyun
2
- class ECSConfig < APIConfig
3
- def self.info
4
- "Aliyu ECS Service"
5
- end
6
- def self.endpoint
7
- 'https://ecs.aliyuncs.com/'
8
- end
9
- def self.default_parameters
10
- {
11
- :Format=>"JSON",
12
- :Version=>"2014-05-26",
13
- :SignatureMethod=>"HMAC-SHA1",
14
- :SignatureVersion=>"1.0"
15
- }
16
- end
17
- def self.separator
18
- super
19
- end
20
- def self.http_method
21
- super
22
- end
23
- end
24
-
25
- class SLBConfig < APIConfig
26
- def self.info
27
- "Aliyu SLB Service"
28
- end
29
- def self.endpoint
30
- 'https://slb.aliyuncs.com/'
31
- end
32
- def self.default_parameters
33
- {
34
- :Format=>"JSON",
35
- :Version=>"2014-05-15",
36
- :SignatureMethod=>"HMAC-SHA1",
37
- :SignatureVersion=>"1.0"
38
- }
39
- end
40
- def self.separator
41
- super
42
- end
43
- def self.http_method
44
- super
45
- end
46
- end
47
-
48
- class RDSConfig < APIConfig
49
- def self.info
50
- "Aliyu RDS Service"
51
- end
52
- def self.endpoint
53
- 'https://rds.aliyuncs.com/'
54
- end
55
- def self.default_parameters
56
- {
57
- :Format=>"JSON",
58
- :Version=>"2014-08-15",
59
- :SignatureMethod=>"HMAC-SHA1",
60
- :SignatureVersion=>"1.0"
61
- }
62
- end
63
- def self.separator
64
- super
65
- end
66
- def self.http_method
67
- super
68
- end
69
- end
1
+ require "aliyun/services/ecs"
2
+ require "aliyun/services/slb"
3
+ require "aliyun/services/rds"
4
+ require "aliyun/services/cdn"
70
5
 
6
+ module Aliyun
71
7
  SERVICES = {
72
8
  :ecs => ECSConfig,
73
9
  :slb => SLBConfig,
74
- :rds => RDSConfig
10
+ :rds => RDSConfig,
11
+ :cdn => CDNConfig
75
12
  }
76
13
  end
@@ -1,3 +1,3 @@
1
1
  module Aliyun
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
data/spec/aliyun_spec.rb CHANGED
@@ -39,6 +39,15 @@ describe Aliyun do
39
39
  expect(service.service).to be(Aliyun::RDSConfig)
40
40
  end
41
41
 
42
+ it 'can create aliyun cdn service' do
43
+ options = load_options
44
+ options[:service] = :cdn
45
+ service = Aliyun::Service.new options
46
+
47
+ expect(service).to be_instance_of(Aliyun::Service)
48
+ expect(service.service).to be(Aliyun::CDNConfig)
49
+ end
50
+
42
51
  it 'can query aliyun ecs regions' do
43
52
  options = load_options
44
53
  options[:service] = :ecs
@@ -72,6 +81,17 @@ describe Aliyun do
72
81
  expect(regions["Regions"]).to have_key("RDSRegion")
73
82
  end
74
83
 
84
+ it 'can query aliyun cdn service' do
85
+ options = load_options
86
+ options[:service] = :cdn
87
+ service = Aliyun::Service.new options
88
+ parameters = {}
89
+ cdn_service = service.DescribeCdnService parameters
90
+
91
+ expect(cdn_service).to have_key("InternetChargeType")
92
+ expect(cdn_service).to have_key("OpeningTime")
93
+ end
94
+
75
95
  it "can describe aliyun slb regions" do
76
96
  options = load_options
77
97
  options[:service] = :slb
data/spec/spec_helper.rb CHANGED
@@ -2,6 +2,6 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
2
  require 'aliyun'
3
3
  require 'yaml'
4
4
 
5
- def load_options(src='.aliyun.yml')
6
- YAML.load_file(src)
5
+ def load_options
6
+ {:access_key_id => ENV['ACCESS_KEY_ID'], :access_key_secret => ENV['ACCESS_KEY_SECRET']}
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Lantao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-01 00:00:00.000000000 Z
11
+ date: 2015-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec_junit_formatter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: ruby-hmac
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -74,8 +88,9 @@ executables: []
74
88
  extensions: []
75
89
  extra_rdoc_files: []
76
90
  files:
77
- - ".aliyun.yml.example"
91
+ - ".aliyun.env.example"
78
92
  - ".gitignore"
93
+ - ".travis.yml"
79
94
  - Gemfile
80
95
  - LICENSE.txt
81
96
  - README.md
@@ -86,6 +101,10 @@ files:
86
101
  - lib/aliyun/base.rb
87
102
  - lib/aliyun/common.rb
88
103
  - lib/aliyun/services.rb
104
+ - lib/aliyun/services/cdn.rb
105
+ - lib/aliyun/services/ecs.rb
106
+ - lib/aliyun/services/rds.rb
107
+ - lib/aliyun/services/slb.rb
89
108
  - lib/aliyun/version.rb
90
109
  - spec/aliyun_spec.rb
91
110
  - spec/spec_helper.rb
data/.aliyun.yml.example DELETED
@@ -1,2 +0,0 @@
1
- :access_key_id:
2
- :access_key_secret: