Class: Fog::Compute::RackspaceV2::KeyPairs
- Inherits:
-
Fog::Collection
- Object
- Fog::Collection
- Fog::Compute::RackspaceV2::KeyPairs
- Defined in:
- lib/fog/rackspace/models/compute_v2/key_pairs.rb
Instance Method Summary collapse
-
#all ⇒ Fog::Compute::RackspaceV2::Keypairs
Fetch the list of known keypairs.
-
#get(key_name) ⇒ Fog::Compute::RackspaceV2::Keypair
Fetch keypair details.
Instance Method Details
#all ⇒ Fog::Compute::RackspaceV2::Keypairs
Fetch the list of known keypairs
16 17 18 19 20 21 22 |
# File 'lib/fog/rackspace/models/compute_v2/key_pairs.rb', line 16 def all data = [] service.list_keypairs.body['keypairs'].each do |kp| data << kp['keypair'] if kp['keypair'] end load(data) end |
#get(key_name) ⇒ Fog::Compute::RackspaceV2::Keypair
Fetch keypair details
30 31 32 33 34 35 36 |
# File 'lib/fog/rackspace/models/compute_v2/key_pairs.rb', line 30 def get(key_name) begin new(service.get_keypair(key_name).body['keypair']) rescue Fog::Compute::RackspaceV2::NotFound nil end end |