Class: Fog::AWS::EC2::KeyPair
- Defined in:
- lib/fog/aws/models/ec2/key_pair.rb
Instance Attribute Summary collapse
-
#fingerprint ⇒ Object
Returns the value of attribute fingerprint.
-
#material ⇒ Object
Returns the value of attribute material.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(attributes = {}) ⇒ KeyPair
constructor
A new instance of KeyPair.
- #save ⇒ Object
Methods inherited from Model
Constructor Details
#initialize(attributes = {}) ⇒ KeyPair
Returns a new instance of KeyPair.
11 12 13 14 15 16 17 18 |
# File 'lib/fog/aws/models/ec2/key_pair.rb', line 11 def initialize(attributes = {}) remap_attributes(attributes, { 'keyFingerprint' => :fingerprint, 'keyMaterial' => :material, 'keyName' => :name }) super end |
Instance Attribute Details
#fingerprint ⇒ Object
Returns the value of attribute fingerprint.
7 8 9 |
# File 'lib/fog/aws/models/ec2/key_pair.rb', line 7 def fingerprint @fingerprint end |
#material ⇒ Object
Returns the value of attribute material.
7 8 9 |
# File 'lib/fog/aws/models/ec2/key_pair.rb', line 7 def material @material end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/fog/aws/models/ec2/key_pair.rb', line 7 def name @name end |
Instance Method Details
#delete ⇒ Object
20 21 22 |
# File 'lib/fog/aws/models/ec2/key_pair.rb', line 20 def delete connection.delete_key_pair(@name) end |
#save ⇒ Object
24 25 26 27 28 29 |
# File 'lib/fog/aws/models/ec2/key_pair.rb', line 24 def save data = connection.create_key_pair(@name).body new_attributes = data.reject {|key,value| !['keyFingerprint', 'keyMaterial', 'keyName'].include?(key)} update_attributes(new_attributes) data end |