Example
const { Client } = require('@4djs/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);
})();
Example
const { Client } = require('@4djs/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);
})();