Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling responses for Send OS Command #502

Open
AKippins opened this issue Apr 26, 2018 · 4 comments
Open

Handling responses for Send OS Command #502

AKippins opened this issue Apr 26, 2018 · 4 comments

Comments

@AKippins
Copy link

Is it possible to make it so that when using the Send OS Command functionality that you get back the response in an object or some other manner?

So for example if I do a D IPLINFO it comes back as the returned information or what not.

@andy-maier
Copy link
Member

andy-maier commented May 14, 2018

@AKippins Hi Aaron.

The Send OS Command operation at the WS API does not return its output. The output appears in the OS message channel, but the difficulty is correlating the output stream that appears there, with the command that was issued. That difficulty is also present at the interface to the operating system running in the partition. We can have another look at this, but chances are dim that it can be solved.

Your best chance is to combine Send OS Command with the output stream of the OS message channel, and have a human correlate command and output. If you know that you're the only one sending OS commands to a particular partition, then of course you can assume that anything that comes back after sending the command belongs to the command output, but you don't know when the output is complete, nor do you know whether the output contains data originated by something else but your command.

The zhmccli project has implemented a command shell based on sending any input line as an OS command, and displaying the OS message channel in the shell as output. Look at the zhmc partition console command, whose relevant function implementing this is here.

@andy-maier andy-maier self-assigned this May 14, 2018
@andy-maier
Copy link
Member

What we could implement is a function that sends the command and waits for a period of time and returns all output it has received until then. But that function would have no guarantee to return the complete output or only the command's output. Let me know if you want such a function.

@andy-maier
Copy link
Member

On your example command D IPLINFO: Is the target partition running z/OS?

@AKippins
Copy link
Author

Yes, I am running z/OS. I already realized that it didn't return the output of the message. I basically already have that setup of monitoring the message stream and using regular expressions to match on the desired message and grab it. I was hoping that it may be possible to provide the direct output since I believe that the Java SDSF library is capable of doing so.

My issue is that i'm trying to use this as an alternative to allow us to automate our environments. Without the ability to retrieve the message response directly, I'll have a tough time convincing people that it's a viable route to take. I'm a Z tester at the Poughkeepsie site and I know it'd be tough to get people onboard with the lack of that functionality. I'm assuming the same would ring true for some of our customers. I'd need it to mimic SDSF like behavior which isn't really an issue for you guys but I was just curious to see if it was possible.

@andy-maier andy-maier added this to the 0.27.0 milestone Jan 24, 2020
@andy-maier andy-maier modified the milestones: 0.27.0, 0.28.0 Sep 10, 2020
@andy-maier andy-maier modified the milestones: 0.28.0, 0.29.0 Dec 20, 2020
@andy-maier andy-maier modified the milestones: 0.29.0, 0.30.0 Mar 14, 2021
@andy-maier andy-maier removed this from the 0.30.0 milestone Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants