qc.rb 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -0
  3. data/lib/qc.rb +4 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e43aef3b3a8df7954b9526722c6a719b580c8a99
4
- data.tar.gz: a0d66dc846228f27ec97136d2e564a407f5143f6
3
+ metadata.gz: c73394f5cbe561682a690ba3648e5b28800d133b
4
+ data.tar.gz: fad055c3865c6152092171d222607437c9b5b560
5
5
  SHA512:
6
- metadata.gz: bd700ca5baf8f6ce9853ee5691528575806f72c6f25ddb0eca10c470cbc491a1342924400d219142947c27160d19da572df9e0722ec88490376ab701190aa411
7
- data.tar.gz: 9c35bb98e743aa179c6c705e06c98affef9c2915b9f2ec554f49b37d811cccf20c1a7e0a989807f01151ab74718971e18e0c8d8c7c16fa4400774bcaaa72ce29
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.5'
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: 'trustysrvx64a', instance_name: nil, count: 1, login_mode: 'keypair',
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] = 'trustysrvx64' if p[:image_id].nil?
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?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qc.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bovensiepen