vcenter-rest-client

0.1.0 • Public • Published

vcenter-rest-client

A library to easily interact with vCenter REST API.

Example

import { VCenterRestClient } from 'vcenter-rest-client';
import https from "https";

// Use this agent if you have a self-signed certificate on vCenter
const agent = new https.Agent({
    rejectUnauthorized: false
});
const host = "https://your-vcenter-host";
const apiClient = new VCenterRestClient(agent, host);

try {
    await apiClient.login("username", "password");
} catch(error) {
    console.error(error.message);
}

// Get all VMs
let virtualMachines = apiClient.get("rest/vcenter/vm");

// Get all Hosts
let hosts = apiClient.get("rest/vcenter/host");

Readme

Keywords

Package Sidebar

Install

npm i vcenter-rest-client

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

2.9 kB

Total Files

3

Last publish

Collaborators

  • behindcurtain3