With vcac-cli you
can do the same stuff what would be doing from vCAC Console, you may request
machine from catalog, re-provision a machine, view request and more. There are 3 different modes,
- Interactive Mode
- Command Line Mode :
The
command line mode lets you incorporate vcac-cli commands in other scripts and
programs.
- CLI Script Mode
The
CLI Script mode is similar to the command line mode, except that you can invoke
multiple commands in sequence.
There are 2
prerequisites to install vCAC-CLI
- Your machine must have Java SE Development Kit (JDK) 7 installed and running.
- Your PATH environment variable must include the location of the correct version of Java.
Steps:
- Open a browser and enter the vCAC appliance name or IP.
- Download the command-line interface (vcac-cli) distribution package.
- After extracting, you would get 3 folders, i.e., BIN, ETC and REPO.
- Open the BIN and there would be 3 files. (spring-shell keeps the history of commands run)
- Right click on vcac-cli (batch file) and click on run as Administrator, that should log you in to vCAC cli utility.
To open a secure
connection to your respective vCAC server, follow below steps:
Syntax - " login --sessionid, --url, --user,
--password, --tenant "
I used the below
command to connect to my default tenant (vsphere.local), even if you omit the
--tenant it will log in to the default Tenant.
login --sessionid 01 --url https://lab-vcac-server.ps.local
--user administrator@vsphere.local
--tenant vsphere.local
It will prompt for
the password, enter the password for the entered user and make sure you get the
"login successful" message.
Now you are
connected to your vCAC server and you may perform all steps which could do from
console.
Sample commands:
Type "rest get
--service authentication --uri tenants" to get the list of tenants
To see the running
services, just type "services"
I hope this post was
informative.