Class ConsoleCmd


  • public class ConsoleCmd
    extends Object
    Issue a MVS console command.

    This operation issues a command, based on the properties that are specified in the request body. On successful completion, HTTP status code 200 is returned. A JSON object typically contains the command response.

    When a command is issued synchronously, the console API attempts to get the solicited messages immediately after the command is issued. If there are no messages available within a certain time interval, approximately 3 seconds when your system workload is not high, the API returns "cmd-response": "" in the response body.

    A value for cmd-response of the empty string, "", usually means that there is no command response. However, it is also possible that the command response arrived after 3 seconds. If that is the case, you can use the cmd-response-url field in the response body to retrieve the command response. You might do this several times to ensure that all messages that are related to the command are retrieved. This is prebuilt for you via the ConsoleGet class in this package.

    Version:
    5.0
    Author:
    Frank Giordano
    • Constructor Detail

      • ConsoleCmd

        public ConsoleCmd​(ZosConnection connection)
        ConsoleCmd constructor
        Parameters:
        connection - for connection information, see ZosConnection object
    • Method Detail

      • issueCommand

        public ConsoleCmdResponse issueCommand​(String command)
                                        throws ZosmfRequestException
        Issue an MVS console command on default console name (Defcn) done synchronously - meaning solicited (direct command responses) are gathered immediately after the command is issued. However, after (according to the z/OSMF REST API documentation), approximately 3 seconds, the response will be returned.
        Parameters:
        command - string value that represents command to issue
        Returns:
        IssueCommandResponse object
        Throws:
        ZosmfRequestException - request error state
      • issueCommand

        public ConsoleCmdResponse issueCommand​(String command,
                                               String consoleName)
                                        throws ZosmfRequestException
        Issue an MVS console command on a given console name done synchronously - meaning solicited (direct command responses) are gathered immediately after the command is issued. However, after (according to the z/OSMF REST API documentation), approximately 3 seconds, the response will be returned.
        Parameters:
        command - string value representing console command to issue
        consoleName - name of the console that is used to issue the command
        Returns:
        IssueCommandResponse object
        Throws:
        ZosmfRequestException - request error state
      • issueCommandCommon

        public ConsoleCmdResponse issueCommandCommon​(String consoleName,
                                                     ConsoleCmdInputData consoleInputData)
                                              throws ZosmfRequestException
        Issue an MVS console command on a given console name driven by ConsoleCmdInputData settings done synchronously.
        Parameters:
        consoleName - name of the console that is used to issue the command
        consoleInputData - synchronous console issue parameters, see ConsoleCmdInputData object
        Returns:
        IssueCommandResponse object
        Throws:
        ZosmfRequestException - request error state