On Mon, Nov 9, 2015 at 10:45 AM, Gandhimathi Velusamy <[email protected]>
wrote:
> The returned values are in Unicode and if I need to use them in my
> program, I could not do it.
>
Only the keys are unicode (although only by luck - all JSON strings are
unicode), not the values.
> I tried to decode it using decode('utf-8') but it is giving error as:
> .'dict' object has no attribute 'decode'
>
Why are you trying to decode it? You can just work with them as unicode.
> I want to push new flow rules if the byte count exceeds certain values
> from rest api.
> Can I do it by reading the byte count from rest api as below.
>
You can just access res[<dpid_int>][0]["byte_count"]
You'll have to know what the dpid integer value is, but you passed it into
your URL, so you should have it in a variable already.
--
Nick
------------------------------------------------------------------------------
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel