aliyun 0.4.0 → 0.4.1

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: d1de23cde61df7e18309d92f7e9038edbff6e0ed
4
- data.tar.gz: f8c26ae26532dcba4f24b053ebc1b1a9a16b8674
3
+ metadata.gz: 0a16600c438443e782fe9ada9aa2787fac4d854b
4
+ data.tar.gz: dabf5f36779ed8ef91ef2b64d5fd59ae8434dcaf
5
5
  SHA512:
6
- metadata.gz: b12265ce711f32b006384fe63146d8859c2235e1ace36159757d479419b26664c598da18d39299b5a20b02a149f7d389bfe20af7ee41200d0c9f882d0f891f4d
7
- data.tar.gz: 84f5c5dc83da8bd11461edf6bc14e7003bdeee9c7219d7ec5617e82ced6c60c438ee938a10a4c9e83e9beb2cd3dec6ef7ec50df84c2066f55ed51f6d51a49778
6
+ metadata.gz: e78f69ccc2d5c206d6aecdb0a59564846ede592eaada49a3a65384414f8f6a7c71a98ff05e1291af870083e268a9a1d1c18041f7fc033c51ff50dd27e61060e8
7
+ data.tar.gz: f38e76b74ca48e66a5a2f87bcff06558b8644d85ce68a40947d2e859633285ea782ac38472d62efcac3fadad3e671f526969b92469ff899d4a573d1dc50137cb
@@ -1,17 +1,19 @@
1
- require "aliyun/services/ecs"
2
- require "aliyun/services/slb"
3
- require "aliyun/services/rds"
4
1
  require "aliyun/services/cdn"
2
+ require "aliyun/services/cms"
3
+ require "aliyun/services/ecs"
5
4
  require "aliyun/services/ram"
5
+ require "aliyun/services/rds"
6
+ require "aliyun/services/slb"
6
7
  require "aliyun/services/sts"
7
8
 
8
9
  module Aliyun
9
10
  SERVICES = {
10
- :ecs => ECSConfig,
11
- :slb => SLBConfig,
12
- :rds => RDSConfig,
13
11
  :cdn => CDNConfig,
12
+ :cms => CMSConfig,
13
+ :ecs => ECSConfig,
14
14
  :ram => RAMConfig,
15
+ :rds => RDSConfig,
16
+ :slb => SLBConfig,
15
17
  :sts => STSConfig
16
18
  }
17
19
  end
