qc.rb 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/qc.rb +7 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae08ba1cf263702568ebd4ff9b7f59b18cc1c1ba
4
- data.tar.gz: ae80e5630812e582d9c33d6e1c832fcc488a6954
3
+ metadata.gz: 9f4bae9f70f39beea8f5bc85e67726890219308b
4
+ data.tar.gz: 201905bdd1341187c2365d7aa7d02d93f27f8b26
5
5
  SHA512:
6
- metadata.gz: cf07fade57e80029a36f097d038daea0e80ce7e80b8f689594390a5e14283d64e11a9273c55d8da13d0ca06f5b19589d19a2e81069b611cbece5523ef7a84eae
7
- data.tar.gz: 125c8e40b59ccfff5e183a9dfda0f499a72157b61f42a1a840e53ddf539df79ed621a4e2f0b0716da8eca386374b996071dca3b1ca647545211f844839de2cf3
6
+ metadata.gz: 003faec680c06f035e6ba9882a816fd05079cd4646ee569c7bee51151dab9407bf20db0a2ab833b9c70580999ac18ecc7f49f09036f44372be5f446171025a52
7
+ data.tar.gz: 9e4f47fcb21364fcfe79ea9a4160edbb456db31e8f423bdc0eab8b207206db7ea879ef605a534ceb4e048d40bee656b41e3e559d79c0c1dc1e856bfa3979cdcc
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.3'
10
+ VERSION = '0.0.4'
11
11
 
12
12
  def QC.load_config key
13
13
  f = File.expand_path('~/.qingcloud/config.yaml')
@@ -69,7 +69,7 @@ module QC
69
69
  @values.to_yaml
70
70
  end
71
71
 
72
- def method_missing met
72
+ def method_missing met, *args, &block
73
73
  if @values.has_key? met.to_s
74
74
  @values[met.to_s]
75
75
  else
@@ -118,6 +118,11 @@ module QC
118
118
  p = {'instance' => @values['instance_id'], 'eip' => eip_id}
119
119
  API::Request.execute!('AssociateEip', p)
120
120
  end
121
+
122
+ def add_keypair kp_id
123
+ p = {'instances.n1' => @values['instance_id'], 'keypairs.1' => kp_id}
124
+ API::Request.execute!('AttachKeyPairs', p)
125
+ end
121
126
  end
122
127
 
123
128
  class Volume < DataType
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bovensiepen
@@ -33,12 +33,12 @@ require_paths:
33
33
  - lib
34
34
  required_ruby_version: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - '>='
36
+ - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - '>='
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  requirements: []