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 +4 -4
- data/.aliyun.env.example +2 -0
- data/.gitignore +1 -1
- data/.travis.yml +7 -0
- data/README.md +12 -6
- data/aliyun.gemspec +1 -0
- data/lib/aliyun/services/cdn.rb +24 -0
- data/lib/aliyun/services/ecs.rb +24 -0
- data/lib/aliyun/services/rds.rb +24 -0
- data/lib/aliyun/services/slb.rb +24 -0
- data/lib/aliyun/services.rb +7 -70
- data/lib/aliyun/version.rb +1 -1
- data/spec/aliyun_spec.rb +20 -0
- data/spec/spec_helper.rb +2 -2
- metadata +22 -3
- data/.aliyun.yml.example +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d2b7f70ccfa8d798cb6dbdc229eacaf48353add
|
4
|
+
data.tar.gz: ec6d8f0f4a80c730e755683421b607fd2070a838
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a478015d9189b134cffa5ea83deb6a6e03d9f2ba29f34d88526a9fe4f255bda307158e386449b7a5e06f16a50c9280cf0b45bbba1c9457dbfbd069a7068b2723
|
7
|
+
data.tar.gz: 9d0f6ba07bb1628d866e43e1b8a4a93fec96a5bde8d3bcfb91145cff8e01f5eae9a4e65e43ee9653a4c1eeec907572b43ba4f080a891bc30371c5ec6bef974d7
|
data/.aliyun.env.example
ADDED
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,20 +1,26 @@
|
|
1
1
|
# Aliyun
|
2
2
|
|
3
|
-
|
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
|
-
|
11
|
+
Ruby wrapper of Aliyun API for system adminstrator.
|
6
12
|
|
7
13
|
## Installation
|
8
14
|
|
9
|
-
Add
|
15
|
+
Add `gem 'aliyun'` to your application's Gemfile:
|
10
16
|
|
11
17
|
gem 'aliyun'
|
12
18
|
|
13
|
-
And then
|
19
|
+
And then run:
|
14
20
|
|
15
|
-
$ bundle
|
21
|
+
$ bundle install
|
16
22
|
|
17
|
-
Or install it
|
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
|
data/lib/aliyun/services.rb
CHANGED
@@ -1,76 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
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
|
data/lib/aliyun/version.rb
CHANGED
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
|
6
|
-
|
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.
|
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-
|
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.
|
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