@apnex/vmw-sdk

1.0.13 • Public • Published

vmw-sdk

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.

Highlights

Install

$ npm install @apnex/vmw-sdk

Usage

Promise
// 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);
	}
})();

API Methods

.getProducts
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);
	}
})();

Package Sidebar

Install

npm i @apnex/vmw-sdk

Weekly Downloads

12

Version

1.0.13

License

MIT

Unpacked Size

7.34 kB

Total Files

3

Last publish

Collaborators

  • apnex