    # File lib/fog/hp/requests/compute/create_key_pair.rb, line 23
            def create_key_pair(key_name, public_key = nil)
              if public_key.nil?
                data = {
                  'keypair' => {
                    'name' => key_name
                  }
                }
              else
                data = {
                  'keypair' => {
                    'name'       => key_name,
                    'public_key' => public_key
                  }
                }
              end

              request(
                :body     => Fog::JSON.encode(data),
                :expects  => 200,
                :method   => 'POST',
                :path     => 'os-keypairs.json'
              )
            end