mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
28 lines
585 B
Ruby
28 lines
585 B
Ruby
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
|
|
service.delete_keypair(identity)
|
|
true
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|