@@ -0,0 +1,24 @@
1
+ module Aliyun
2
+ class CMSConfig < APIConfig
3
+ def self.info
4
+ "Aliyu CMS Service"
5
+ end
6
+ def self.endpoint
7
+ 'https://metrics.aliyuncs.com/'
8
+ end
9
+ def self.default_parameters
10
+ {
11
+ :Format=>"JSON",
12
+ :Version=>"2015-04-20",
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,3 +1,3 @@
1
1
  module Aliyun
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aliyun do
4
+ it 'can create aliyun cdn service' do
5
+ options = load_options
6
+ options[:service] = :cdn
7
+ service = Aliyun::Service.new options
8
+
9
+ expect(service).to be_instance_of(Aliyun::Service)
10
+ expect(service.service).to be(Aliyun::CDNConfig)
11
+ end
12
+
13
+ it 'can query aliyun cdn service' do
14
+ options = load_options
15
+ options[:service] = :cdn
16
+ service = Aliyun::Service.new options
17
+ parameters = {}
18
+ cdn_service = service.DescribeCdnService parameters
19
+
20
+ expect(cdn_service).to have_key("InternetChargeType")
21
+ expect(cdn_service).to have_key("OpeningTime")
22
+ end
23
+ end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aliyun do
4
+ it 'can create aliyun CMS(metrics) service' do
5
+ options = load_options
6
+ options[:service] = :cms
7
+ service = Aliyun::Service.new options
8
+
9
+ expect(service).to be_instance_of(Aliyun::Service)
10
+ expect(service.service).to be(Aliyun::CMSConfig)
11
+ end
12
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aliyun do
4
+ it 'can create aliyun ecs service' do
5
+ options = load_options
6
+ options[:service] = :ecs
7
+ service = Aliyun::Service.new options
8
+
9
+ expect(service).to be_instance_of(Aliyun::Service)
10
+ expect(service.service).to be(Aliyun::ECSConfig)
11
+ end
12
+
13
+ it 'can query aliyun ecs regions' do
14
+ options = load_options
15
+ options[:service] = :ecs
16
+ service = Aliyun::Service.new options
17
+ parameters = {}
18
+ regions = service.DescribeRegions parameters
19
+
20
+ expect(regions).to have_key("Regions")
21
+ expect(regions["Regions"]).to have_key("Region")
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aliyun do
4
+ it 'can create aliyun ram service' do
5
+ options = load_options
6
+ options[:service] = :ram
7
+ service = Aliyun::Service.new options
8
+
9
+ expect(service).to be_instance_of(Aliyun::Service)
10
+ expect(service.service).to be(Aliyun::RAMConfig)
11
+ end
12
+
13
+ # it 'can list aliyun ram users' do
14
+ # options = load_options
15
+ # options[:service] = :ram
16
+ # service = Aliyun::Service.new options
17
+ # parameters = {}
18
+ # users = service.ListUsers parameters
19
+ #
20
+ # expect(users).to have_key("Users")
21
+ # expect(users["Users"]).to have_key("User")
22
+ # end
23
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aliyun do
4
+ it 'can create aliyun rds service' do
5
+ options = load_options
6
+ options[:service] = :rds
7
+ service = Aliyun::Service.new options
8
+
9
+ expect(service).to be_instance_of(Aliyun::Service)
10
+ expect(service.service).to be(Aliyun::RDSConfig)
11
+ end
12
+
13
+ it 'can query aliyun rds regions' do
14
+ options = load_options
15
+ options[:service] = :rds
16
+ service = Aliyun::Service.new options
17
+ parameters = {}
18
+ regions = service.DescribeRegions parameters
19
+
20
+ expect(regions).to have_key("Regions")
21
+ expect(regions["Regions"]).to have_key("RDSRegion")
22
+ end
23
+ end
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aliyun do
4
+ it 'can create aliyun slb service' do
5
+ options = load_options
6
+ options[:service] = :slb
7
+ service = Aliyun::Service.new options
8
+
9
+ expect(service).to be_instance_of(Aliyun::Service)
10
+ expect(service.service).to be(Aliyun::SLBConfig)
11
+ end
12
+
13
+ it 'can query aliyun slb regions' do
14
+ options = load_options
15
+ options[:service] = :slb
16
+ service = Aliyun::Service.new options
17
+ parameters = {}
18
+ regions = service.DescribeRegions parameters
19
+
20
+ expect(regions).to have_key("Regions")
21
+ expect(regions["Regions"]).to have_key("Region")
22
+ end
23
+
24
+ it "can describe aliyun slb regions" do
25
+ options = load_options
26
+ options[:service] = :slb
27
+ service = Aliyun::Service.new options
28
+ parameters = {}
29
+ slbs = service.DescribeLoadBalancers :RegionId => "cn-beijing"
30
+
31
+ expect(slbs).to have_key("LoadBalancers")
32
+ #expect(slbs["LoadBalancers"]).to have_key("LoadBalancer")
33
+ end
34
+ end
data/spec/aliyun_spec.rb CHANGED
@@ -11,136 +11,4 @@ describe Aliyun do
11
11
  expect(option).to have_key(:access_key_id)
12
12
  expect(option).to have_key(:access_key_secret)
13
13
  end
14
-
15
- it 'can create aliyun ecs service' do
16
- options = load_options
17
- options[:service] = :ecs
18
- service = Aliyun::Service.new options
19
-
20
- expect(service).to be_instance_of(Aliyun::Service)
21
- expect(service.service).to be(Aliyun::ECSConfig)
22
- end
23
-
24
- it 'can create aliyun slb service' do
25
- options = load_options
26
- options[:service] = :slb
27
- service = Aliyun::Service.new options
28
-
29
- expect(service).to be_instance_of(Aliyun::Service)
30
- expect(service.service).to be(Aliyun::SLBConfig)
31
- end
32
-
33
- it 'can create aliyun rds service' do
34
- options = load_options
35
- options[:service] = :rds
36
- service = Aliyun::Service.new options
37
-
38
- expect(service).to be_instance_of(Aliyun::Service)
39
- expect(service.service).to be(Aliyun::RDSConfig)
40
- end
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
-
51
- it 'can create aliyun ram service' do
52
- options = load_options
53
- options[:service] = :ram
54
- service = Aliyun::Service.new options
55
-
56
- expect(service).to be_instance_of(Aliyun::Service)
57
- expect(service.service).to be(Aliyun::RAMConfig)
58
- end
59
-
60
- it 'can create aliyun sts service' do
61
- options = load_options
62
- options[:service] = :sts
63
- service = Aliyun::Service.new options
64
-
65
- expect(service).to be_instance_of(Aliyun::Service)
66
- expect(service.service).to be(Aliyun::STSConfig)
67
- end
68
-
69
- it 'can query aliyun ecs regions' do
70
- options = load_options
71
- options[:service] = :ecs
72
- service = Aliyun::Service.new options
73
- parameters = {}
74
- regions = service.DescribeRegions parameters
75
-
76
- expect(regions).to have_key("Regions")
77
- expect(regions["Regions"]).to have_key("Region")
78
- end
79
-
80
- it 'can query aliyun slb regions' do
81
- options = load_options
82
- options[:service] = :slb
83
- service = Aliyun::Service.new options
84
- parameters = {}
85
- regions = service.DescribeRegions parameters
86
-
87
- expect(regions).to have_key("Regions")
88
- expect(regions["Regions"]).to have_key("Region")
89
- end
90
-
91
- it 'can query aliyun rds regions' do
92
- options = load_options
93
- options[:service] = :rds
94
- service = Aliyun::Service.new options
95
- parameters = {}
96
- regions = service.DescribeRegions parameters
97
-
98
- expect(regions).to have_key("Regions")
99
- expect(regions["Regions"]).to have_key("RDSRegion")
100
- end
101
-
102
- it 'can query aliyun cdn service' do
103
- options = load_options
104
- options[:service] = :cdn
105
- service = Aliyun::Service.new options
106
- parameters = {}
107
- cdn_service = service.DescribeCdnService parameters
108
-
109
- expect(cdn_service).to have_key("InternetChargeType")
110
- expect(cdn_service).to have_key("OpeningTime")
111
- end
112
-
113
- # it 'can list aliyun ram users' do
114
- # options = load_options
115
- # options[:service] = :ram
116
- # service = Aliyun::Service.new options
117
- # parameters = {}
118
- # users = service.ListUsers parameters
119
- #
120
- # expect(users).to have_key("Users")
121
- # expect(users["Users"]).to have_key("User")
122
- # end
123
-
124
- # TODO: define a test policy
125
- # it 'can get aliyun sts token' do
126
- # options = load_options
127
- # options[:service] = :sts
128
- # service = Aliyun::Service.new options
129
- # parameters = {:StsVersion => 1, :Name => "aliyun_gem_t#{Time.now.to_i}", :Policy => "", :DurationSeconds => 900}
130
- # sts_token = service.GetFederationToken parameters
131
- #
132
- # expect(sts_token).to have_key("Credentials")
133
- # expect(sts_token).to have_key("FederatedUser")
134
- # end
135
-
136
- it "can describe aliyun slb regions" do
137
- options = load_options
138
- options[:service] = :slb
139
- service = Aliyun::Service.new options
140
- parameters = {}
141
- slbs = service.DescribeLoadBalancers :RegionId => "cn-beijing"
142
-
143
- expect(slbs).to have_key("LoadBalancers")
144
- #expect(slbs["LoadBalancers"]).to have_key("LoadBalancer")
145
- end
146
14
  end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aliyun do
4
+ it 'can create aliyun sts service' do
5
+ options = load_options
6
+ options[:service] = :sts
7
+ service = Aliyun::Service.new options
8
+
9
+ expect(service).to be_instance_of(Aliyun::Service)
10
+ expect(service.service).to be(Aliyun::STSConfig)
11
+ end
12
+
13
+ # TODO: define a test policy
14
+ # it 'can get aliyun sts token' do
15
+ # options = load_options
16
+ # options[:service] = :sts
17
+ # service = Aliyun::Service.new options
18
+ # parameters = {:StsVersion => 1, :Name => "aliyun_gem_t#{Time.now.to_i}", :Policy => "", :DurationSeconds => 900}
19
+ # sts_token = service.GetFederationToken parameters
20
+ #
21
+ # expect(sts_token).to have_key("Credentials")
22
+ # expect(sts_token).to have_key("FederatedUser")
23
+ # end
24
+ 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.4.0
4
+ version: 0.4.1
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-10 00:00:00.000000000 Z
11
+ date: 2015-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,13 +102,21 @@ files:
102
102
  - lib/aliyun/common.rb
103
103
  - lib/aliyun/services.rb
104
104
  - lib/aliyun/services/cdn.rb
105
+ - lib/aliyun/services/cms.rb
105
106
  - lib/aliyun/services/ecs.rb
106
107
  - lib/aliyun/services/ram.rb
107
108
  - lib/aliyun/services/rds.rb
108
109
  - lib/aliyun/services/slb.rb
109
110
  - lib/aliyun/services/sts.rb
110
111
  - lib/aliyun/version.rb
112
+ - spec/aliyun_cdn_spec.rb
113
+ - spec/aliyun_cms_spec.rb
114
+ - spec/aliyun_ecs_spec.rb
115
+ - spec/aliyun_ram_spec.rb
116
+ - spec/aliyun_rds_spec.rb
117
+ - spec/aliyun_slb_spec.rb
111
118
  - spec/aliyun_spec.rb
119
+ - spec/aliyun_sts_spec.rb
112
120
  - spec/spec_helper.rb
113
121
  homepage: https://github.com/Lax/aliyun
114
122
  licenses:
@@ -130,10 +138,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
138
  version: '0'
131
139
  requirements: []
132
140
  rubyforge_project:
133
- rubygems_version: 2.2.2
141
+ rubygems_version: 2.4.8
134
142
  signing_key:
135
143
  specification_version: 4
136
144
  summary: Ruby wrapper of Aliyun API for system administrator
137
145
  test_files:
146
+ - spec/aliyun_cdn_spec.rb
147
+ - spec/aliyun_cms_spec.rb
148
+ - spec/aliyun_ecs_spec.rb
149
+ - spec/aliyun_ram_spec.rb
150
+ - spec/aliyun_rds_spec.rb
151
+ - spec/aliyun_slb_spec.rb
138
152
  - spec/aliyun_spec.rb
153
+ - spec/aliyun_sts_spec.rb
139
154
  - spec/spec_helper.rb