IBM Z ChatOps Commands

IBM Z® ChatOps commands provide a simple and streamlined way to interact with IBM Z ChatOps.

Command Structure

Most IBM Z ChatOps commands should adhere to the following complete form.

Form:
Read syntax diagramSkip visual syntax diagram@ botnameresourceactionobjectpositional_argumentsoptions
Examples:
  • @bnz automation-domain list system AOBC --domain-name “LPAR400J INGXSGSA”
  • @bnz automation-domain

You can see the detailed command syntax for more information.

Table 1. Command form
Segment Description Notes®
@botname The name of the bot user that is notified to perform the Z ChatOps commands, for example, bnz. @bnz is used for all example commands in this guide.
resource The target resource that you want the bot user to operate on, for example, automation-domain. Each resource contains a set of actions.

The current version supports the following resources.

Resource is required for commands. All available resources are listed here. You can use either the complete resource name or the abbreviation, for example, ad or automation-domain.
action The target operation that you want the bot user to perform, for example, list. Action is optional for some list commands. When it is optional is described in specific commands topics.
object The target property that you want the bot user to operate on, for example, system. You can use either the complete object name or the abbreviation.
positional argument The name, ID, or other properties that are used to tell the bot user to operate on one specific resource, for example, AOBC, the name of one system. * is a wildcard character that you can use to search for resource with certain characters in its property.

* represents zero or more characters in a string of characters.

You can place the wildcard character * at the beginning, the end, or both the beginning and the end of the command positional argument.

options The additional properties of a resource that you want the bot user to filter out, for example, --domain-name “LPAR400J INGXSGSA” specifies the target domain.
  1. When the object is status and there is no positional argument specified for this type of command, the object status can be omitted in the command, and Z ChatOps will list the status of your specified resource.
  2. When there is a space character in the value name, you must use quotation marks to quote the value name as shown in the example.
  3. Some options are required, and some are optional. All required options must be specified, or else the bot doesn’t know which resource you want to operate on.
  4. For some commands, there can be numerous results. Z ChatOps will return the found results of a certain number which you can configure in the configuration file at $ZCHATOPS_HOME/config/bnz-server.yaml. If you have additional requirements on the number of returned results, you can always add the option --limit number, where number is a positive integer.
  5. Except for @botname help, @botname default, @botname alias, @botname credential-store, and @botname command commands, all Z ChatOps commands support --json-format or --jf option. You can use the option to get bot response messages in JSON format.
Note: If you use Slack client on a Mac operating system, when you use quotation marks to quote some strings containing spaces, the single and double quotation marks in English are auto-converted to non-English ones when you type any non-space character behind them, so that Z ChatOps cannot parse the command. You must change the default keyboard setting on your Mac with the following steps.
  1. Click System Preferences.
  2. Click Keyboard and the Keyboard window opens.
  3. Click Text tab and clear the check box Use smart quote and dashes as shown in the picture.
    Figure 1. Keyboard clear
    Clear default check box for keyboard