For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Helper Script

A guide to using the VergeOS yb-api helper script for simplified API interactions, including listing, creating, cloning, and managing virtual machines from the command line.

The yb-api helper script provides an easy way for developers to interact with the VergeOS API. It simplifies making API calls, such as retrieving virtual machines, updating configurations, and managing resources. This guide will outline the key commands and usage of the yb-api script.

Prerequisites

  • Access to a VergeOS system.

  • Access to the cluster via SSH or direct connection.

  • wget and curl must be installed on the system for certain operations.

Running the Helper Script

To get help or view the available options, run:

yb-api --help

Connect to the node and execute this command to begin using the API helper.

yb-api Example

Example Commands

Below are examples of how to use yb-api for various VM management tasks.

Get a List of Virtual Machines (excluding snapshots)

Retrieve a list of VMs and filter out snapshots.

Simple Dump of All VMs

This command retrieves a list of all VMs. The --server, --user, --filter, and --fields flags are optional in this case.

Get Detailed VM Information

Retrieve most of the fields, including drive and NIC information, for a specific VM (VM 1 in this case).

Rename a Virtual Machine

Change the name of an existing virtual machine (VM 1) to "NEWNAME".

Delete a Virtual Machine

Delete a specific VM (VM 1), using its $key.

Create a New Virtual Machine

Create a new VM with specific configurations (name, CPU cores, RAM, etc.).

Get the VM Database Table Schema

Retrieve the schema for the VMs database table.

Clone a Virtual Machine

Clone an existing VM (VM 1) and give it a new name.

Power On a Virtual Machine

Power on an existing VM (VM 1).

Notes About yb-api

  • The yb-api script relies on wget, which may not be installed by default on macOS. Make sure to install it if necessary.

  • curl is used for the upload function in certain API calls, such as posting data to create new VMs.


By using the yb-api helper script, developers can simplify interaction with the VergeOS API and manage virtual machines more efficiently. Let us know if you need assistance with further commands or options.


Document Information

  • Last Updated: 2024-08-29

  • vergeOS Version: 4.12.6

Last updated

Was this helpful?