6.2

Table Of Contents
Use the Script Mode
The script mode is similar to the command line mode, except that you can invoke multiple commands in
sequence.
In script mode, you must first create a text file which contains a series of vcac-cli interactive-mode
commands. Vcac-cli executes the commands in sequence.
Prerequisites
n
Install the API Explorer, if necessary.
n
Your PATH environment variable must contain the location of the vcac-cli (UNIX) or vcac_cli.bat
(Windows) script.
Procedure
1 Create a text file containing a series of vcac-cli interactive-mode commands.
For example, enter the folllowing commands in a file named script.txt.
login --url https://vcac152-009-067.eng.vmware.com --user tanteater@example.com --password
password --tenant MYCOMPANY
rest get --service workitem-service --u workitems
2 Run the script and redirect the output.
$ vcac-cli script script.txt 2> script.out
Log in with the API Explorer
You can log in securely to a vRealize Automation server with the API Explorer.
When running a script in UNIX, you can prevent the plaintext password from appearing in the spring-
shell.log file by storing the password in a file and redirecting standard input from that file.
This procedure uses interactive mode. See Use the Interactive Mode for more information.
Prerequisites
n
Install the API Explorer, if necessary.
n
Your PATH environment variable must contain the location of the vcac-cli (UNIX) or vcac_cli.bat
(Windows) script.
Programming Guide
VMware, Inc. 403