Question

What I'm trying to do is to get JSON data (whatever it is just make sure I can get anything is ok) from Rallydev without login to make sure that Rallydev is on. I tried several ways, but each way requires a username and password. Would anyone provide a URI for this? Thank you, Guys. Anything you give would be appreciated.

String url = "link";
Client client = Client.create();
WebResource webResource = client.resource(url);
String s = webResource.get(String.class);

try { 
    // check if RallyDev service is up
    if (s.contains("Hello it is now "))
        _log.information("RallyDev is working... at " + new Date());

} catch (Exception e) {
    _log.error(ErrorCodeEnum.INTERNAL_ERROR, "RallyDev service might be down!!! in " + new Date(), e);
} 
Was it helpful?

Solution

Ok, so whether it's Jersey client or plain old HTTP GET against Rally, I'm coming back to my original comment that developing a Java app to do this is a bit overkill. You could accomplish the same thing with a one-line curl command in Linux:

  curl -u 'rallyuser@company.com:rallypassword' https://rally1.rallydev.com/slm/webservice/1.33/hierarchicalrequirement.js?pagesize=1

A valid (Rally is up and responding) response to this might look like:

  {"QueryResult": {"_rallyAPIMajor": "1", "_rallyAPIMinor": "33", "Errors": [], "Warnings": [], "TotalResultCount": 84, "StartIndex": 1, "PageSize": 1, "Results": [{"_rallyAPIMajor": "1", "_rallyAPIMinor": "33", "_ref": "https://rally1.rallydev.com/slm/webservice/1.33/hierarchicalrequirement/12345678910.js", "_refObjectName": "My Story Name", "_type": "HierarchicalRequirement"}]}}

OTHER TIPS

Looks like you're using Jersey Client to setup a REST connection in Java. Are you really needing to do this without providing credentials? You'll need to pass credentials of some sort as any query-able endpoint in Rally is going to require HTTP Basic Authentication.

If you are looking for the appropriate REST syntax and endpoints to formulate a valid query, you may wish to look at our Webservices API documentation on REST queries:

https://rally1.rallydev.com/slm/doc/webservice/rest.jsp

As an example, a valid REST URL to do a query and get back JSON-formatted results is as follows. A GET against the following sample URL queries user stories owned by user: user@company.com:

https://rally1.rallydev.com/slm/webservice/1.33/hierarchicalrequirement.js?query=(Owner = "user@company.com")&pagesize=1

This would return the first matching User Story.

A simple example of accessing Rally REST services in Java is here:

http://www.rallydev.com/help/basic-rest-client-operations-java

And a full (alpha-release) Java REST API toolkit for Rally is here:

http://www.rallydev.com/developer/java-toolkit-rally-rest-api

All of the above seems like a bit overkill for just finding out if the Rally service is up. You can subscribe to Rally's status updates via RSS at http://status.rallydev.com as a good way to stay apprised of system status information.

I hope this helps - if the answer is off-target, please provide some further clarifying comments and we'll do our best to answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top