1.0.4 • Published 6 months ago

xen-api-ts v1.0.4

Weekly downloads
-
License
GPLv2
Repository
-
Last release
6 months ago

Typescript for XenAPI Usage

Examples

Install lib from npm repository

$ npm install xen-api-ts

The usage of Typescript XenAPI is almost identical to the Python XenAPI, except it's asynchronous and requires async/await.

import { xapi_client } from "xen-api-ts"
async function main() {
    const session = xapi_client(process.env.HOST_URL)
    try:
        await session.login_with_password(process.env.USERNAME, process.env.PASSWORD)
        const hosts = await session.xenapi.host.get_all()
    finally:
        await session.xenapi.session.logout()
}
main()

For more example usage, we can run as follows.

$ cd <examples/typescript dir>
$ npm install
$ echo "HOST_URL=xxx" >> .env
$ echo "USERNAME=xxx" >> .env
$ echo "PASSWORD=xxx" >> .env
$ npm test tests/getXapiVersion.ts

Packaging

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

7 months ago