Running DCLI Commands
You can display help information for DCLI commands, and run the commands from a system where vCLI is installed, from the vCenter Server Appliance shell, or from a vCenter Server on Windows command prompt.
Displaying Help Information for DCLI Commands
You can display help for each namespace and command by using the --help command-line option. Because the available commands depend entirely on the services that are available in the vCenter environment that you are targeting, you must include the server for accurate help information. Help returns the following information for a command:
Example
dcli com vmware cis tagging tag create --help
usage: com vmware cis tagging tag create [-h] --create-spec-name CREATE_SPEC_NAME --create-spec-description CREATE_SPEC_DESCRIPTION --create-spec-category-id CREATE_SPEC_CATEGORY_ID
 
Creates a tag
 
Input Arguments:
  -h, --help            show this help message and exit
  --create-spec-name CREATE_SPEC_NAME
                        The display name of the tag (required string)
  --create-spec-description CREATE_SPEC_DESCRIPTION
                        The description of the tag (required string)
  --create-spec-category-id CREATE_SPEC_CATEGORY_ID
                        The unique identifier of the parent category in which this tag will be
                        created (required string)
Running DCLI Commands Included in the vCLI Package
You run vCLI commands from an administration server on which you installed the vCLI package. After installation, open a command prompt in the VMware\VMware DCLI folder, which is at the same level as the VMware vSphere CLI folder.
You specify a server, user name, and password. If you specify credstore-add, DCLI creates a credential store file on the local machine and you are no longer required to specify the user name and password when you run DCLI commands again.
Running DCLI Commands on the vCenter Server Appliance
The root user on the vCenter Server Appliance can run DCLI commands from the appliance shell.
1
The [email protected] user does not have privileges to run DCLI commands.
2
>dcli +interactive
3
dcli> com vmware vapi metadata cli command list
Using DCLI with a Credential Store File
To avoid typing in the user name and password each time you run a DCLI command, you can add the current user and the associated password and server IP address to a credential store file by using the credstore-add option on the command line.
Passwords are encrypted in the credential store file, but if you want to remove credential store information, you can use +credstore-remove to do so.
By default, the credential store file is located in <homedir>/.dcli/.dcli_credstore, but you can change the location with the +credstore-file option.
Examples
The following examples illustrate how you can interact with the credential store.
1
dcli com vmware cis tagging tag list +credstore-add +username user1
2
dcli +credstore-remove +server <server> +username user1
3
dcli +credstore-list
Order of Precedence for DCLI Authentication
When you run a DCLI command, authentication happens in the order of precedence shown in DCLI Authentication Precedence. This order of precedence always applies. That means, for example, that you can override an environment variable setting from the command line.
If you are authenticating through vCenter Single Sign-On, the order of precedence is preserved.