CLI interface for my.vmware.com
npm install vmw-clivmw-clivmw-cli tool and supercedes all previous versions. my.vmware.com website. vmw-cli is a CLI client used to login and interact with my.vmware.com.
It provides an interface for programmatic query and download of VMware product binaries.
Every product.
Every version.
Every file.
vmw-cli uses the my.vmware.com Node.js SDK here: vmw-sdk
export VMWUSER=''
export VMWPASS=''
`
Note: Any download attempts will be restricted to the entitlements afforded by your account.
Alternatively, if using docker commands, you can pass credentials directly to the container instead.vmw-cli can be consumed using the Shell + Docker pre-built image (preferred), or installing the package via NPM.
By default, requested files via the cp command will be downloaded to current working directory.$3
Builds a shell command that links to the docker container.
Requires docker installed on your system. `
docker run apnex/vmw-cli shell > vmw-cli
chmod 755 vmw-cli
mv vmw-cli /usr/bin/
`Once shell integration installed,
vmw-cli can be leveraged directly via the vmw-cli shell command - see Usage below$3
vmw-cli requires NodeJS >= 12.x, some older Linux distros need to have NodeJS manually updated
`
npm install vmw-cli --global
`
Once installed, vmw-cli can be leveraged directly via the vmw-cli shell command - see Usage below
$3
This is where we manually start the container using docker run with the required ENV parameters set.
This is not required if you have performed Shell Integration.
Subsequent commands are then issued using docker exec commands. Start the container in background:
`
docker run -itd --name vmw -e VMWUSER='' -e VMWPASS='' -v ${PWD}:/files --entrypoint=sh apnex/vmw-cli
`
Where:
- is your my.vmware.com username
- is your my.vmware.com password
- ${PWD} ENV will resolve to current working directory in BASH for file downloadsThen issue one or more
docker exec commands:
`
docker exec -t vmw vmw-cli
`Clean up docker container when done:
`
docker rm -f vmw
`See Usage for more examples
Overview
vmw-cli has been modelled to make resources on my.vmware.com resemble a file system.
This allows you to browse available downloads via the ls command, and select a file to copy to your local system.$3
All files are grouped into nested directory structures in the form
Where:
- is one of the high-level solution groups listed on my.vmware.com
- is a solution version available within a specific
- is one of the following [PRODUCT_BINARY, DRIVERS_TOOLS, OPEN_SOURCE, CUSTOM_ISO, ADDONS]For example;
Current
vmware_nsx_t_data_center file structure:
vmware_nsx_t_data_center
┣━ 3_x
┃ ┣━ PRODUCT_BINARY
┃ ┣━ DRIVERS_TOOLS
┃ ┣━ OPEN_SOURCE
┃ ┣━ CUSTOM_ISO
┃ ┗━ ADDONS
┣━ 2_x
┃ ┣━ PRODUCT_BINARY
┃ ┣━ DRIVERS_TOOLS
┃ ┣━ OPEN_SOURCE
┃ ┣━ CUSTOM_ISO
┃ ┗━ ADDONS
┗━ 1_x
┣━ PRODUCT_BINARY
┣━ DRIVERS_TOOLS
┣━ OPEN_SOURCE
┣━ CUSTOM_ISO
┗━ ADDONS
Current
vmware_vsphere file structure:
vmware_vsphere
┣━ 7_0
┃ ┣━ PRODUCT_BINARY
┃ ┣━ DRIVERS_TOOLS
┃ ┣━ OPEN_SOURCE
┃ ┣━ CUSTOM_ISO
┃ ┗━ ADDONS
┣━ 6_7
┃ ┣━ PRODUCT_BINARY
┃ ┣━ DRIVERS_TOOLS
┃ ┣━ OPEN_SOURCE
┃ ┣━ CUSTOM_ISO
┃ ┗━ ADDONS
┣━ 6_5
┃ ┣━ PRODUCT_BINARY
┃ ┣━ DRIVERS_TOOLS
┃ ┣━ OPEN_SOURCE
┃ ┣━ CUSTOM_ISO
┃ ┗━ ADDONS
┣━ 6_0
┃ ┣━ PRODUCT_BINARY
┃ ┣━ DRIVERS_TOOLS
┃ ┣━ OPEN_SOURCE
┃ ┣━ CUSTOM_ISO
┃ ┗━ ADDONS
┣━ 5_5
┃ ┣━ PRODUCT_BINARY
┃ ┣━ DRIVERS_TOOLS
┃ ┣━ OPEN_SOURCE
┃ ┣━ CUSTOM_ISO
┃ ┗━ ADDONS
┣━ 5_1
┃ ┣━ PRODUCT_BINARY
┃ ┣━ DRIVERS_TOOLS
┃ ┣━ OPEN_SOURCE
┃ ┣━ CUSTOM_ISO
┃ ┗━ ADDONS
┗━ 5_0
┣━ PRODUCT_BINARY
┣━ DRIVERS_TOOLS
┣━ OPEN_SOURCE
┣━ CUSTOM_ISO
┗━ ADDONS
And so on.
Usage
vmw-cli supports the ability to browse available files using the ls command.
You can then leverage the cp command to retrieve one of the listed files.
You must execute an ls for the desired before you can issue the cp command for a file.#### Get root-level category listing
`
$ vmw-cli ls
`#### View files listed under
vmware_nsx_t_data_center
`
$ vmw-cli ls vmware_nsx_t_data_center
`Note: This will default to latest
and = PRODUCT_BINARY as they are not specified. #### View available versions listed under
vmware_nsx_t_data_center
`
$ vmw-cli ls vmware_nsx_t_data_center/
`#### View files for version
3_x under vmware_nsx_t_data_center
`
$ vmw-cli ls vmware_nsx_t_data_center/3_x
`Note: This will default
= PRODUCT_BINARY as it was not specified. #### View available types for version
3_x under vmware_nsx_t_data_center
`
$ vmw-cli ls vmware_nsx_t_data_center/3_x/
`#### View
DRIVERS_TOOLS files for version 3_x under vmware_nsx_t_data_center
`
$ vmw-cli ls vmware_nsx_t_data_center/3_x/DRIVERS_TOOLS
`#### View
PRODUCT_BINARY files for version 3_x under vmware_nsx_t_data_center
`
$ vmw-cli ls vmware_nsx_t_data_center/3_x/PRODUCT_BINARY
`#### Download file
nsx-unified-appliance-3.0.1.1.0.16556500.ova
`
$ vmw-cli cp nsx-unified-appliance-3.0.1.1.0.16556500.ova
[POST] https://my.vmware.com/channel/api/v1.0/ems/accountinfo
{
"locale": "en_US",
"downloadGroup": "NSX-T-30110",
"productId": "982",
"md5checksum": "9cf49e74d7d43c11768a04fb05f92d85",
"tagId": 12178,
"dlgType": "Product Binaries",
"productFamily": "VMware NSX-T Data Center",
"releaseDate": "2020-07-16",
"dlgVersion": "3.0.1.1",
"isBetaFlow": false
}
[POST] https://my.vmware.com/channel/api/v1.0/dlg/download
nsx-unified-appliance-3.0.1.1.0.16556500.ova [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] 100% | 0.0s | 11.02/11.02 GB
MD5 MATCH: local[ 9cf49e74d7d43c11768a04fb05f92d85 ] remote [ 9cf49e74d7d43c11768a04fb05f92d85 ]
``File will be downloaded to current working directory.