vmw-cli
所属分类:操作系统开发
开发工具:JavaScript
文件大小:16KB
下载次数:0
上传日期:2022-07-06 09:34:26
上 传 者:
sh-1993
说明: CLI和API用于对my.vmware.com进行编程访问
(CLI and API for programmatic access to my.vmware.com)
文件列表:
build.sh (404, 2021-08-24)
clear.sh (154, 2021-08-24)
dockerfile (518, 2021-08-24)
inspect.sh (805, 2021-08-24)
lib (0, 2021-08-24)
lib\streamer.js (2316, 2021-08-24)
lib\vmw.api.js (9160, 2021-08-24)
lib\vmw.cli.js (4685, 2021-08-24)
lib\xcell.js (950, 2021-08-24)
lib\xtable.js (3757, 2021-08-24)
license (1092, 2021-08-24)
package.json (586, 2021-08-24)
start.sh (218, 2021-08-24)
vmw-cli (2148, 2021-08-24)
vmw.complete (1973, 2021-08-24)
# `vmw-cli`
**2.0 marks the first in a series of releases of the new `vmw-cli` tool and supercedes all previous versions.**
**It has been built from the ground up to be aligned with the new `my.vmware.com` website.**
**New features will become available in on-going releases.**
`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`](https://github.com/apnex/vmw-sdk)
## Install
#### Configure authentication for my.vmware.com
```
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.
### via Docker: Shell Integration
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
### via NPM
**vmw-cli requires NodeJS >= 12.x, some older Linux distros need to have NodeJS [manually updated](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)**
```
npm install vmw-cli --global
```
Once installed, `vmw-cli` can be leveraged directly via the `vmw-cli` shell command - see **Usage** below
### via Docker [Manual]
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 downloads
Then 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.
### Directory Geometry
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": "***2",
"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.
近期下载者:
相关文件:
收藏者: