
Security News
Node.js Homepage Adds Paid Support Link, Prompting Contributor Pushback
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Connector to the Xen API
Installation of the npm package:
npm install --save xen-api
Tested with:
const { createClient } = require('xen-api')
const xapi = createClient({
url: 'https://xen1.company.net',
allowUnauthorized: false,
auth: {
user: 'root',
password: 'important secret password',
},
readOnly: false,
})
Options:
url
: address of a host in the pool we are trying to connect toallowUnauthorized
: whether to accept self-signed certificatesauth
: credentials used to sign in (can also be specified in the URL)readOnly = false
: if true, no methods with side-effects can be calledcallTimeout
: number of milliseconds after which a call is considered failed (can also be a map of timeouts by methods)httpProxy
: URL of the HTTP/HTTPS proxy used to reach the host, can include credentials// Force connection.
xapi.connect().catch(error => {
console.error(error)
})
// Watch objects.
xapi.objects.on('add', objects => {
console.log('new objects:', objects)
})
Note: all objects are frozen and cannot be altered!
Custom fields on objects (hidden − ie. non enumerable):
$type
: the type of the object (VM
, task
, …);$ref
: the (opaque) reference of the object;$id
: the identifier of this object (its UUID if any, otherwise its reference);$pool
: the pool object this object belongs to.Furthermore, any field containing a reference (or references if an
array) can be resolved by prepending the field name with a $
:
console.log(xapi.pool.$master.$resident_VMs[0].name_label)
// vm1
A CLI is provided to help exploration and discovery of the XAPI.
> xen-api xen1.company.net root
Password: ******
root@xen1.company.net> xapi.status
'connected'
root@xen1.company.net> xapi.pool.master
'OpaqueRef:ec7c5147-8aee-990f-c70b-0de916a8e993'
root@xen1.company.net> xapi.pool.$master.name_label
'xen1'
You can optionally prefix the address by a protocol: https://
(default) or http://
.
In case of error due to invalid or self-signed certificates you can use the --allow-unauthorized
flag (or --au
):
> xen-api --au xen1.company.net root
To ease searches, find()
and findAll()
functions are available:
root@xen1.company.net> findAll({ $type: 'VM' }).length
183
Contributions are very welcomed, either on the documentation or on the code.
You may:
FAQs
Connector to the Xen API
The npm package xen-api receives a total of 162 weekly downloads. As such, xen-api popularity was classified as not popular.
We found that xen-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.
Research
Security News
The Socket Research Team investigates a malicious Python typosquat of a popular password library that forces Windows shutdowns when input is incorrect.