Resources Status
1) (http://docs.saffronsierra.com/Resources-Status)
lists rref as the parameter to the individual status call, but the
parameter is now rr
2) Using rr and calling the individual status, the response has
brackets [] around the JSON array that is not a valid format (stack
trace):
Response:[{"rac":"add","rst":"passed","dc":"2010-04-09T13:57:41Z"}]
net.sf.json.JSONException: A JSONObject text must begin with '{' at character 1 of
[{"rac":"add","rst":"passed","dc":"2010-04-09T13:57:41Z"}]
at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:505)
at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:1144)
at net.sf.json.JSONObject._fromString(JSONObject.java:1373)
at net.sf.json.JSONObject.fromObject(JSONObject.java:161)
at net.sf.json.JSONObject.fromObject(JSONObject.java:130)
3) Also, what do all the response fields represent in both response types?
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Chet Patel on 09 Apr, 2010 06:20 PM
The response is an array with multiple status blocks. You should use a JSONArray object to parse the response string.
Here is an example.
[ {
}, {
} ]
3 Posted by Ryan Quam on 09 Apr, 2010 06:45 PM
That works, thanks. Since it always returns one status block, I thought it should be a single object and not an array. Is there a way to query multiple resources to get multiple status blocks returned?
Support Staff 4 Posted by Chet Patel on 09 Apr, 2010 07:14 PM
There is an overall status call for resources. '/resources/status'
It shows the number of resources that are in the following states: 'passed', 'failed', 'working', 'pending' and 'paused' resources.
{ "nps": 993, "nf": 11, "nw": 0, "npd": 0, "npdg": 0 }
5 Posted by Ryan Quam on 09 Apr, 2010 07:32 PM
I've been using that call as well. I just wondered if there was REST call that I could issue that would a return a response like your sample response (#2) so I could test the handling of multiple status blocks in the JSONArray.
Support Staff 6 Posted by Chet Patel on 09 Apr, 2010 08:27 PM
Right now there is no way to retrieve status for multiple resources.
Just for a single resource, multiple status blocks could be for 'add'
and 'remove' actions.
Chet Patel closed this discussion on 12 Apr, 2010 03:17 PM.