@smootok/vcloud

Retrieve the function location from it reference in NodeJS.

Usage no npm install needed!

<script type="module">
  import smootokVcloud from 'https://cdn.skypack.dev/@smootok/vcloud';
</script>

README

Example

const { Client } = require('@smootok/vcloud');

(async () => {
  const c = new Client({
    url: 'https://mycloud.vmware.com',
    org: 'MyOrg',
    user: 'admin',
    pass: 'P@$w0Rd',
  });

  // Optional: Initialize the token
  c.setToken({
    token: 'TOKEN_HERE',
    type: 'Bearer',
  });

  const session = await c.session.getCurrent();
  console.log(session.roles);
  const orgs = await c.org.getCurrent();
  console.log(orgs);
  const [{ id }] = orgs;
  console.log(id);
  const org = await c.org.getById(id);
  console.log(org);
})();