# File lib/fog/rackspace/requests/compute_v2/create_keypair.rb, line 20 def create_keypair(key_name, attributes = nil) key_data = { 'name' => key_name } if attributes.is_a?(String) Fog::Logger.deprecation "Passing the public key as the 2nd arg is deprecated, please pass a hash of attributes." key_data.merge!("public_key" => attributes) end key_data.merge!(attributes) if attributes.is_a?(Hash) data = { 'keypair' => key_data } request( :method => 'POST', :expects => 200, :path => '/os-keypairs', :body => Fog::JSON.encode(data) ) end