Class: 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.
Attributes inherited from Model
Instance Method Summary collapse
-
#destroy ⇒ Boolean
Destroys a keypair.
-
#save ⇒ Boolean
Creates a keypair.
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Fog::Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Attribute Details
#fingerprint ⇒ String (readonly)
Returns unique fingerprint.
26 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 26 attribute :fingerprint |
#name ⇒ String
Returns the keypair name.
10 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 10 identity :name |
#private_key ⇒ String (readonly)
Returns the private key.
18 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 18 attribute :private_key |
#public_key ⇒ String (readonly)
Returns the public key.
14 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 14 attribute :public_key |
#user_id ⇒ String (readonly)
Returns the user_id associated to.
22 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 22 attribute :user_id |
Instance Method Details
#destroy ⇒ Boolean
Destroys a keypair
47 48 49 50 51 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 47 def destroy requires :identity service.delete_keypair(identity) true end |
#save ⇒ Boolean
Creates a keypair
34 35 36 37 38 39 |
# File 'lib/fog/rackspace/models/compute_v2/key_pair.rb', line 34 def save requires :name data = service.create_keypair(name, attributes) merge_attributes(data.body['keypair']) data.body['keypair']['name'] == name end |