mos-sdk 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mos-sdk.rb +4 -2
- data/lib/mos-sdk/base.rb +5 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 744eaa67cc35169c21dd0145f63f49c87d9e4687
|
4
|
+
data.tar.gz: 5682b1b940f1bb0ef548357826ea5fd50632e64b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f76d1dde43fe25c6eaf6638de7867c37afd3295367278bf77716dc9f58d37a90bbbe18aa1c3660d8dd60649d2d0abbfa9270d017492837aaf99b2bf6a67d2665
|
7
|
+
data.tar.gz: 21b5dc14afc1559d1e8e721fffbbdaf919bf1057c25624ff6c6c63646a0bb72dc150d7386a9a8016e7d11b93e21c669a5e2e031aa0264c0a3b18fe541c0de358
|
data/lib/mos-sdk.rb
CHANGED
@@ -113,7 +113,7 @@ class MOS::Client
|
|
113
113
|
# - @param [Integer] datadisk 指定创建虚拟机使用的额外数据盘,单位为1GB
|
114
114
|
# - @param [Integer] bandwidth 指定创建虚拟机使用的额外带宽,单位为Mbps
|
115
115
|
# - @return [Hash] 创建成功的虚拟机信息
|
116
|
-
def create_instance(imageid, itype, duration=nil, name=nil, keypair=nil, datadisk=nil, bandwidth=nil)
|
116
|
+
def create_instance(imageid, itype, duration=nil, name=nil, keypair=nil, secgroup=nil, datadisk=nil, bandwidth=nil, zone=nil)
|
117
117
|
kwargs = {}
|
118
118
|
kwargs['ImageId'] = imageid
|
119
119
|
kwargs['InstanceType'] = itype
|
@@ -125,6 +125,8 @@ class MOS::Client
|
|
125
125
|
kwargs['KeyName'] = keypair unless keypair.nil?
|
126
126
|
kwargs['ExtraExtDisksize'] = datadisk unless datadisk.nil?
|
127
127
|
kwargs['ExtraExtBandwidth'] = bandwidth unless bandwidth.nil?
|
128
|
+
kwargs['GroupId'] = secgroup unless secgroup.nil?
|
129
|
+
kwargs['AvailabilityZoneId'] = zone unless zone.nil?
|
128
130
|
val = self.request('CreateInstance', *kwargs)
|
129
131
|
val['Instance']
|
130
132
|
end
|
@@ -312,4 +314,4 @@ class MOS::Client
|
|
312
314
|
kwargs['TemplateId'] = tid
|
313
315
|
self.request('DeleteTemplate', *kwargs)
|
314
316
|
end
|
315
|
-
end
|
317
|
+
end
|
data/lib/mos-sdk/base.rb
CHANGED
@@ -72,8 +72,11 @@ class MOS::Base
|
|
72
72
|
|
73
73
|
uri = URI.parse(self.url)
|
74
74
|
http = Net::HTTP.new(uri.host, uri.port)
|
75
|
-
http.
|
76
|
-
|
75
|
+
http.open_timeout=@timeout
|
76
|
+
if (uri.scheme == 'https')
|
77
|
+
http.use_ssl=true
|
78
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
79
|
+
end
|
77
80
|
http.request_post('/', data, headers)
|
78
81
|
end
|
79
82
|
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mos-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yangcs2009
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
description: Ruby SDK for MOS.
|
@@ -57,17 +57,17 @@ require_paths:
|
|
57
57
|
- lib
|
58
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
69
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.
|
70
|
+
rubygems_version: 2.2.2
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: Ruby SDK for MOS.
|