aliyun 0.5.0.pre → 0.5.0

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: ada38cdcdb2569ba1d0382bb66eb52f9fb6bd8a7
4
- data.tar.gz: 96365c9fad53b08c09eca899f620c4942718ec12
3
+ metadata.gz: 24f249568cd9de8c09fedfe4e5a846e21828e018
4
+ data.tar.gz: 74c41834e2dd4b7ec6e650afefc090000794b53a
5
5
  SHA512:
6
- metadata.gz: f15118d4911d53579b0722a27e5cf23b7d1064b99cf60f9cd2e214b95bfd1a01267285c1ef23315b8cb0f57b8cd090e4848ccea288471e50151775d16f028463
7
- data.tar.gz: 953cacb53487fc915fcfdefdd4ad7a7e428f3d9dadb3f2fe2a76140191091ce727fbe626b9cac29a0449aebd3fe9919543d4ad930c06eaf10bb1dec142a3fc89
6
+ metadata.gz: df5968523cdf0eda0ff24c8e289e382ef1021c8a3264b409dbf6e94afb433aa1fe3771552bfa397a76f3a706b7d42f4511d2b62c34eb51549d3d82a3c31a5602
7
+ data.tar.gz: efbf9032241e9d59f694747168c3c3c881998f03dc953daea9fd64505f8536828faced6cda1f8222109a23e868addaddb2a3316bea09d351f73dece97b44e8b8
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - 2.0
5
- - 2.1
3
+ - 2.4
4
+ - 2.3
6
5
  - 2.2
7
- - ruby-head
6
+ - 2.1
7
+ - 2.0.0
8
+ - 1.9.3
data/README.md CHANGED
@@ -48,6 +48,7 @@ Current support these services:
48
48
 
49
49
  * `:cdn` => `CDN` (Content Delivery Network)
50
50
  * `:cms` => `CMS` (Cloud Monitor Service)
51
+ * `:dns` => `DNS` (Domain Name Service)
51
52
  * `:ecs` => `ECS` (Elastic Compute Service)
52
53
  * `:ram` => `RAM` (Resource Access Management)
53
54
  * `:rds` => `RDS` (Relational Database Service)
@@ -1,5 +1,6 @@
1
1
  require "aliyun/services/cdn"
2
2
  require "aliyun/services/cms"
3
+ require "aliyun/services/dns"
3
4
  require "aliyun/services/ecs"
4
5
  require "aliyun/services/ram"
5
6
  require "aliyun/services/rds"
