-
Notifications
You must be signed in to change notification settings - Fork 26
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
Comments
@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 |
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. |
On your example command |
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. |
@AKippins Aaron, note that we now have such a functionality in the ibm_zhmc Ansible collection as per PR zhmcclient/zhmc-ansible-modules#1033. I don't want to add suc a complex algorithm to the zhmcclient library, but if you want to build a function around the zhmcclient I am finally closing this ticket. |
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.The text was updated successfully, but these errors were encountered: