1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/rackspace/models/compute_v2/keypair.rb

30 lines
616 B
Ruby
Raw Normal View History

2013-07-17 03:18:27 -04:00
require 'fog/core/model'
module Fog
module Compute
class RackspaceV2
class Keypair < Fog::Model
attribute :public_key
attribute :private_key
attribute :user_id
identity :name
attribute :fingerprint
def save
requires :name
data = service.create_keypair(name, public_key)
merge_attributes(data.body['keypair'])
data.body['keypair']['name'] == name
end
def destroy
requires :identity
service.delete_keypair(identity)
true
2013-07-17 03:18:27 -04:00
end
end
end
end
end