npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@corsinvest/cv4pve-api-javascript

v8.2.2

Published

Proxmox VE Client API JavaScript

Downloads

304

Readme

cv4pve-api-javascript

Proxmox VE Client API JavaScript

GitHub release npm

Proxmox VE Api

   ______                _                      __
  / ____/___  __________(_)___ _   _____  _____/ /_
 / /   / __ \/ ___/ ___/ / __ \ | / / _ \/ ___/ __/
/ /___/ /_/ / /  (__  ) / / / / |/ /  __(__  ) /_
\____/\____/_/  /____/_/_/ /_/|___/\___/____/\__/

Corsinvest for Proxmox VE Api Client  (Made in Italy)

Copyright and License

Copyright: Corsinvest Srl For licensing details please visit LICENSE

Commercial Support

This software is part of a suite of tools called cv4pve-tools. If you want commercial support, visit the site

General

The client is generated from a JSON Api on Proxmox VE.

Result

The result is class Result and contain methods:

  • response returned from Proxmox VE (data,errors,...) JSON
  • responseInError (bool) : Contains errors from Proxmox VE.
  • statusCode (int) : Status code of the HTTP response.
  • reasonPhrase (string): The reason phrase which typically is sent by servers together with the status code.
  • isSuccessStatusCode (bool) : Gets a value that indicates if the HTTP response was successful.

Main features

  • Easy to learn
  • Method named
  • Implementation respect the Api structure of Proxmox VE
  • Full method generated from documentation
  • Comment any method and parameters
  • Parameters indexed eg [n] is structured in array index and value
  • Tree structure
    • await client.nodes.get('pve1').qemu.vmlist().response
  • Return data Proxmox VE
  • Debug show information
  • Return result
    • Request
    • Response
    • Status
  • Last result action
  • Wait task finish task
    • waitForTaskToFinish
    • taskIsRunning
    • getExitStatusTask
  • Method directly access
    • get
    • set
    • create
    • delete
  • Login return bool if access
  • Return Result class more information
  • Minimal dependency library
  • ClientBase lite function
  • Form Proxmox VE 6.2 support Api Token for user
  • Login with One-time password for Two-factor authentication

Api token

From version 6.2 of Proxmox VE is possible to use Api token. This feature permit execute Api without using user and password. If using Privilege Separation when create api token remember specify in permission. Format USER@REALM!TOKENID=UUID

Usage

const pve = require('./src');

async function foo() {
    var client = new pve.PveClient('10.92.90.101', 8006);
    //client.logEnabled = true;
    //client.apiToken = '';

    var login = await client.login('root', process.env.PVE_PASSWORD, 'pam');
    if (login) {
        console.log((await client.get('/version')).response);
        console.log((await client.version.version()).response);

        console.log((await client.get('/nodes')).response);
        console.log((await client.nodes.index()).response);

        console.log((await client.get('/nodes/cv-pve01/qemu')).response);
        console.log((await client.nodes.get('cv-pve01').qemu.vmlist(0)).response);

        console.log((await client.get('/nodes/cv-pve01/qemu/103/config/')).response);
        console.log((await client.nodes.get('cv-pve01').qemu.get(103).config.vmConfig()).response);

        console.log((await client.get('/nodes/cv-pve01/qemu/103/snapshot/')).response);
        console.log((await client.nodes.get('cv-pve01').qemu.get(103).snapshot.snapshotList()).response);
    }
}