@@ -10,6 +11,7 @@ module Aliyun
10
11
  SERVICES = {
11
12
  :cdn => CDNConfig,
12
13
  :cms => CMSConfig,
14
+ :dns => DNSConfig,
13
15
  :ecs => ECSConfig,
14
16
  :ram => RAMConfig,
15
17
  :rds => RDSConfig,
@@ -4,12 +4,12 @@ module Aliyun
4
4
  "Aliyu CMS Service"
5
5
  end
6
6
  def self.endpoint
7
- 'http://metrics.aliyuncs.com/'
7
+ raise "Service Endpoint Missing! endpoint_url: http://metrics.\%{Region}.aliyuncs.com/"
8
8
  end
9
9
  def self.default_parameters
10
10
  {
11
11
  :Format=>"JSON",
12
- :Version=>"2015-04-20",
12
+ :Version=>"2017-03-01",
13
13
  :SignatureMethod=>"HMAC-SHA1",
14
14
  :SignatureVersion=>"1.0"
15
15
  }
@@ -0,0 +1,24 @@
1
+ module Aliyun
2
+ class DNSConfig < APIConfig
3
+ def self.info
4
+ "Aliyun DNS Service"
5
+ end
6
+ def self.endpoint
7
+ 'https://dns.aliyuncs.com/'
8
+ end
9
+ def self.default_parameters
10
+ {
11
+ :Format=>"JSON",
12
+ :Version=>"2015-01-09",
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.5.0.pre"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -1,32 +1,32 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Aliyun do
4
- it 'can create aliyun CMS(metrics) service' do
4
+ before do
5
5
  options = load_options
6
6
  options[:service] = :cms
7
- service = Aliyun::Service.new options
7
+ options[:endpoint_url] = 'http://metrics.cn-beijing.aliyuncs.com/'
8
+ @service = Aliyun::Service.new options
9
+ end
8
10
 
9
- expect(service).to be_instance_of(Aliyun::Service)
10
- expect(service.service).to be(Aliyun::CMSConfig)
11
+ it 'can create aliyun CMS(metrics) service' do
12
+ expect(@service).to be_instance_of(Aliyun::Service)
13
+ expect(@service.service).to be(Aliyun::CMSConfig)
11
14
  end
12
15
 
13
16
  it 'can describe metric datum' do
14
- options = load_options
15
- options[:service] = :cms
16
- service = Aliyun::Service.new options
17
17
  instanceId = load_ecs_instance_id
18
18
  instanceRegion = load_ecs_instance_region
19
19
  parameters = {
20
- Namespace: 'acs/ecs',
21
- MetricName: 'vm.DiskUtilization',
20
+ Project: 'acs_ecs_dashboard',
21
+ Metric: 'diskusage_utilization',
22
22
  StartTime: (Time.now - 180).utc.iso8601,
23
- Dimensions: "{instanceId:'%s',mountpoint:'/'}" % instanceId,
23
+ Dimensions: "{instanceId:'%s',device:'/dev/xvda1'}" % instanceId,
24
24
  RegionId: instanceRegion,
25
25
  Length: 1000
26
26
  }
27
- metric_datum = service.DescribeMetricDatum parameters
27
+ metric_datum = @service.QueryMetricList parameters
28
28
 
29
29
  expect(metric_datum).to have_key("Datapoints")
30
- expect(metric_datum["Datapoints"]).to have_key("Datapoint")
30
+ expect(metric_datum["Datapoints"][0]).to have_key("diskname")
31
31
  end
32
32
  end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Aliyun do
4
+ it 'can create aliyun dns service' do
5
+ options = load_options
6
+ options[:service] = :dns
7
+ service = Aliyun::Service.new options
8
+
9
+ expect(service).to be_instance_of(Aliyun::Service)
10
+ expect(service.service).to be(Aliyun::DNSConfig)
11
+ end
12
+
13
+ it 'can query aliyun dns service for domains' do
14
+ options = load_options
15
+ options[:service] = :dns
16
+ service = Aliyun::Service.new options
17
+ parameters = {}
18
+ dns_service = service.DescribeDomains parameters
19
+
20
+ expect(dns_service).to have_key("Domains")
21
+ expect(dns_service).to have_key("TotalCount")
22
+ end
23
+ 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.5.0.pre
4
+ version: 0.5.0
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-22 00:00:00.000000000 Z
11
+ date: 2017-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,6 +103,7 @@ files:
103
103
  - lib/aliyun/services.rb
104
104
  - lib/aliyun/services/cdn.rb
105
105
  - lib/aliyun/services/cms.rb
106
+ - lib/aliyun/services/dns.rb
106
107
  - lib/aliyun/services/ecs.rb
107
108
  - lib/aliyun/services/ram.rb
108
109
  - lib/aliyun/services/rds.rb
@@ -111,6 +112,7 @@ files:
111
112
  - lib/aliyun/version.rb
112
113
  - spec/aliyun_cdn_spec.rb
113
114
  - spec/aliyun_cms_spec.rb
115
+ - spec/aliyun_dns_spec.rb
114
116
  - spec/aliyun_ecs_spec.rb
115
117
  - spec/aliyun_ram_spec.rb
116
118
  - spec/aliyun_rds_spec.rb
@@ -133,18 +135,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
135
  version: '0'
134
136
  required_rubygems_version: !ruby/object:Gem::Requirement
135
137
  requirements:
136
- - - ">"
138
+ - - ">="
137
139
  - !ruby/object:Gem::Version
138
- version: 1.3.1
140
+ version: '0'
139
141
  requirements: []
140
142
  rubyforge_project:
141
- rubygems_version: 2.4.8
143
+ rubygems_version: 2.6.14
142
144
  signing_key:
143
145
  specification_version: 4
144
146
  summary: Ruby wrapper of Aliyun API for system administrator
145
147
  test_files:
146
148
  - spec/aliyun_cdn_spec.rb
147
149
  - spec/aliyun_cms_spec.rb
150
+ - spec/aliyun_dns_spec.rb
148
151
  - spec/aliyun_ecs_spec.rb
149
152
  - spec/aliyun_ram_spec.rb
150
153
  - spec/aliyun_rds_spec.rb