Where can I find more documentation about the new "Server alert messages" REST service?
Server alert messages
You can use a new REST service to create and manage server alerts. You can use alerts to inform users of important system-wide events, such as scheduled outages or server renames. The messages are displayed in the upper-right corner of the web client, and multiple alerts scroll within the banner.
Where can I find more documentation about this REST service? Idealy with an example. Best would be with and example written with the perl REST functionality you also implemented for administration.
4 answers
Because I do not know how to upload scripts to jazz.net for sharing with others, I have attached my perl script test example and my Javascript test example to the Enhancement request in Jazz.Net.
Both shows you how to connect to Jazz, list actual server messages, create new messages or delete an existing message.
The perl script is embedded in a cmd file. You need to adapt the path to the perl interpreter at the beginning of the file. Maybe you need also som additional moduls for perl.
The Javascript is embedded in a small HTML Userinterface. It's more or less a translation of the perl script. Some stuff is just hardcoded, but for understanding the user interface it is sufficient
Comments
Any idea why some of my JTS return HTML on the postMessage call ?
e.g.
..logonBrowser : begin : [ https://jts03:9443/jts ][ tds ][ jazzpwd ]
POST https://jts03:9443/jts/j_security_check ==> 408 Request Timeout
Authentication to https://jts03:9443/jts completed in 0.70 Seconds.
..logonBrowser : end
..listServerMessages : begin : [ https://jts03:9443/jts ][ false ][ 0 ]
uri: https://jts03:9443/jts/serverMessages
GET https://jts03:9443/jts/serverMessages ==> 302 Found
** GET https://jts03:9443/jts/authenticated/identity?redirectPath=%2Fjts%2FserverMessages ==> 200 OK
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "<!DOCTYPE html>\n\n<...") at post_ServerMessage.pl line 136
The ID is a member of JazzAdmins.
Ok, this might relate to https://jazz.net/library/article/1086/. The jts that do work are deployed under WebSphere, the others, tomcat.
I wrote a perl script which creates server messages according the javadoc. Unfortunatly the message is not displayed on the WEB-UI nor it is recognized as an active message.
I'm running V.4.0.1 of jts and rtc.
Here what I do:
Step 1) Post a new message:
startDate: 1356630501 = Thu, 27 Dec 2012 17:48:21 GMT
endDate: 1356716501 = Fri, 28 Dec 2012 17:41:41 GMT
uri: https://clmtestserver01.mycompany.com/jts/serverMessagessend jsonmsg:
{
"description" : "hello world",
"startDate" : 1356630501,
"endDate" : 1356716501
}response:
{
"itemId" : "_my_ITlBNEeKfgoTUZ8N5Mw",
"endDate" : 1356716501,
"contributorId" : "_T-XVkMeSEeCqLtH8ULpBqw",
"description" : "hello world",
"startDate" : 1356630501
}
Step 2) get Messages
uri: https://clmtestserver01.mycompany.com/jts/serverMessages
response:
{
"identifier" : "itemId",
"label" : "description",
"items" : [
{
"itemId" : "_my_ITlBNEeKfgoTUZ8N5Mw",
"endDate" : 1356716501,
"contributorId" : "_T-XVkMeSEeCqLtH8ULpBqw",
"description" : "hello world",
"startDate" : 1356630501
}
]
}
Step 3) get active messages only
uri: https://clmtestserver01.mycompany.com/jts/serverMessages?active=true
response:
{
"identifier" : "itemId",
"cacheCreationTime" : 1356630567147,
"label" : "description",
"cacheExpireTime" : "9223372036854775807",
"items" : []
}
Any idea what I'm missing to activate the message, so it is displayed like described in the release notes of V.4.0.1?
If it works, I will provide my perl script here for other to use.
Comments
The times should be in milliseconds. Try multiplying the times x1000.
Your a wizard!!
It works. Great. I will post my code soon.
One additional question: why is the message about an expired client access license not listed in the get response and why can this message not be deleted?
Is there an additional methode to register messages?
Would be nice to have this perl script when you get to it.
I have successfully managed to get the server message displayed (using a combination of the code from @schneidg
and the Firefox REST client to do the actual POST). The message appears on all the application pages except for Requirements Management (/rm). Has anyone else also experienced this?
We have recently updated to Jazz RTC version 4.0.3. Until now we were using a self created application for handling the alerts, with the use of REST-Calls.
Now, instead of a JSON String, we get a HTML table as a response value when using the basic REST-URL .../jts/severMessages
Has the API changed? Is there a way to get JSON as a response of the alert messages?
Thanks
For now, the REST interface is described in a Javadoc in the source code....
com.ibm.team.repository.service/servermsg/com/ibm/team/repository/service/servermsg/package.html
Comments
Thank you.
Have you an idea when this UI will be available and what is the capability of it? Do you have a plan item or story where it is described?
I thought I will make an external application based on the REST API to manage this. But if you have planned to bring this in a reasonable time, I would spend my time for others.
regards
Guido
The UI is currently targeted for v4.0.2. However, the items for 4.0.2 are currently in flux, so it may or may not make it into the release. It's work item 235343.
@James: in which source do I find this?