Class: Fog::Compute::RackspaceV2::KeyPair
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::RackspaceV2::KeyPair
- Defined in:
- lib/fog/rackspace/models/compute_v2/key_pair.rb
Instance Attribute Summary collapse
-
#fingerprint ⇒ String
readonly
Unique fingerprint.
-
#name ⇒ String
The keypair name.
-
#private_key ⇒ String
readonly
The private key.
-
#public_key ⇒ String
readonly
The public key.
-
#user_id ⇒ String
readonly
The user_id associated to.
Instance Method Summary collapse
-
#destroy ⇒ Boolean
Destroys a keypair.
-
#save ⇒ Boolean
Creates a keypair.
Instance Attribute Details
#fingerprint ⇒ String (readonly)
Returns unique fingerprint.
25 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 25 attribute :fingerprint |
#name ⇒ String
Returns the keypair name.
9 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 9 identity :name |
#private_key ⇒ String (readonly)
Returns the private key.
17 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 17 attribute :private_key |
#public_key ⇒ String (readonly)
Returns the public key.
13 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 13 attribute :public_key |
#user_id ⇒ String (readonly)
Returns the user_id associated to.
21 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 21 attribute :user_id |
Instance Method Details
#destroy ⇒ Boolean
Destroys a keypair
46 47 48 49 50 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 46 def destroy requires :identity service.delete_keypair(identity) true end |
#save ⇒ Boolean
Creates a keypair
33 34 35 36 37 38 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 33 def save requires :name data = service.create_keypair(name, attributes) merge_attributes(data.body['keypair']) data.body['keypair']['name'] == name end |