### Post QEMU VM Status Start Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Starts a stopped QEMU VM. ```APIDOC ## POST /vms/{vmid}/status/start ### Description Starts a stopped QEMU VM. ### Method POST ### Endpoint /vms/{vmid}/status/start ### Parameters #### Path Parameters - **vmid** (number) - Required - The ID of the virtual machine. ``` -------------------------------- ### Example API Calls Source: https://github.com/urielch/proxmox-api/blob/master/docs/index.html Provides concrete examples of how to translate specific Proxmox API endpoints into proxmox-api method calls for GET and POST requests. ```APIDOC ## Example To call `GET /cluster/acme/account/{name}` you will call `promox.cluster.acme.account.$(name).$get()` To call `GET /api2/json/cluster/backup/{id}/included_volumes` you will call `proxmox.cluster.backup.{id}.included_volumes.$get()` To call `GET /api2/json/nodes` you will call `proxmox.nodes.$get()` ``` -------------------------------- ### Start Virtual Machine Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Initiates the startup process for a virtual machine. This operation can be used to start a VM that is currently stopped. ```APIDOC ## POST /nodes/{node}/qemu/{vmid}/status/start ### Description Start virtual machine. ### Method POST ### Endpoint /nodes/{node}/qemu/{vmid}/status/start ### Parameters #### Query Parameters - **node** (string) - Required - The node ID where the VM resides. - **vmid** (integer) - Required - The virtual machine ID. #### Request Body - **force-cpu** (string) - Optional - Forces the CPU type. - **machine** (string) - Optional - Specifies the machine type. - **migratedfrom** (string) - Optional - Indicates the source node if the VM was migrated. - **migration_network** (string) - Optional - Specifies the network for migration. - **migration_type** (Tmigration_type) - Optional - The type of migration. - **skiplock** (boolean) - Optional - Skips the lock on the VM. - **stateuri** (string) - Optional - URI for the VM state. - **targetstorage** (string) - Optional - The target storage for the VM. - **timeout** (number) - Optional - Timeout for the operation. ### Response #### Success Response (200) - **string** - A message indicating the success of the operation. ``` -------------------------------- ### Install proxmox-api Source: https://github.com/urielch/proxmox-api/blob/master/api/README.md Install the proxmox-api package using npm. ```bash npm install proxmox-api ``` -------------------------------- ### Start all VMs and containers on a node Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Starts all VMs and containers on the specified node. By default, it only starts those with onboot set to 1. This operation can be forced to start all, regardless of the onboot setting. ```APIDOC ## POST /nodes/{node}/startall ### Description Start all VMs and containers located on this node (by default only those with onboot=1). ### Method POST ### Endpoint /nodes/{node}/startall ### Parameters #### Path Parameters - **node** (string) - The node ID. #### Query Parameters - **force** (boolean) - Optional. If true, forces the start of all VMs and containers. - **vms** (string) - Optional. A comma-separated list of VMs and containers to start. ### Response #### Success Response (200) - **string** - A message indicating the result of the operation. ``` -------------------------------- ### Proxmox USB Hotplug Configuration File Example Source: https://github.com/urielch/proxmox-api/blob/master/proxmox-usb-hotplug/README.md An example configuration file for proxmox-usb-hotplug, demonstrating how to set username, password, host, node, deny-usb, force-usb, flush, and no-hub options. ```yaml # username used to connect to proxmox API username = root@pam # password used to connect to proxmox API password = prOxmOxp@sswOd # host used to connect to proxmox API should always be localhost host = 127.0.0.1 # the node name to used # by default use the first node, if you are using a cluster you should give the cluster name ;node=proxmox # deny an usb device deny-usb=001c:100d # deny an usb hub # you should always deny USB hub to avoid a dual passthrough deny-usb=1a40:0101 # Connect some device at startup recommanded for keyboard and mouse # a keyboard force-usb=258a:1006 # a mouse force-usb=18f8:0f97 # not implemented yet. ; watch = 60 # unplug all existing device on script startup # then reconnect all force-usb devices flush = 1 # try to autodetect USB Hub to avoid dual passthrough no-hub=1 ``` -------------------------------- ### Service Start Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Starts a specified service on a node. ```APIDOC ## POST /nodes/{node}/services/{service}/start ### Description Start service. ### Method POST ### Endpoint /nodes/{node}/services/{service}/start ### Parameters #### Path Parameters - **service** (string) - Required - The name of the service to start. ### Permissions 1 ### Returns Promise ``` -------------------------------- ### Install and Run Proxmox USB Hotplug Source: https://github.com/urielch/proxmox-api/blob/master/proxmox-usb-hotplug/README.md Installs the necessary dependencies and the proxmox-usb-hotplug package. It also shows how to run the script and potentially update the PATH environment variable. ```bash sudo apt-get install libudev-dev npm install -g proxmox-usb-hotplug # double check your user PATH env for a local bode bion path echo $PATH sudo -i # update PATH if needed proxmox-usb-hotplug # enter the your localhost root password, it will be replace by ************************ after pressing return key ``` -------------------------------- ### Node Qemu Firewall Options Get Options Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.ldapsimpleattrlist.html Get firewall options for a Qemu virtual machine on a Proxmox node. ```APIDOC ## GET /nodes/{node}/qemu/{vmid}/firewall/options ### Description Retrieves the firewall options configured for a specific Qemu virtual machine on a Proxmox node. ### Method GET ### Endpoint /nodes/{node}/qemu/{vmid}/firewall/options ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node. - **vmid** (integer) - Required - The ID of the Qemu virtual machine. ``` -------------------------------- ### Node Qemu Firewall Rules Get Rules Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.ldapsimpleattrlist.html Get all firewall rules for a Qemu virtual machine on a Proxmox node. ```APIDOC ## GET /nodes/{node}/qemu/{vmid}/firewall/rules ### Description Retrieves all firewall rules configured for a specific Qemu virtual machine on a Proxmox node. ### Method GET ### Endpoint /nodes/{node}/qemu/{vmid}/firewall/rules ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node. - **vmid** (integer) - Required - The ID of the Qemu virtual machine. ``` -------------------------------- ### Code Sample: Connecting and Listing Nodes Source: https://github.com/urielch/proxmox-api/blob/master/docs/index.html A practical code sample demonstrating how to install the library, import it, connect to a Proxmox server using username and password, list nodes, and then retrieve Qemu VM configurations. ```APIDOC ## Code Sample ```bash npm install proxmox-api ``` ```typescript import proxmoxApi from "proxmox-api"; // Authorize self-signed cert if you do not use a valid SSL certificate process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; async function test() { // connect to proxmox const promox = proxmoxApi({host: '127.0.0.1', password: 'password', username: 'user1@pam'}); // list nodes const nodes = await promox.nodes.$get(); // iterate cluster nodes for (const node of nodes) { const theNode = promox.nodes.$(node.node); // list Qemu VMS const qemus = await theNode.qemu.$get({full:true}); // iterate Qemu VMS for (const qemu of qemus) { // do some stuff. const config = await theNode.qemu.$(qemu.vmid).config.$get(); console.log(`vm: ${config.name}, memory: ${config.memory}`); // const vnc = await theNode.qemu.$(qemu.vmid).vncproxy.$post(); // console.log('vnc:', vnc); // const spice = await theNode.qemu.$(qemu.vmid).spiceproxy.$post(); // console.log('spice:', spice); } } } test().catch(console.error); ``` ``` -------------------------------- ### Basic Usage Example Source: https://github.com/urielch/proxmox-api/blob/master/api/README.md Demonstrates connecting to a Proxmox server, listing nodes, iterating through VMs, and retrieving VM configurations. ```APIDOC ## Basic Usage Example ### Description This example shows how to initialize the proxmox-api client, connect to a Proxmox server, list nodes, and retrieve details about Qemu virtual machines. ### Method ```typescript async function test() ``` ### Endpoint N/A (Client-side SDK) ### Parameters None directly for the function, but the `proxmoxApi` call requires connection details. ### Request Example ```typescript import proxmoxApi from "proxmox-api"; // authorize self signed cert if you do not use a valid SSL certificat process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; async function test() { // connect to proxmox const proxmox = proxmoxApi({host: '127.0.0.1', password: 'password', username: 'user1@pam'}); // list nodes const nodes = await proxmox.nodes.$get(); // iterate cluster nodes for (const node of nodes) { const theNode = proxmox.nodes.$(node.node); // list Qemu VMS const qemus = await theNode.qemu.$get({full:true}); // iterate Qemu VMS for (const qemu of qemus) { // do some suff. const config = await theNode.qemu.$(qemu.vmid).config.$get(); console.log(`vm: ${config.name}, memory: ${config.memory}`); } } } test().catch(console.error); ``` ### Response #### Success Response Returns an array of node objects, then VM objects, and finally VM configuration objects. #### Response Example ```json { "example": "vm: my-vm-name, memory: 1024" } ``` ``` -------------------------------- ### Node APT Versions Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.Tnuma.html Get installed package versions for a node. ```APIDOC ## GET /nodes/{node}/apt/versions ### Description Retrieves a list of installed package versions on the specified Proxmox node. ### Method GET ### Endpoint /nodes/{node}/apt/versions ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node. ### Response #### Success Response (200) - **data** (object) - An object where keys are package names and values are their installed versions. #### Response Example { "data": { "proxmox-ve": "7.4-3", "qemu-server": "7.2-1" } } ``` -------------------------------- ### Initialisation Alternatives Source: https://github.com/urielch/proxmox-api/blob/master/docs/index.html Demonstrates alternative ways to initialize the proxmox-api client, including using an existing ProxmoxEngine object and authenticating with an API token. ```APIDOC ### Initialisation alternatives: * Keeping access to ProxmoxEngine object (that can be use to share a ticket, or to access it) ```typescript import proxmoxApi, { ProxmoxEngine } from "proxmox-api"; process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; async function test() { // connect to proxmox const engine = new ProxmoxEngine({host: '127.0.0.1', password: 'password', username: 'user1@pam'}); const promox = proxmoxApi(engine); } ``` * Using Api token ```typescript import proxmoxApi from "proxmox-api"; process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; async function test() { // connect to proxmox const promox = proxmoxApi({host: '127.0.0.1', tokenID: 'USER@REALM!TOKENID', tokenSecret: '12345678-1234-1234-1234-1234567890ab'}); } ``` ``` -------------------------------- ### Nodes Apt Versions Versions Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.Ttype_4.html Get information about installed package versions on a node. ```APIDOC ## GET /nodes/{node}/apt/versions ### Description Retrieves information about the versions of installed packages on a specific Proxmox node. ### Method GET ### Endpoint /nodes/{node}/apt/versions ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node. ### Response #### Success Response (200) - **data** (array) - An array of package version objects. - **name** (string) - The name of the package. - **version** (string) - The installed version of the package. ### Response Example ```json { "data": [ { "name": "proxmox-ve", "version": "8.1.2" }, { "name": "qemu-server", "version": "8.1.2-1" } ] } ``` ``` -------------------------------- ### Node APT Versions Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.Tconsole.html Get information about installed APT package versions on the node. ```APIDOC ## GET /nodes/{node}/apt/versions ### Description Retrieves information about the versions of installed APT packages on the specified node. ### Method GET ### Endpoint /nodes/{node}/apt/versions ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node. ``` -------------------------------- ### GET /version Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.versionVersion.html Retrieves the version information for the Proxmox VE installation. This endpoint returns an object conforming to the versionVersion interface. ```APIDOC ## GET /version ### Description Retrieves the version information for the Proxmox VE installation. This endpoint returns an object conforming to the versionVersion interface. ### Method GET ### Endpoint /version ### Response #### Success Response (200) - **console** (string) - Optional - The default console viewer to use. - **release** (string) - The current Proxmox VE point release in `x.y` format. - **repoid** (string) - The short git revision from which this version was build. - **version** (string) - The full pve-manager package version of this node. #### Response Example { "console": "shell", "release": "8.1", "repoid": "abcdef1234567890", "version": "8.1.5" } ``` -------------------------------- ### $post Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Creates a snapshot for a VM. Optionally includes VM state. ```APIDOC ## $post ### Description Creates a snapshot for a VM. Optionally includes VM state. ### Method POST ### Endpoint /nodes/{node}/qemu/{vmid}/snapshot ### Parameters #### Path Parameters - **node** (string) - Required - The node ID. - **vmid** (string) - Required - The VM ID. #### Request Body - **snapname** (string) - Required - The name of the snapshot. - **description** (string) - Optional - A description for the snapshot. - **vmstate** (boolean) - Optional - If true, includes the VM state in the snapshot. ### Response #### Success Response (200) - **string** - A success message. #### Response Example { "example": "Snapshot created successfully" } ``` -------------------------------- ### $post Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Sets virtual machine options asynchronously. This method allows for detailed configuration of a virtual machine, including hardware, boot settings, and network interfaces. ```APIDOC ## POST /nodes/{node}/qemu/{vmid}/config ### Description Set virtual machine options (asynchronous API). ### Method POST ### Endpoint /nodes/{node}/qemu/{vmid}/config ### Parameters #### Query Parameters - **node** (string) - Required - The node ID where the VM resides. - **vmid** (integer) - Required - The virtual machine ID. #### Request Body - **acpi** (boolean) - Optional - Enable ACPI. - **agent** (string) - Optional - QEMU guest agent configuration. - **arch** (Tarch) - Optional - CPU architecture. - **args** (string) - Optional - Additional arguments for QEMU. - **audio0** (string) - Optional - First audio device. - **autostart** (boolean) - Optional - Enable autostart on boot. - **background_delay** (number) - Optional - Delay for background tasks. - **balloon** (number) - Optional - Memory ballooning size. - **bios** (Tbios) - Optional - BIOS type. - **boot** (string) - Optional - Boot order. - **bootdisk** (string) - Optional - Boot disk identifier. - **cdrom** (string) - Optional - CD-ROM drive. - **cicustom** (string) - Optional - Custom cloud-init configuration. - **cipassword** (string) - Optional - Cloud-init password. - **citype** (Tcitype) - Optional - Cloud-init type. - **ciuser** (string) - Optional - Cloud-init username. - **cores** (number) - Optional - Number of CPU cores. - **cpu** (string) - Optional - CPU type. - **cpulimit** (number) - Optional - CPU limit. - **cpuunits** (number) - Optional - CPU weight. - **delete** (string) - Optional - Delete specified configuration options. - **description** (string) - Optional - Description for the VM. - **digest** (string) - Optional - The digest (hash) of the configuration. - **efidisk0** (string) - Optional - EFI disk. - **force** (boolean) - Optional - Force operation. - **freeze** (boolean) - Optional - Freeze VM state. - **hookscript** (string) - Optional - Hook script for VM events. - **hostpci0** (string) - Optional - Host PCI device 0. - **hostpci1** (string) - Optional - Host PCI device 1. - **hostpci2** (string) - Optional - Host PCI device 2. - **hostpci3** (string) - Optional - Host PCI device 3. - **hostpci4** (string) - Optional - Host PCI device 4. - **hostpci5** (string) - Optional - Host PCI device 5. - **hostpci6** (string) - Optional - Host PCI device 6. - **hostpci7** (string) - Optional - Host PCI device 7. - **hotplug** (string) - Optional - Hotplug settings. - **hugepages** (Thugepages) - Optional - Hugepages configuration. - **ide0** (string) - Optional - IDE device 0. - **ide1** (string) - Optional - IDE device 1. - **ide2** (string) - Optional - IDE device 2. - **ide3** (string) - Optional - IDE device 3. - **ipconfig0** (string) - Optional - IP configuration for interface 0. - **ipconfig1** (string) - Optional - IP configuration for interface 1. - **ipconfig2** (string) - Optional - IP configuration for interface 2. - **ipconfig3** (string) - Optional - IP configuration for interface 3. - **ipconfig4** (string) - Optional - IP configuration for interface 4. - **ipconfig5** (string) - Optional - IP configuration for interface 5. - **ipconfig6** (string) - Optional - IP configuration for interface 6. - **ipconfig7** (string) - Optional - IP configuration for interface 7. - **ivshmem** (string) - Optional - IVSHMEM device. - **keephugepages** (boolean) - Optional - Keep hugepages allocated. - **keyboard** (Tkeyboard) - Optional - Keyboard layout. - **kvm** (boolean) - Optional - Enable KVM. - **localtime** (boolean) - Optional - Use local time. - **lock** (Tlock) - Optional - Lock settings. - **machine** (string) - Optional - Machine type. - **memory** (number) - Optional - Memory size in MB. - **migrate_downtime** (number) - Optional - Maximum downtime during migration. - **migrate_speed** (number) - Optional - Migration speed limit. - **name** (string) - Optional - VM name. - **nameserver** (string) - Optional - DNS nameserver. - **net0** (string) - Optional - Network device 0. - **net1** (string) - Optional - Network device 1. - **net2** (string) - Optional - Network device 2. - **net3** (string) - Optional - Network device 3. - **numa** (boolean) - Optional - Enable NUMA. - **numa0** (string) - Optional - NUMA node 0 configuration. - **numa1** (string) - Optional - NUMA node 1 configuration. - **numa2** (string) - Optional - NUMA node 2 configuration. - **numa3** (string) - Optional - NUMA node 3 configuration. - **onboot** (boolean) - Optional - Start VM on boot. - **ostype** (Tostype) - Optional - Operating system type. - **parallel0** (string) - Optional - Parallel port 0. - **parallel1** (string) - Optional - Parallel port 1. - **parallel2** (string) - Optional - Parallel port 2. - **parallel3** (string) - Optional - Parallel port 3. - **protection** (boolean) - Optional - Enable VM protection. - **reboot** (boolean) - Optional - Reboot VM after applying changes. - **revert** (string) - Optional - Revert to a previous configuration. - **rng0** (string) - Optional - Random number generator device 0. - **sata0** (string) - Optional - SATA device 0. - **sata1** (string) - Optional - SATA device 1. - **sata2** (string) - Optional - SATA device 2. - **sata3** (string) - Optional - SATA device 3. - **scsi0** (string) - Optional - SCSI device 0. - **scsi1** (string) - Optional - SCSI device 1. - **scsi2** (string) - Optional - SCSI device 2. - **scsi3** (string) - Optional - SCSI device 3. - **scsihw** (Tscsihw) - Optional - SCSI hardware type. - **searchdomain** (string) - Optional - DNS search domain. - **serial0** (string) - Optional - Serial port 0. - **serial1** (string) - Optional - Serial port 1. - **serial2** (string) - Optional - Serial port 2. - **serial3** (string) - Optional - Serial port 3. - **shares** (number) - Optional - CPU shares. - **skiplock** (boolean) - Optional - Skip lock. - **smbios1** (string) - Optional - SMBIOS settings. - **smp** (number) - Optional - Number of SMP CPUs. - **sockets** (number) - Optional - Number of CPU sockets. - **spice_enhancements** (string) - Optional - SPICE enhancements. - **sshkeys** (string) - Optional - SSH public keys. - **startdate** (string) - Optional - VM start date. - **startup** (string) - Optional - Startup settings. - **tablet** (boolean) - Optional - Enable tablet for graphics. - **tags** (string) - Optional - Tags for the VM. - **tdf** (boolean) - Optional - Enable TDF. - **template** (boolean) - Optional - Convert VM to template. - **tpmstate0** (string) - Optional - TPM state 0. - **unused0** (string) - Optional - Unused device 0. - **unused1** (string) - Optional - Unused device 1. - **unused2** (string) - Optional - Unused device 2. - **unused3** (string) - Optional - Unused device 3. - **usb0** (string) - Optional - USB device 0. - **usb1** (string) - Optional - USB device 1. - **usb2** (string) - Optional - USB device 2. - **usb3** (string) - Optional - USB device 3. - **vcpus** (number) - Optional - Number of virtual CPUs. - **vga** (string) - Optional - VGA device type. - **virtio0** (string) - Optional - VirtIO device 0. - **virtio1** (string) - Optional - VirtIO device 1. - **virtio2** (string) - Optional - VirtIO device 2. - **virtio3** (string) - Optional - VirtIO device 3. - **vmgenid** (string) - Optional - VM generation ID. - **vmstatestorage** (string) - Optional - Storage for VM state. - **watchdog** (string) - Optional - Watchdog device. ### Request Example ```json { "acpi": true, "cores": 2, "memory": 2048, "name": "my-vm" } ``` ### Response #### Success Response (200) - **string** (string) - A message indicating the success of the operation, typically an empty string or a confirmation message. ``` -------------------------------- ### Get Firewall Log Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Retrieves the firewall log for a specific Proxmox node. Supports pagination with limit and start parameters. ```APIDOC ## GET /nodes/{node}/firewall/log ### Description Read firewall log. ### Method GET ### Endpoint /nodes/{node}/firewall/log ### Parameters #### Query Parameters - **limit** (number) - Optional - The maximum number of log entries to return. - **start** (number) - Optional - The starting index for log entries. ### Response #### Success Response (200) - **nodesFirewallLogLog[]** - An array of firewall log entries. ### Response Example ```json [ { "timestamp": 1678886400, "sourceip": "192.168.1.100", "destinationip": "192.168.1.1", "destinationport": 80, "protocol": "TCP", "action": "ACCEPT" } ] ``` ``` -------------------------------- ### GET /nodes/{node}/certificates/info Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.nodesCertificatesInfoInfo.html Retrieves information about the certificates installed on a Proxmox node. This endpoint returns an object conforming to the nodesCertificatesInfoInfo interface. ```APIDOC ## GET /nodes/{node}/certificates/info ### Description Retrieves detailed information about the certificates on a specific Proxmox node. ### Method GET ### Endpoint /nodes/{node}/certificates/info ### Parameters #### Path Parameters - **node** (string) - Required - The node name. ### Response #### Success Response (200) - **filename** (string) - Optional - The filename of the certificate. - **fingerprint** (string) - Optional - The SHA 256 fingerprint of the certificate. - **issuer** (string) - Optional - The issuer name of the certificate. - **notafter** (number) - Optional - The certificate's notAfter timestamp (UNIX epoch). - **notbefore** (number) - Optional - The certificate's notBefore timestamp (UNIX epoch). - **pem** (string) - Optional - The certificate in PEM format. - **public-key-bits** (number) - Optional - The certificate's public key size. - **public-key-type** (string) - Optional - The certificate's public key algorithm. - **san** (string[]) - Optional - A list of the certificate's Subject Alternative Name entries. - **subject** (string) - Optional - The subject name of the certificate. #### Response Example { "filename": "/etc/pve/local/pve-ssl.pem", "fingerprint": "A1:B2:C3:D4:E5:F6:07:18:29:3A:4B:5C:6D:7E:8F:90:01:12:23:34:45:56:67:78:89:90:0A:1B:2C:3D:4E:5F", "issuer": "/CN=MyProxmoxCA", "notafter": 1735689599, "notbefore": 1672531200, "pem": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----", "public-key-bits": 2048, "public-key-type": "rsa", "san": [ "DNS:proxmox.example.com", "IP: 192.168.1.100" ], "subject": "/CN=proxmox.example.com" } ``` -------------------------------- ### POST /nodes/{node}/disks/initgpt Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Initializes a disk with a GPT partition table. ```APIDOC ## POST /nodes/{node}/disks/initgpt ### Description Initializes a disk with a GPT partition table. ### Method POST ### Endpoint /nodes/{node}/disks/initgpt ### Parameters #### Request Body - **disk** (string) - Required - The disk to initialize. - **uuid** (string) - Optional - The UUID to assign to the disk. ### Permissions 1 #### Returns Promise ### Response #### Success Response (200) - **string** (string) - A success message or identifier. ``` -------------------------------- ### Get Ceph configuration Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Retrieves the Ceph configuration for a given Proxmox node. This is useful for understanding the Ceph cluster's setup on the node. ```APIDOC ## GET /nodes/{node}/ceph/config ### Description Get Ceph configuration. ### Method GET ### Endpoint /nodes/{node}/ceph/config ### Permissions Allowtoken: 1 ### Returns Promise ### Defined in [model.ts:9370](https://github.com/UrielCh/proxmox-api/blob/eee2cb3/api/src/model.ts#L9370) ``` -------------------------------- ### GET /nodes/{node}/tasks Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.nodesTasksNodeTasks.html Retrieves a list of tasks for a specific Proxmox node. The response includes details about each task, such as its ID, status, start time, and end time. ```APIDOC ## GET /nodes/{node}/tasks ### Description Retrieves a list of tasks for a specific Proxmox node. The response includes details about each task, such as its ID, status, start time, and end time. ### Method GET ### Endpoint /nodes/{node}/tasks ### Parameters #### Path Parameters - **node** (string) - Required - The node ID to retrieve tasks from. ### Response #### Success Response (200) - **endtime** (number) - Optional - The time the task ended. - **id** (string) - The unique identifier for the task. - **node** (string) - The node where the task is running. - **pid** (number) - The process ID of the task. - **pstart** (number) - The time the task process started. - **starttime** (number) - The time the task was initiated. - **status** (string) - Optional - The current status of the task (e.g., 'running', 'stopped'). - **type** (string) - The type of the task. - **upid** (string) - The unique process identifier for the task. - **user** (string) - The user who initiated the task. #### Response Example { "endtime": 1678886400, "id": "12345", "node": "pve-node-1", "pid": 1234, "pstart": 1678882800, "starttime": 1678882800, "status": "running", "type": "vzdump", "upid": "vzdump@12345", "user": "root@pam" } ``` -------------------------------- ### onboot Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.nodesQemuConfigVmConfig.html Specifies whether the virtual machine should be started automatically during system bootup. ```APIDOC ### `Optional` onboot[](#onboot) onboot?: boolean Specifies whether a VM will be started during system bootup. ``` -------------------------------- ### Start Ceph Services Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Starts specified Ceph services on a node. If no service is specified, it may start all. ```APIDOC ## POST /nodes/{node}/ceph/start ### Description Starts Ceph services on a specified node. Optionally, a specific service can be targeted. ### Method POST ### Endpoint /nodes/{node}/ceph/start ### Parameters #### Query Parameters - **service** (string) - Optional - The name of the Ceph service to start. ### Response #### Success Response (200) - **string** - A confirmation message or status indicating the start operation. ### Request Example ```json { "service": "ceph-osd" } ``` ### Response Example ```json "Ceph service ceph-osd started successfully." ``` ``` -------------------------------- ### Initialization with ProxmoxEngine Source: https://github.com/urielch/proxmox-api/blob/master/api/README.md Demonstrates initializing the API client using an existing ProxmoxEngine instance, which can be useful for sharing tickets or accessing the engine directly. ```APIDOC ## Initialization with ProxmoxEngine ### Description This example shows an alternative way to initialize the proxmox-api client by creating a `ProxmoxEngine` instance first and then passing it to `proxmoxApi`. This approach allows for more control over the engine instance. ### Method ```typescript const proxmox = proxmoxApi(engine); ``` ### Endpoint N/A (Client-side SDK) ### Parameters - `engine` (ProxmoxEngine): An instance of `ProxmoxEngine`. ### Request Example ```typescript import proxmoxApi, { ProxmoxEngine } from "proxmox-api"; process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; async function test() { // connect to proxmox const engine = new ProxmoxEngine({host: '127.0.0.1', password: 'password', username: 'user1@pam'}); const proxmox = proxmoxApi(engine); } ``` ### Response N/A (Initialization function) ``` -------------------------------- ### info Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Retrieves general information from a QEMU guest agent. ```APIDOC ## GET /nodes/{node}/qemu/{vmid}/agent/info ### Description Executes the info command on the QEMU guest agent. ### Method GET ### Endpoint /nodes/{node}/qemu/{vmid}/agent/info ### Permissions Requires Allowtoken: 1 ### Returns Promise[] ``` -------------------------------- ### Post QEMU VM Snapshots Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Creates a new snapshot for a QEMU VM. ```APIDOC ## POST /vms/{vmid}/snapshot ### Description Creates a new snapshot for a QEMU VM. ### Method POST ### Endpoint /vms/{vmid}/snapshot ### Parameters #### Path Parameters - **vmid** (number) - Required - The ID of the virtual machine. ``` -------------------------------- ### Nodes Firewall Rules Get All Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.Tscope.html Get all firewall rules on a node. ```APIDOC ## GET /nodes/{node}/firewall/rules ### Description Retrieves all firewall rules configured for a specific node. ### Method GET ### Endpoint /nodes/{node}/firewall/rules ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node. ### Response #### Success Response (200) - **data** (array) - An array of firewall rule objects. - **action** (string) - The action of the rule (e.g., 'ACCEPT', 'DROP'). - **comment** (string) - A description of the rule. - **enable** (boolean) - Whether the rule is enabled. - **pos** (integer) - The position of the rule. #### Response Example { "data": [ { "action": "ACCEPT", "comment": "Allow internal traffic", "enable": true, "pos": 10 }, { "action": "DROP", "comment": "Block external access", "enable": true, "pos": 20 } ] } ``` -------------------------------- ### Post QEMU VM Template Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Creates a template from a QEMU VM. ```APIDOC ## POST /vms/{vmid}/template ### Description Creates a template from a QEMU VM. ### Method POST ### Endpoint /vms/{vmid}/template ### Parameters #### Path Parameters - **vmid** (number) - Required - The ID of the virtual machine. ``` -------------------------------- ### Post QEMU VM Migrate Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Initiates the migration of a QEMU VM. ```APIDOC ## POST /vms/{vmid}/migrate ### Description Initiates the migration of a QEMU VM. ### Method POST ### Endpoint /vms/{vmid}/migrate ### Parameters #### Path Parameters - **vmid** (number) - Required - The ID of the virtual machine. ``` -------------------------------- ### Create QEMU Virtual Machine Snapshot Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.pveconfigid_6.html Creates a snapshot for a specific QEMU virtual machine. ```APIDOC ## POST /nodes/{node}/qemu/{vmid}/snapshot ### Description Creates a snapshot for a specific QEMU virtual machine. ### Method POST ### Endpoint /nodes/{node}/qemu/{vmid}/snapshot ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node - **vmid** (integer) - Required - The ID of the QEMU virtual machine #### Request Body - **snapshot** (string) - Required - The name of the snapshot to create ``` -------------------------------- ### Nodes Firewall Rules Get Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.Tscope.html Get a specific firewall rule on a node. ```APIDOC ## GET /nodes/{node}/firewall/rules/{pos} ### Description Retrieves a specific firewall rule by its position on a given node. ### Method GET ### Endpoint /nodes/{node}/firewall/rules/{pos} ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node. - **pos** (integer) - Required - The position of the firewall rule. ### Response #### Success Response (200) - **data** (object) - The firewall rule object. - **action** (string) - The action of the rule (e.g., 'ACCEPT', 'DROP'). - **comment** (string) - A description of the rule. - **enable** (boolean) - Whether the rule is enabled. - **pos** (integer) - The position of the rule. #### Response Example { "data": { "action": "ACCEPT", "comment": "Allow internal traffic", "enable": true, "pos": 10 } } ``` -------------------------------- ### Node Ceph Pools Get Pool Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.pvefwdportspec.html Get details of a specific Ceph pool on a node. ```APIDOC ## GET /nodes/{node}/ceph/pools/{poolname} ### Description Retrieves detailed information about a specific Ceph pool on a given node. ### Method GET ### Endpoint /nodes/{node}/ceph/pools/{poolname} ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node. - **poolname** (string) - Required - The name of the Ceph pool. ### Response #### Success Response (200) - **data** (object) - The Ceph pool object. ### Response Example { "data": { "name": "rbd", "id": 0, "size": 3, "min_size": 2 } } ``` -------------------------------- ### Startup Behavior Configuration Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.nodesLxcConfigVmConfig.html Defines the startup and shutdown behavior, including order, and delays for starting or stopping VMs. ```APIDOC ## `Optional` startup[](#startup) startup?: string Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. * Defined in [model.ts:4157](https://github.com/UrielCh/proxmox-api/blob/eee2cb3/api/src/model.ts#L4157) ``` -------------------------------- ### Start Container Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Starts a container. This operation supports optional parameters for enabling debug mode and skipping the lock. ```APIDOC ## POST /nodes/{node}/lxc/{vmid}/status/start ### Description Start the container. ### Method POST ### Endpoint /nodes/{node}/lxc/{vmid}/status/start ### Parameters #### Request Body - **debug** (boolean) - Optional - Enable debug mode. - **skiplock** (boolean) - Optional - Skip the lock. ### Permissions 1 ### Returns Promise ``` -------------------------------- ### Initialize with API Token Source: https://github.com/urielch/proxmox-api/blob/master/docs/index.html Shows how to connect to Proxmox using an API token for authentication. Requires 'proxmox-api' to be installed. Ensure NODE_TLS_REJECT_UNAUTHORIZED is handled if using self-signed certificates. ```typescript import proxmoxApi from "proxmox-api"; process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; async function test() { // connect to proxmox const promox = proxmoxApi({host: '127.0.0.1', tokenID: 'USER@REALM!TOKENID', tokenSecret: '12345678-1234-1234-1234-1234567890ab'}); } ``` -------------------------------- ### Get Ceph Status Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Retrieves the current status of the Ceph cluster. This operation is available via a GET request. ```APIDOC ## GET /cluster/ceph/status ### Description Get ceph status. ### Method GET ### Endpoint /cluster/ceph/status ### Permissions Allowtoken: 1 ### Response #### Success Response (200) - **data** (any) - The status of the Ceph cluster. ``` -------------------------------- ### Migrate QEMU Virtual Machine Precondition Check Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.pveconfigid_6.html Checks the preconditions for migrating a QEMU virtual machine. ```APIDOC ## POST /nodes/{node}/qemu/{vmid}/migrate/precondition ### Description Checks the preconditions for migrating a QEMU virtual machine. ### Method POST ### Endpoint /nodes/{node}/qemu/{vmid}/migrate/precondition ### Parameters #### Path Parameters - **node** (string) - Required - The name of the source node - **vmid** (integer) - Required - The ID of the QEMU virtual machine #### Request Body - **target** (string) - Required - The name of the target node ``` -------------------------------- ### Node LXC Firewall Rules Get Rules Source: https://github.com/urielch/proxmox-api/blob/master/docs/types/Proxmox.ldapsimpleattrlist.html Get all firewall rules for an LXC container on a Proxmox node. ```APIDOC ## GET /nodes/{node}/lxc/{vmid}/firewall/rules ### Description Retrieves all firewall rules configured for a specific LXC container on a Proxmox node. ### Method GET ### Endpoint /nodes/{node}/lxc/{vmid}/firewall/rules ### Parameters #### Path Parameters - **node** (string) - Required - The name of the node. - **vmid** (integer) - Required - The ID of the LXC container. ``` -------------------------------- ### Migrate Virtual Machine Source: https://github.com/urielch/proxmox-api/blob/master/docs/interfaces/Proxmox.Api.html Initiates the migration of a QEMU virtual machine, creating a new migration task. ```APIDOC ## POST /nodes/{node}/qemu/{vmid}/migrate ### Description Migrate virtual machine. Creates a new migration task. ### Method POST ### Endpoint /nodes/{node}/qemu/{vmid}/migrate ### Parameters #### Query Parameters - **bwlimit** (number) - Optional - Bandwidth limit for migration. - **force** (boolean) - Optional - Force migration. - **migration_network** (string) - Optional - Network to use for migration. - **migration_type** (Tmigration_type) - Optional - Type of migration. - **online** (boolean) - Optional - Perform online migration. - **target** (string) - Required - The target node for migration. - **targetstorage** (string) - Optional - The target storage for disks. - **with-local-disks** (boolean) - Optional - Whether to migrate local disks. ### Response #### Success Response (200) - **string** - Confirmation of migration task creation. ```