Open guitardozer opened 2 years ago
@DavidXRoberts may I have your comments on this please
We certainly could implement this, but there are few issues, which I'm sure are solveable:
This is a zOS 2.4 API but isn't available on our systems. I guess we're back level on maintenance.
We'd need to implement a zOSMF version check.
The IZosConsole
interface has multiple implementations. Wouldn't be able to provide an oeconsol implementation.
Not sure where this could fit in with other priorities.
An alternative (permanent or otherwise) would be for @guitardozer to use the zOSMF Manager directly. IZosmfManagerSpi
is the Manager interface, or from a test:
@ZosImage(imageTag="A")
public IZosImage zosImageA;
@Zosmf(imageTag="A")
public IZosmf zosmf;
@Test
public void testGet() throws ZosmfException {
IZosmfResponse response = zosmf.get("/zosmf/restconsoles/v1/log?time=2021-05-25T07:00Z&timeRange=1h", new ArrayList<>(Arrays.asList(HttpStatus.SC_OK)), false);
JsonObject content = response.getJsonContent();
int totalitems = content.get("totalitems").getAsInt();
JsonArray items = content.getAsJsonArray("items");
for (int i = 0; i < totalitems; i++) {
JsonObject item = items.get(i).getAsJsonObject();
String messageId = item.get("messageId").getAsString();
String message = item.get("message").getAsString();
. . .
}
}
To help with your maintenance search, it was introduced with APAR PH35930 and cor closed on 07/02/2021 for 2.4.
Yeah, I imagine it would only work for zOSMF. Thank you for sharing that snippet. I can try and toy with that at some point.
We would add an exception to the oeconsol implementation to say it is not supported. I have put this on the general backlog. not sure we will get back to it in the next couple of months. MV2D is at 2.4, so we have systems we can use to test it with.
I'd like this feature for the z/OSMF console services to be implemented in Galasa (to the z/OS Console Manager if applicable). This feature enables a user to get the messages from logs on your system, with a few optional parameters.
Resources: Get messages from logs z/OS console services