Input and output types


While all CLI interactions (command calls and output) are performed through a text interface, all input arguments and output results are defined to be of a certain type and are converted internally to these types. Each command accepts certain kinds of input and generates certain kinds of output. See the BLCLI help for complete documentation on all CLI commands.

The most common types of arguments accepted as input are the following:

  • String — Commonly used to name objects or provide a description for an object.
    When providing a string as an argument, you must enclose it in quotes if the string contains spaces. For example:
    blcli ResourceProfile createResourceProfile "All Servers"
    Quotes might be also be needed (and are recommended) for other special characters. For example, a property name that ends with an asterisk, as in the following command:
    blcli Job removePropertyValue $JOB_KEY "IS_ATTEMPTED*"When the CLI returns a string as a result, it does not put quotes around the string.
  • Integer — A whole number.
  • Boolean — Used for true or false values. Valid values for a Boolean are the strings true and false. The CLI considers any other value to be incorrect.
  • Null, Void
    • As output — Used for a command that has no return value. In these cases the void return value is returned. The CLI prints the string void.
    • As input — Some commands accept a null input argument, indicated by two double quotes "" or two single quotes ''.
  • DBKey — Used as a handle when referencing various BMC Server Automation objects. Some commands — usually creation and update commands — return a DBKey in the form of a string that you can use as input for other commands. For example, the Property createPropertycommand returns a DBKey to the newly created property. By storing this return value in an environment variable, you can reference the property when setting its value for a specific server, as shown in the following example:

    PropertyKey = 'blcli Property createProperty my_property'
    blcli Server addPropertyValue win_test1 $PropertyKey my_value

Note

The DBKey handle for a BMC Server Automation object is not valid forever. Usually, when BMC Server Automation objects (such as jobs, depot objects, or component templates) are updated, their handles are updated too. If an object is changed, either by the user who holds a handle to that object or by another user from a different location, any other handles to that object become invalid. Most commands return an updated handle to objects when objects are created or updated. Use this new handle as a replacement for older handles.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*