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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mos-sdk.rb +4 -2
  3. data/lib/mos-sdk/base.rb +5 -2
  4. metadata +9 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 455d1131325499109ae500a832783420c65cb5e3
4
- data.tar.gz: f54ef15c9b4fd39a55aa1933cde9d0117a9ce55c
3
+ metadata.gz: 744eaa67cc35169c21dd0145f63f49c87d9e4687
4
+ data.tar.gz: 5682b1b940f1bb0ef548357826ea5fd50632e64b
5
5
  SHA512:
6
- metadata.gz: 6be66b8c213a809dadab92a00e8efdfc5c988a6c773d582a8f2be4eb7032007b2bf42502510ae433a216613ed185a0f51a294b188ebd8524d50645fe2f7430fd
7
- data.tar.gz: b4c6d0405b982f9fb1b0c5c02b9a622ca25a0c1b6c8adfdd32f2687994fc15a9756cfb474adf2ee90a3156093f6dfd623e1c1f5330d64f0c1a23c90689944502
6
+ metadata.gz: f76d1dde43fe25c6eaf6638de7867c37afd3295367278bf77716dc9f58d37a90bbbe18aa1c3660d8dd60649d2d0abbfa9270d017492837aaf99b2bf6a67d2665
7
+ data.tar.gz: 21b5dc14afc1559d1e8e721fffbbdaf919bf1057c25624ff6c6c63646a0bb72dc150d7386a9a8016e7d11b93e21c669a5e2e031aa0264c0a3b18fe541c0de358
@@ -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
@@ -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.use_ssl=true
76
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
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.3
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: 2015-01-20 00:00:00.000000000 Z
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.4.5
70
+ rubygems_version: 2.2.2
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: Ruby SDK for MOS.