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 +4 -4
- data/.travis.yml +5 -4
- data/README.md +1 -0
- data/lib/aliyun/services.rb +2 -0
- data/lib/aliyun/services/cms.rb +2 -2
- data/lib/aliyun/services/dns.rb +24 -0
- data/lib/aliyun/version.rb +1 -1
- data/spec/aliyun_cms_spec.rb +12 -12
- data/spec/aliyun_dns_spec.rb +23 -0
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24f249568cd9de8c09fedfe4e5a846e21828e018
|
4
|
+
data.tar.gz: 74c41834e2dd4b7ec6e650afefc090000794b53a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df5968523cdf0eda0ff24c8e289e382ef1021c8a3264b409dbf6e94afb433aa1fe3771552bfa397a76f3a706b7d42f4511d2b62c34eb51549d3d82a3c31a5602
|
7
|
+
data.tar.gz: efbf9032241e9d59f694747168c3c3c881998f03dc953daea9fd64505f8536828faced6cda1f8222109a23e868addaddb2a3316bea09d351f73dece97b44e8b8
|
data/.travis.yml
CHANGED
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)
|
data/lib/aliyun/services.rb
CHANGED
@@ -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,
|
data/lib/aliyun/services/cms.rb
CHANGED
@@ -4,12 +4,12 @@ module Aliyun
|
|
4
4
|
"Aliyu CMS Service"
|
5
5
|
end
|
6
6
|
def self.endpoint
|
7
|
-
|
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=>"
|
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
|
data/lib/aliyun/version.rb
CHANGED
data/spec/aliyun_cms_spec.rb
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Aliyun do
|
4
|
-
|
4
|
+
before do
|
5
5
|
options = load_options
|
6
6
|
options[:service] = :cms
|
7
|
-
|
7
|
+
options[:endpoint_url] = 'http://metrics.cn-beijing.aliyuncs.com/'
|
8
|
+
@service = Aliyun::Service.new options
|
9
|
+
end
|
8
10
|
|
9
|
-
|
10
|
-
expect(service
|
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
|
-
|
21
|
-
|
20
|
+
Project: 'acs_ecs_dashboard',
|
21
|
+
Metric: 'diskusage_utilization',
|
22
22
|
StartTime: (Time.now - 180).utc.iso8601,
|
23
|
-
Dimensions: "{instanceId:'%s',
|
23
|
+
Dimensions: "{instanceId:'%s',device:'/dev/xvda1'}" % instanceId,
|
24
24
|
RegionId: instanceRegion,
|
25
25
|
Length: 1000
|
26
26
|
}
|
27
|
-
metric_datum = service.
|
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("
|
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
|
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:
|
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:
|
140
|
+
version: '0'
|
139
141
|
requirements: []
|
140
142
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
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
|