@vcd/node-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

VMware Cloud Director Client bindings for NodeJS

The Javascript clients for VMware Cloud Director is implemented in typescript, but can be called from either Javascript or Typescript.

The client is implemented for server-side use with node using the request library.

Installation

npm install @vcd/node-client

Example code

Login and save configuration

import * as vcd from '@vcd/node-client'

const vcdConfig = new vcd.CloudDirectorConfig();
const config = await vcd.CloudDirectorConfig.withUsernameAndPassword(
    "https://<host>[:<port>]/cloudapi",
    "myusername",
    "System", // for Provider login use System as organization name
    "myfakepassword"
)
config.saveConfig("alias")

List all orgs

import * as vcd from '@vcd/node-client'

const vcdConfig = CloudDirectorConfig.fromDefault()

const orgApi: vcd.OrgApi = vcdConfig.makeApiClient(vcd.OrgApi)

orgApi.queryOrgs(1, 128).then((res) => {
    console.log(res.body);
});

Readme

Keywords

none

Package Sidebar

Install

npm i @vcd/node-client

Weekly Downloads

0

Version

0.0.5

License

BSD-2

Unpacked Size

4.63 MB

Total Files

34

Last publish

Collaborators

  • cd-extensions
  • nvladimirovi
  • jmoroski
  • juanito.bsb