Is there any reason why the Pike RPC is not returning an array and instead using integer suffixes? ip_addr0, ip_addr1, etc
If it will not break anything I would like to change this behavior.
here is a sample:
{ "max_hits":16, "ip_addr0":"XX0.5X.X3.1XX", "leaf_hits_prev0":51, "leaf_hits_curr0":9, "expires0":4, "status0":"HOT", "ip_addr1":"XX8.1X9.8.X7", "leaf_hits_prev1":17, "leaf_hits_curr1":0, "expires1":2, "status1":"HOT", "number_of_rows":2 }
here is what i propose:
{ "max_hits":16, "number_of_rows":2, "list" : [ { "ip_addr":"XX0.5X.X3.1XX", "leaf_hits_prev":51, "leaf_hits_curr":9, "expires":4, "status":"HOT" }, { "ip_addr":"XX8.1X9.8.X7", "leaf_hits_prev":17, "leaf_hits_curr":0, "expires":2, "status":"HOT" } ] }
Kelvin Chua
Hello,
no sure why it was developed like this, maybe just a bare translation from the mi old format.
The proposed format is better and properly following structured responses for rpc. If you want to develop it, go ahead and then make a pull request, it will be merged.
Thanks, Daniel
On 24/08/16 09:47, Kelvin Chua wrote:
Is there any reason why the Pike RPC is not returning an array and instead using integer suffixes? ip_addr0, ip_addr1, etc
If it will not break anything I would like to change this behavior.
here is a sample:
{ "max_hits":16, "ip_addr0":"XX0.5X.X3.1XX", "leaf_hits_prev0":51, "leaf_hits_curr0":9, "expires0":4, "status0":"HOT", "ip_addr1":"XX8.1X9.8.X7", "leaf_hits_prev1":17, "leaf_hits_curr1":0, "expires1":2, "status1":"HOT", "number_of_rows":2 }
here is what i propose:
{ "max_hits":16, "number_of_rows":2, "list" : [ { "ip_addr":"XX0.5X.X3.1XX", "leaf_hits_prev":51, "leaf_hits_curr":9, "expires":4, "status":"HOT" }, { "ip_addr":"XX8.1X9.8.X7", "leaf_hits_prev":17, "leaf_hits_curr":0, "expires":2, "status":"HOT" } ] }
Kelvin Chua
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev