jiak and ruby state

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

jiak and ruby state

Chris Dawson
Hi there,

I've been playing with riak the last few days.  I tried using the jiak.rb library and when I use it as this presentation (http://riak.basho.com/nyc-nosql/) suggests I get this error: 

irb(main):001:0> require 'jiak'
=> true
irb(main):002:0> jc = Riak::Client.new '127.0.0.1', 8098
=> #<Riak::Client:0x2b582c5a4cb8 @opts={"clientId"=>"0G3GdQ=="}, @prefix="/jiak/", @port=8098, @ip="127.0.0.1">
irb(main):003:0> jc.set_bucket_schema('artist', { 'allowed_fields' => [ 'foo', 'bar' ] } )
./jiak.rb:137:in `do_req': 404 Object Not Found <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML> (Riak::ClientException)

After browsing around I thought perhaps I needed to use the "raw" interface, but then I get this:

irb(main):004:0> jc = Riak::Client.new( '127.0.0.1', 8098, '/raw/' )
=> #<Riak::Client:0x2b8ef589c060 @opts={"clientId"=>"rXvO6g=="}, @prefix="/raw/", @port=8098, @ip="127.0.0.1">
irb(main):005:0> jc.set_bucket_schema( 'foobar', { 'allowed_fields' => [ 'foo', 'bar' ] } )
./jiak.rb:137:in `do_req': 400 Bad Request bucket PUT must be a JSON object of the form: (Riak::ClientException)
{"props":{...bucket properties...}} from ./jiak.rb:55:in `set_bucket_schema'
from (irb):5:in `irb_binding'
from /usr/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
from /usr/lib/ruby/1.8/irb/workspace.rb:52

I'm not sure where to go next.  What is the correct way to connect using this jiak library?  I saw a posting somewhere suggesting that jiak will soon be deprecated?  Has this already happened?  What is the current state of the art to connect using ruby?

I'm actually OK even were I to have to use curl because I could write a wrapper around the commands.  But right now when I run:

<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>

So, I figure I need to reconfigure something on riak, or I am using the wrong interface.

Thanks,
Chris
--
Chris Dawson
971-533-8335


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: jiak and ruby state

Grant Schofield
Yes, Jiak interface is being removed and the raw interface should be used instead. For Ruby the library to use is Ripple, made by Sean Cribbs. You can can more information on using it at http://seancribbs.com/. I hope this helps, but if you have any problems post them here or pop into the #riak channel on irc.freenode.net.

Grant


On Mar 6, 2010, at 11:47 AM, Chris Dawson wrote:

Hi there,

I've been playing with riak the last few days.  I tried using the jiak.rb library and when I use it as this presentation (http://riak.basho.com/nyc-nosql/) suggests I get this error: 

irb(main):001:0> require 'jiak'
=> true
irb(main):002:0> jc = Riak::Client.new '127.0.0.1', 8098
=> #<Riak::Client:0x2b582c5a4cb8 @opts={"clientId"=>"0G3GdQ=="}, @prefix="/jiak/", @port=8098, @ip="127.0.0.1">
irb(main):003:0> jc.set_bucket_schema('artist', { 'allowed_fields' => [ 'foo', 'bar' ] } )
./jiak.rb:137:in `do_req': 404 Object Not Found <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML> (Riak::ClientException)

After browsing around I thought perhaps I needed to use the "raw" interface, but then I get this:

irb(main):004:0> jc = Riak::Client.new( '127.0.0.1', 8098, '/raw/' )
=> #<Riak::Client:0x2b8ef589c060 @opts={"clientId"=>"rXvO6g=="}, @prefix="/raw/", @port=8098, @ip="127.0.0.1">
irb(main):005:0> jc.set_bucket_schema( 'foobar', { 'allowed_fields' => [ 'foo', 'bar' ] } )
./jiak.rb:137:in `do_req': 400 Bad Request bucket PUT must be a JSON object of the form: (Riak::ClientException)
{"props":{...bucket properties...}} from ./jiak.rb:55:in `set_bucket_schema'
from (irb):5:in `irb_binding'
from /usr/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
from /usr/lib/ruby/1.8/irb/workspace.rb:52

I'm not sure where to go next.  What is the correct way to connect using this jiak library?  I saw a posting somewhere suggesting that jiak will soon be deprecated?  Has this already happened?  What is the current state of the art to connect using ruby?

I'm actually OK even were I to have to use curl because I could write a wrapper around the commands.  But right now when I run:

<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>

So, I figure I need to reconfigure something on riak, or I am using the wrong interface.

Thanks,
Chris
--
Chris Dawson
971-533-8335

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Reply | Threaded
Open this post in threaded view
|

Re: jiak and ruby state

Sean Cribbs-2
Chris,

Just to be clear, you can install Ripple as a rubygem, or by cloning the git repository:

gem install ripple


There's extensive API documentation at http://seancribbs.github.com/ripple

Sean Cribbs <[hidden email]>
Developer Advocate
Basho Technologies, Inc.

On Mar 6, 2010, at 1:43 PM, Grant Schofield wrote:

Yes, Jiak interface is being removed and the raw interface should be used instead. For Ruby the library to use is Ripple, made by Sean Cribbs. You can can more information on using it at http://seancribbs.com/. I hope this helps, but if you have any problems post them here or pop into the #riak channel on irc.freenode.net.

Grant


On Mar 6, 2010, at 11:47 AM, Chris Dawson wrote:

Hi there,

I've been playing with riak the last few days.  I tried using the jiak.rb library and when I use it as this presentation (http://riak.basho.com/nyc-nosql/) suggests I get this error: 

irb(main):001:0> require 'jiak'
=> true
irb(main):002:0> jc = Riak::Client.new '127.0.0.1', 8098
=> #<Riak::Client:0x2b582c5a4cb8 @opts={"clientId"=>"0G3GdQ=="}, @prefix="/jiak/", @port=8098, @ip="127.0.0.1">
irb(main):003:0> jc.set_bucket_schema('artist', { 'allowed_fields' => [ 'foo', 'bar' ] } )
./jiak.rb:137:in `do_req': 404 Object Not Found <HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML> (Riak::ClientException)

After browsing around I thought perhaps I needed to use the "raw" interface, but then I get this:

irb(main):004:0> jc = Riak::Client.new( '127.0.0.1', 8098, '/raw/' )
=> #<Riak::Client:0x2b8ef589c060 @opts={"clientId"=>"rXvO6g=="}, @prefix="/raw/", @port=8098, @ip="127.0.0.1">
irb(main):005:0> jc.set_bucket_schema( 'foobar', { 'allowed_fields' => [ 'foo', 'bar' ] } )
./jiak.rb:137:in `do_req': 400 Bad Request bucket PUT must be a JSON object of the form: (Riak::ClientException)
{"props":{...bucket properties...}} from ./jiak.rb:55:in `set_bucket_schema'
from (irb):5:in `irb_binding'
from /usr/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
from /usr/lib/ruby/1.8/irb/workspace.rb:52

I'm not sure where to go next.  What is the correct way to connect using this jiak library?  I saw a posting somewhere suggesting that jiak will soon be deprecated?  Has this already happened?  What is the current state of the art to connect using ruby?

I'm actually OK even were I to have to use curl because I could write a wrapper around the commands.  But right now when I run:

<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>

So, I figure I need to reconfigure something on riak, or I am using the wrong interface.

Thanks,
Chris
--
Chris Dawson
971-533-8335

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


_______________________________________________
riak-users mailing list
[hidden email]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com