qc.rb 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/qc.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c73394f5cbe561682a690ba3648e5b28800d133b
|
4
|
+
data.tar.gz: fad055c3865c6152092171d222607437c9b5b560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 519ec0687b5672af197515405e0941e8f9b2db6b0d00913d34c962e2e0e062e72cbdfa6c2d5d9835bd6569324cad74082726338938b805a2a07ad38ee76ad7e2
|
7
|
+
data.tar.gz: 43baa22d2da219f4d72640edc11edfef3a1e390ff2f706ecade835ab08a0c49e301ba8169aca3e1d71064023f79a6f70da82cde8ca84a5e09ed41cb79504d03a
|
data/README.md
CHANGED
@@ -73,6 +73,13 @@ i = QC::Instance.load 'i-adssad7'
|
|
73
73
|
i.ip = 'eip-sadjkdsa7' # => 'eip-sadjkdsa7'
|
74
74
|
```
|
75
75
|
|
76
|
+
Add Key Pair to Instance
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
i = QC::Instance.load 'i-adssad7'
|
80
|
+
i.add_keypair 'kp-2hadqpv3' # => 'kp-2hadqpv3'
|
81
|
+
```
|
82
|
+
|
76
83
|
#### IPs
|
77
84
|
|
78
85
|
Get all IPs:
|
data/lib/qc.rb
CHANGED
@@ -7,7 +7,7 @@ require 'yaml'
|
|
7
7
|
require 'fileutils'
|
8
8
|
|
9
9
|
module QC
|
10
|
-
VERSION = '0.0.
|
10
|
+
VERSION = '0.0.6'
|
11
11
|
|
12
12
|
def QC.load_config key
|
13
13
|
f = File.expand_path('~/.qingcloud/config.yaml')
|
@@ -93,11 +93,12 @@ module QC
|
|
93
93
|
end
|
94
94
|
|
95
95
|
class Instance < DataType
|
96
|
+
DEFAULT_IMAGE_ID = 'trustysrvx64a'
|
96
97
|
@identifier = 'Instance'
|
97
98
|
|
98
|
-
def Instance.run p = {image_id:
|
99
|
+
def Instance.run p = {image_id: DEFAULT_IMAGE_ID, instance_name: nil, count: 1, login_mode: 'keypair',
|
99
100
|
login_keypair: nil, login_passwd: nil, security_group: nil, zone: nil, instance_type: 'small_a'}
|
100
|
-
p[:image_id] =
|
101
|
+
p[:image_id] = DEFAULT_IMAGE_ID if p[:image_id].nil?
|
101
102
|
p[:login_mode] = 'keypair' if p[:login_mode].nil?
|
102
103
|
p[:instance_type] = 'small_a' if p[:instance_type].nil?
|
103
104
|
p['vxnets.1'] = 'vxnet-0' if p['vxnets.1'].nil?
|