@apnex/vmw-sdk
Version:
Node.js SDK/API interface for my.vmware.com
74 lines (58 loc) • 1.41 kB
Markdown
A promises-based Node.JS SDK for programmatic access to **my.vmware.com**
This SDK implements a login workflow and provides a structured wrapper for REST API calls.
- [Promise API](
- [Stream API](
- [Pagination API](
```
$ npm install @apnex/vmw-sdk
```
```js
// load and create new client instance
const vmwClient = require('@apnex/vmw-sdk');
const vmw = new vmwClient();
// run
(async() => {
try {
// login to my.vmware.com
await vmw.login({
username: "my.username",
password: "my.password"
});
// get product index
let products = await vmw.getProducts();
// print to console
console.log(JSON.stringify(products, null, "\t"));
//=> '[ { name: "VMware vSphere", actions: [ ... ] } ]'
} catch (error) {
console.log(error.message);
}
})();
```
```js
const vmwClient = require('@apnex/vmw-sdk');
(async() => {
// create new client instance
const vmw = new vmwClient();
try {
// login to my.vmware.com
await vmw.login({
username: "my.username",
password: "my.password"
});
// get product index
let products = await vmw.getProducts();
// print to console
console.log(JSON.stringify(products, null, "\t"));
//=> '[ { name: "VMware vSphere", actions: [ ... ] } ]'
} catch (error) {
console.log(error.message);
}
})();
```