class Fog::Compute::RackspaceV2::KeyPair

Public Instance Methods

destroy() click to toggle source

Destroys a keypair @return [Boolean] true if the keypair is successfully deleted @raise [Fog::Compute::RackspaceV2::NotFound] @raise [Fog::Compute::RackspaceV2::BadRequest] @raise [Fog::Compute::RackspaceV2::InternalServerError] @raise [Fog::Compute::RackspaceV2::ServiceError]

# File lib/fog/rackspace/models/compute_v2/key_pair.rb, line 46
def destroy
    requires :identity
    service.delete_keypair(identity)
    true
end
save() click to toggle source

Creates a keypair @return [Boolean] true if the keypair is successfully created @raise [Fog::Compute::RackspaceV2::NotFound] @raise [Fog::Compute::RackspaceV2::BadRequest] @raise [Fog::Compute::RackspaceV2::InternalServerError] @raise [Fog::Compute::RackspaceV2::ServiceError]

# 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