diff --git a/package.json b/package.json index 8da2b68..db3ba12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@corsinvest/cv4pve-api-javascript", - "version": "8.1.2", + "version": "8.2.0", "description": "Proxmox VE Client API JavaScript", "main": "./src/index.js", "types": "./dist/src/index.d.ts", diff --git a/src/index.js b/src/index.js index 0d138a6..52026fa 100644 --- a/src/index.js +++ b/src/index.js @@ -894,7 +894,10 @@ class PVEItemReplicationClusterId { * @returns {Promise} */ async delete_(force, keep) { - const parameters = { force: force, keep: keep }; + const parameters = { + force: force, + keep: keep, + }; return await this.#client.delete( `/cluster/replication/${this.#id}`, parameters @@ -2779,7 +2782,11 @@ class PVEItemIpsetFirewallClusterName { * @returns {Promise} */ async createIp(cidr, comment, nomatch) { - const parameters = { cidr: cidr, comment: comment, nomatch: nomatch }; + const parameters = { + cidr: cidr, + comment: comment, + nomatch: nomatch, + }; return await this.#client.create( `/cluster/firewall/ipset/${this.#name}`, parameters @@ -2830,7 +2837,11 @@ class PVEItemNameIpsetFirewallClusterCidr { * @returns {Promise} */ async updateIp(comment, digest, nomatch) { - const parameters = { comment: comment, digest: digest, nomatch: nomatch }; + const parameters = { + comment: comment, + digest: digest, + nomatch: nomatch, + }; return await this.#client.set( `/cluster/firewall/ipset/${this.#name}/${this.#cidr}`, parameters @@ -2873,7 +2884,11 @@ class PVEFirewallClusterAliases { * @returns {Promise} */ async createAlias(cidr, name, comment) { - const parameters = { cidr: cidr, name: name, comment: comment }; + const parameters = { + cidr: cidr, + name: name, + comment: comment, + }; return await this.#client.create(`/cluster/firewall/aliases`, parameters); } } @@ -3065,21 +3080,24 @@ class PVEClusterBackup { * @param {string} dumpdir Store resulting files to specified directory. * @param {boolean} enabled Enable or disable the job. * @param {string} exclude Exclude specified guest systems (assumes --all) - * @param {array} exclude_path Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. + * @param {array} exclude_path Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. + * @param {string} fleecing Options for backup fleecing (VM only). * @param {string} id Job ID (will be autogenerated). * @param {int} ionice Set IO priority when using the BFQ scheduler. For snapshot and suspend mode backups of VMs, this only affects the compressor. A value of 8 means the idle priority is used, otherwise the best-effort priority is used with the specified value. * @param {int} lockwait Maximal time to wait for the global lock (minutes). - * @param {string} mailnotification Deprecated: use 'notification-policy' instead. + * @param {string} mailnotification Deprecated: use notification targets/matchers instead. Specify when to send a notification mail * Enum: always,failure - * @param {string} mailto Comma-separated list of email addresses or users that should receive email notifications. Has no effect if the 'notification-target' option is set at the same time. + * @param {string} mailto Deprecated: Use notification targets/matchers instead. Comma-separated list of email addresses or users that should receive email notifications. * @param {int} maxfiles Deprecated: use 'prune-backups' instead. Maximal number of backup files per guest system. * @param {string} mode Backup mode. * Enum: snapshot,suspend,stop * @param {string} node Only run if executed on this node. * @param {string} notes_template Template string for generating notes for the backup(s). It can contain variables which will be replaced by their values. Currently supported are {{cluster}}, {{guestname}}, {{node}}, and {{vmid}}, but more might be added in the future. Needs to be a single line, newline and backslash need to be escaped as '\n' and '\\' respectively. - * @param {string} notification_policy Specify when to send a notification + * @param {string} notification_mode Determine which notification system to use. If set to 'legacy-sendmail', vzdump will consider the mailto/mailnotification parameters and send emails to the specified address(es) via the 'sendmail' command. If set to 'notification-system', a notification will be sent via PVE's notification system, and the mailto and mailnotification will be ignored. If set to 'auto' (default setting), an email will be sent if mailto is set, and the notification system will be used if not. + * Enum: auto,legacy-sendmail,notification-system + * @param {string} notification_policy Deprecated: Do not use * Enum: always,failure,never - * @param {string} notification_target Determine the target to which notifications should be sent. Can either be a notification endpoint or a notification group. This option takes precedence over 'mailto', meaning that if both are set, the 'mailto' option will be ignored. + * @param {string} notification_target Deprecated: Do not use * @param {string} performance Other performance-related settings. * @param {int} pigz Use pigz instead of gzip when N>0. N=1 uses half of cores, N>1 uses N as thread count. * @param {string} pool Backup all known guest systems included in the specified pool. @@ -3097,7 +3115,7 @@ class PVEClusterBackup { * @param {string} storage Store resulting file to this storage. * @param {string} tmpdir Store temporary files to specified directory. * @param {string} vmid The ID of the guest system you want to backup. - * @param {int} zstd Zstd threads. N=0 uses half of the available cores, N>0 uses N as thread count. + * @param {int} zstd Zstd threads. N=0 uses half of the available cores, if N is set to a value bigger than 0, N is used as thread count. * @returns {Promise} */ async createJob( @@ -3110,6 +3128,7 @@ class PVEClusterBackup { enabled, exclude, exclude_path, + fleecing, id, ionice, lockwait, @@ -3119,6 +3138,7 @@ class PVEClusterBackup { mode, node, notes_template, + notification_mode, notification_policy, notification_target, performance, @@ -3150,6 +3170,7 @@ class PVEClusterBackup { enabled: enabled, exclude: exclude, "exclude-path": exclude_path, + fleecing: fleecing, id: id, ionice: ionice, lockwait: lockwait, @@ -3159,6 +3180,7 @@ class PVEClusterBackup { mode: mode, node: node, "notes-template": notes_template, + "notification-mode": notification_mode, "notification-policy": notification_policy, "notification-target": notification_target, performance: performance, @@ -3236,20 +3258,23 @@ class PVEItemBackupClusterId { * @param {string} dumpdir Store resulting files to specified directory. * @param {boolean} enabled Enable or disable the job. * @param {string} exclude Exclude specified guest systems (assumes --all) - * @param {array} exclude_path Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. + * @param {array} exclude_path Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. + * @param {string} fleecing Options for backup fleecing (VM only). * @param {int} ionice Set IO priority when using the BFQ scheduler. For snapshot and suspend mode backups of VMs, this only affects the compressor. A value of 8 means the idle priority is used, otherwise the best-effort priority is used with the specified value. * @param {int} lockwait Maximal time to wait for the global lock (minutes). - * @param {string} mailnotification Deprecated: use 'notification-policy' instead. + * @param {string} mailnotification Deprecated: use notification targets/matchers instead. Specify when to send a notification mail * Enum: always,failure - * @param {string} mailto Comma-separated list of email addresses or users that should receive email notifications. Has no effect if the 'notification-target' option is set at the same time. + * @param {string} mailto Deprecated: Use notification targets/matchers instead. Comma-separated list of email addresses or users that should receive email notifications. * @param {int} maxfiles Deprecated: use 'prune-backups' instead. Maximal number of backup files per guest system. * @param {string} mode Backup mode. * Enum: snapshot,suspend,stop * @param {string} node Only run if executed on this node. * @param {string} notes_template Template string for generating notes for the backup(s). It can contain variables which will be replaced by their values. Currently supported are {{cluster}}, {{guestname}}, {{node}}, and {{vmid}}, but more might be added in the future. Needs to be a single line, newline and backslash need to be escaped as '\n' and '\\' respectively. - * @param {string} notification_policy Specify when to send a notification + * @param {string} notification_mode Determine which notification system to use. If set to 'legacy-sendmail', vzdump will consider the mailto/mailnotification parameters and send emails to the specified address(es) via the 'sendmail' command. If set to 'notification-system', a notification will be sent via PVE's notification system, and the mailto and mailnotification will be ignored. If set to 'auto' (default setting), an email will be sent if mailto is set, and the notification system will be used if not. + * Enum: auto,legacy-sendmail,notification-system + * @param {string} notification_policy Deprecated: Do not use * Enum: always,failure,never - * @param {string} notification_target Determine the target to which notifications should be sent. Can either be a notification endpoint or a notification group. This option takes precedence over 'mailto', meaning that if both are set, the 'mailto' option will be ignored. + * @param {string} notification_target Deprecated: Do not use * @param {string} performance Other performance-related settings. * @param {int} pigz Use pigz instead of gzip when N>0. N=1 uses half of cores, N>1 uses N as thread count. * @param {string} pool Backup all known guest systems included in the specified pool. @@ -3267,7 +3292,7 @@ class PVEItemBackupClusterId { * @param {string} storage Store resulting file to this storage. * @param {string} tmpdir Store temporary files to specified directory. * @param {string} vmid The ID of the guest system you want to backup. - * @param {int} zstd Zstd threads. N=0 uses half of the available cores, N>0 uses N as thread count. + * @param {int} zstd Zstd threads. N=0 uses half of the available cores, if N is set to a value bigger than 0, N is used as thread count. * @returns {Promise} */ async updateJob( @@ -3281,6 +3306,7 @@ class PVEItemBackupClusterId { enabled, exclude, exclude_path, + fleecing, ionice, lockwait, mailnotification, @@ -3289,6 +3315,7 @@ class PVEItemBackupClusterId { mode, node, notes_template, + notification_mode, notification_policy, notification_target, performance, @@ -3321,6 +3348,7 @@ class PVEItemBackupClusterId { enabled: enabled, exclude: exclude, "exclude-path": exclude_path, + fleecing: fleecing, ionice: ionice, lockwait: lockwait, mailnotification: mailnotification, @@ -3329,6 +3357,7 @@ class PVEItemBackupClusterId { mode: mode, node: node, "notes-template": notes_template, + "notification-mode": notification_mode, "notification-policy": notification_policy, "notification-target": notification_target, performance: performance, @@ -4714,7 +4743,7 @@ class PVEMappingClusterPci { * @param {string} id The ID of the logical PCI mapping. * @param {array} map A list of maps for the cluster nodes. * @param {string} description Description of the logical PCI device. - * @param {boolean} mdev + * @param {boolean} mdev Marks the device(s) as being capable of providing mediated devices. * @returns {Promise} */ async create(id, map, description, mdev) { @@ -4760,7 +4789,7 @@ class PVEItemPciMappingClusterId { * @param {string} description Description of the logical PCI device. * @param {string} digest Prevent changes if current configuration file has a different digest. This can be used to prevent concurrent modifications. * @param {array} map A list of maps for the cluster nodes. - * @param {boolean} mdev + * @param {boolean} mdev Marks the device(s) as being capable of providing mediated devices. * @returns {Promise} */ async update(delete_, description, digest, map, mdev) { @@ -4815,7 +4844,11 @@ class PVEMappingClusterUsb { * @returns {Promise} */ async create(id, map, description) { - const parameters = { id: id, map: map, description: description }; + const parameters = { + id: id, + map: map, + description: description, + }; return await this.#client.create(`/cluster/mapping/usb`, parameters); } } @@ -4972,7 +5005,10 @@ class PVESdnClusterVnets { * @returns {Promise} */ async index(pending, running) { - const parameters = { pending: pending, running: running }; + const parameters = { + pending: pending, + running: running, + }; return await this.#client.get(`/cluster/sdn/vnets`, parameters); } /** @@ -5049,7 +5085,10 @@ class PVEItemVnetsSdnClusterVnet { * @returns {Promise} */ async read(pending, running) { - const parameters = { pending: pending, running: running }; + const parameters = { + pending: pending, + running: running, + }; return await this.#client.get( `/cluster/sdn/vnets/${this.#vnet}`, parameters @@ -5113,7 +5152,10 @@ class PVEVnetVnetsSdnClusterSubnets { * @returns {Promise} */ async index(pending, running) { - const parameters = { pending: pending, running: running }; + const parameters = { + pending: pending, + running: running, + }; return await this.#client.get( `/cluster/sdn/vnets/${this.#vnet}/subnets`, parameters @@ -5186,7 +5228,10 @@ class PVEItemSubnetsVnetVnetsSdnClusterSubnet { * @returns {Promise} */ async read(pending, running) { - const parameters = { pending: pending, running: running }; + const parameters = { + pending: pending, + running: running, + }; return await this.#client.get( `/cluster/sdn/vnets/${this.#vnet}/subnets/${this.#subnet}`, parameters @@ -5249,7 +5294,11 @@ class PVEVnetVnetsSdnClusterIps { * @returns {Promise} */ async ipdelete(ip, zone, mac) { - const parameters = { ip: ip, zone: zone, mac: mac }; + const parameters = { + ip: ip, + zone: zone, + mac: mac, + }; return await this.#client.delete( `/cluster/sdn/vnets/${this.#vnet}/ips`, parameters @@ -5263,7 +5312,11 @@ class PVEVnetVnetsSdnClusterIps { * @returns {Promise} */ async ipcreate(ip, zone, mac) { - const parameters = { ip: ip, zone: zone, mac: mac }; + const parameters = { + ip: ip, + zone: zone, + mac: mac, + }; return await this.#client.create( `/cluster/sdn/vnets/${this.#vnet}/ips`, parameters @@ -5278,7 +5331,12 @@ class PVEVnetVnetsSdnClusterIps { * @returns {Promise} */ async ipupdate(ip, zone, mac, vmid) { - const parameters = { ip: ip, zone: zone, mac: mac, vmid: vmid }; + const parameters = { + ip: ip, + zone: zone, + mac: mac, + vmid: vmid, + }; return await this.#client.set( `/cluster/sdn/vnets/${this.#vnet}/ips`, parameters @@ -5315,7 +5373,11 @@ class PVESdnClusterZones { * @returns {Promise} */ async index(pending, running, type) { - const parameters = { pending: pending, running: running, type: type }; + const parameters = { + pending: pending, + running: running, + type: type, + }; return await this.#client.get(`/cluster/sdn/zones`, parameters); } /** @@ -5434,7 +5496,10 @@ class PVEItemZonesSdnClusterZone { * @returns {Promise} */ async read(pending, running) { - const parameters = { pending: pending, running: running }; + const parameters = { + pending: pending, + running: running, + }; return await this.#client.get( `/cluster/sdn/zones/${this.#zone}`, parameters @@ -5561,7 +5626,11 @@ class PVESdnClusterControllers { * @returns {Promise} */ async index(pending, running, type) { - const parameters = { pending: pending, running: running, type: type }; + const parameters = { + pending: pending, + running: running, + type: type, + }; return await this.#client.get(`/cluster/sdn/controllers`, parameters); } /** @@ -5641,7 +5710,10 @@ class PVEItemControllersSdnClusterController { * @returns {Promise} */ async read(pending, running) { - const parameters = { pending: pending, running: running }; + const parameters = { + pending: pending, + running: running, + }; return await this.#client.get( `/cluster/sdn/controllers/${this.#controller}`, parameters @@ -6720,11 +6792,11 @@ class PVENodeNodesQemu { * @param {string} keyboard Keyboard layout for VNC server. This option is generally not required and is often better handled from within the guest OS. * Enum: de,de-ch,da,en-gb,en-us,es,fi,fr,fr-be,fr-ca,fr-ch,hu,is,it,ja,lt,mk,nl,no,pl,pt,pt-br,sv,sl,tr * @param {boolean} kvm Enable/disable KVM hardware virtualization. - * @param {boolean} live_restore Start the VM immediately from the backup and restore in background. PBS only. + * @param {boolean} live_restore Start the VM immediately while importing or restoring in the background. * @param {boolean} localtime Set the real time clock (RTC) to local time. This is enabled by default if the `ostype` indicates a Microsoft Windows OS. * @param {string} lock Lock/unlock the VM. * Enum: backup,clone,create,migrate,rollback,snapshot,snapshot-delete,suspending,suspended - * @param {string} machine Specifies the QEMU machine type. + * @param {string} machine Specify the QEMU machine. * @param {string} memory Memory properties. * @param {float} migrate_downtime Set maximum tolerated downtime (in seconds) for migrations. * @param {int} migrate_speed Set maximum speed (in MB/s) for migrations. Value 0 is no limit. @@ -7702,7 +7774,11 @@ class PVEFirewallVmidQemuNodeNodesAliases { * @returns {Promise} */ async createAlias(cidr, name, comment) { - const parameters = { cidr: cidr, name: name, comment: comment }; + const parameters = { + cidr: cidr, + name: name, + comment: comment, + }; return await this.#client.create( `/nodes/${this.#node}/qemu/${this.#vmid}/firewall/aliases`, parameters @@ -7889,7 +7965,11 @@ class PVEItemIpsetFirewallVmidQemuNodeNodesName { * @returns {Promise} */ async createIp(cidr, comment, nomatch) { - const parameters = { cidr: cidr, comment: comment, nomatch: nomatch }; + const parameters = { + cidr: cidr, + comment: comment, + nomatch: nomatch, + }; return await this.#client.create( `/nodes/${this.#node}/qemu/${this.#vmid}/firewall/ipset/${this.#name}`, parameters @@ -7948,7 +8028,11 @@ class PVEItemNameIpsetFirewallVmidQemuNodeNodesCidr { * @returns {Promise} */ async updateIp(comment, digest, nomatch) { - const parameters = { comment: comment, digest: digest, nomatch: nomatch }; + const parameters = { + comment: comment, + digest: digest, + nomatch: nomatch, + }; return await this.#client.set( `/nodes/${this.#node}/qemu/${this.#vmid}/firewall/ipset/${this.#name}/${ this.#cidr @@ -9072,7 +9156,10 @@ class PVEAgentVmidQemuNodeNodesExec { * @returns {Promise} */ async exec(command, input_data) { - const parameters = { command: command, "input-data": input_data }; + const parameters = { + command: command, + "input-data": input_data, + }; return await this.#client.create( `/nodes/${this.#node}/qemu/${this.#vmid}/agent/exec`, parameters @@ -9161,7 +9248,11 @@ class PVEAgentVmidQemuNodeNodesFileWrite { * @returns {Promise} */ async fileWrite(content, file, encode) { - const parameters = { content: content, file: file, encode: encode }; + const parameters = { + content: content, + file: file, + encode: encode, + }; return await this.#client.create( `/nodes/${this.#node}/qemu/${this.#vmid}/agent/file-write`, parameters @@ -9194,7 +9285,11 @@ class PVEVmidQemuNodeNodesRrd { * @returns {Promise} */ async rrd(ds, timeframe, cf) { - const parameters = { ds: ds, timeframe: timeframe, cf: cf }; + const parameters = { + ds: ds, + timeframe: timeframe, + cf: cf, + }; return await this.#client.get( `/nodes/${this.#node}/qemu/${this.#vmid}/rrd`, parameters @@ -9226,7 +9321,10 @@ class PVEVmidQemuNodeNodesRrddata { * @returns {Promise} */ async rrddata(timeframe, cf) { - const parameters = { timeframe: timeframe, cf: cf }; + const parameters = { + timeframe: timeframe, + cf: cf, + }; return await this.#client.get( `/nodes/${this.#node}/qemu/${this.#vmid}/rrddata`, parameters @@ -9256,7 +9354,10 @@ class PVEVmidQemuNodeNodesConfig { * @returns {Promise} */ async vmConfig(current, snapshot) { - const parameters = { current: current, snapshot: snapshot }; + const parameters = { + current: current, + snapshot: snapshot, + }; return await this.#client.get( `/nodes/${this.#node}/qemu/${this.#vmid}/config`, parameters @@ -9310,7 +9411,7 @@ class PVEVmidQemuNodeNodesConfig { * @param {boolean} localtime Set the real time clock (RTC) to local time. This is enabled by default if the `ostype` indicates a Microsoft Windows OS. * @param {string} lock Lock/unlock the VM. * Enum: backup,clone,create,migrate,rollback,snapshot,snapshot-delete,suspending,suspended - * @param {string} machine Specifies the QEMU machine type. + * @param {string} machine Specify the QEMU machine. * @param {string} memory Memory properties. * @param {float} migrate_downtime Set maximum tolerated downtime (in seconds) for migrations. * @param {int} migrate_speed Set maximum speed (in MB/s) for migrations. Value 0 is no limit. @@ -9579,7 +9680,7 @@ class PVEVmidQemuNodeNodesConfig { * @param {boolean} localtime Set the real time clock (RTC) to local time. This is enabled by default if the `ostype` indicates a Microsoft Windows OS. * @param {string} lock Lock/unlock the VM. * Enum: backup,clone,create,migrate,rollback,snapshot,snapshot-delete,suspending,suspended - * @param {string} machine Specifies the QEMU machine type. + * @param {string} machine Specify the QEMU machine. * @param {string} memory Memory properties. * @param {float} migrate_downtime Set maximum tolerated downtime (in seconds) for migrations. * @param {int} migrate_speed Set maximum speed (in MB/s) for migrations. Value 0 is no limit. @@ -9928,7 +10029,10 @@ class PVEVmidQemuNodeNodesUnlink { * @returns {Promise} */ async unlink(idlist, force) { - const parameters = { idlist: idlist, force: force }; + const parameters = { + idlist: idlist, + force: force, + }; return await this.#client.set( `/nodes/${this.#node}/qemu/${this.#vmid}/unlink`, parameters @@ -10021,7 +10125,10 @@ class PVEVmidQemuNodeNodesVncwebsocket { * @returns {Promise} */ async vncwebsocket(port, vncticket) { - const parameters = { port: port, vncticket: vncticket }; + const parameters = { + port: port, + vncticket: vncticket, + }; return await this.#client.get( `/nodes/${this.#node}/qemu/${this.#vmid}/vncwebsocket`, parameters @@ -10240,7 +10347,7 @@ class PVEStatusVmidQemuNodeNodesStart { /** * Start virtual machine. * @param {string} force_cpu Override QEMU's -cpu argument with the given string. - * @param {string} machine Specifies the QEMU machine type. + * @param {string} machine Specify the QEMU machine. * @param {string} migratedfrom The cluster node name. * @param {string} migration_network CIDR of the (sub) network that is used for migration. * @param {string} migration_type Migration traffic is encrypted using an SSH tunnel by default. On secure, completely private networks this can be disabled to increase performance. @@ -10296,17 +10403,19 @@ class PVEStatusVmidQemuNodeNodesStop { } /** - * Stop virtual machine. The qemu process will exit immediately. Thisis akin to pulling the power plug of a running computer and may damage the VM data + * Stop virtual machine. The qemu process will exit immediately. This is akin to pulling the power plug of a running computer and may damage the VM data. * @param {boolean} keepActive Do not deactivate storage volumes. * @param {string} migratedfrom The cluster node name. + * @param {boolean} overrule_shutdown Try to abort active 'qmshutdown' tasks before stopping. * @param {boolean} skiplock Ignore locks - only root is allowed to use this option. * @param {int} timeout Wait maximal timeout seconds. * @returns {Promise} */ - async vmStop(keepActive, migratedfrom, skiplock, timeout) { + async vmStop(keepActive, migratedfrom, overrule_shutdown, skiplock, timeout) { const parameters = { keepActive: keepActive, migratedfrom: migratedfrom, + "overrule-shutdown": overrule_shutdown, skiplock: skiplock, timeout: timeout, }; @@ -10362,7 +10471,7 @@ class PVEStatusVmidQemuNodeNodesShutdown { } /** - * Shutdown virtual machine. This is similar to pressing the power button on a physical machine.This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown. + * Shutdown virtual machine. This is similar to pressing the power button on a physical machine. This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown. * @param {boolean} forceStop Make sure the VM stops. * @param {boolean} keepActive Do not deactivate storage volumes. * @param {boolean} skiplock Ignore locks - only root is allowed to use this option. @@ -10469,7 +10578,10 @@ class PVEStatusVmidQemuNodeNodesResume { * @returns {Promise} */ async vmResume(nocheck, skiplock) { - const parameters = { nocheck: nocheck, skiplock: skiplock }; + const parameters = { + nocheck: nocheck, + skiplock: skiplock, + }; return await this.#client.create( `/nodes/${this.#node}/qemu/${this.#vmid}/status/resume`, parameters @@ -10499,7 +10611,10 @@ class PVEVmidQemuNodeNodesSendkey { * @returns {Promise} */ async vmSendkey(key, skiplock) { - const parameters = { key: key, skiplock: skiplock }; + const parameters = { + key: key, + skiplock: skiplock, + }; return await this.#client.set( `/nodes/${this.#node}/qemu/${this.#vmid}/sendkey`, parameters @@ -10530,7 +10645,10 @@ class PVEVmidQemuNodeNodesFeature { * @returns {Promise} */ async vmFeature(feature, snapname) { - const parameters = { feature: feature, snapname: snapname }; + const parameters = { + feature: feature, + snapname: snapname, + }; return await this.#client.get( `/nodes/${this.#node}/qemu/${this.#vmid}/feature`, parameters @@ -11100,7 +11218,10 @@ class PVEVmidQemuNodeNodesMtunnel { * @returns {Promise} */ async mtunnel(bridges, storages) { - const parameters = { bridges: bridges, storages: storages }; + const parameters = { + bridges: bridges, + storages: storages, + }; return await this.#client.create( `/nodes/${this.#node}/qemu/${this.#vmid}/mtunnel`, parameters @@ -11130,7 +11251,10 @@ class PVEVmidQemuNodeNodesMtunnelwebsocket { * @returns {Promise} */ async mtunnelwebsocket(socket, ticket) { - const parameters = { socket: socket, ticket: ticket }; + const parameters = { + socket: socket, + ticket: ticket, + }; return await this.#client.get( `/nodes/${this.#node}/qemu/${this.#vmid}/mtunnelwebsocket`, parameters @@ -11666,7 +11790,10 @@ class PVEVmidLxcNodeNodesConfig { * @returns {Promise} */ async vmConfig(current, snapshot) { - const parameters = { current: current, snapshot: snapshot }; + const parameters = { + current: current, + snapshot: snapshot, + }; return await this.#client.get( `/nodes/${this.#node}/lxc/${this.#vmid}/config`, parameters @@ -11962,7 +12089,10 @@ class PVEStatusVmidLxcNodeNodesStart { * @returns {Promise} */ async vmStart(debug, skiplock) { - const parameters = { debug: debug, skiplock: skiplock }; + const parameters = { + debug: debug, + skiplock: skiplock, + }; return await this.#client.create( `/nodes/${this.#node}/lxc/${this.#vmid}/status/start`, parameters @@ -11987,11 +12117,15 @@ class PVEStatusVmidLxcNodeNodesStop { /** * Stop the container. This will abruptly stop all processes running in the container. + * @param {boolean} overrule_shutdown Try to abort active 'vzshutdown' tasks before stopping. * @param {boolean} skiplock Ignore locks - only root is allowed to use this option. * @returns {Promise} */ - async vmStop(skiplock) { - const parameters = { skiplock: skiplock }; + async vmStop(overrule_shutdown, skiplock) { + const parameters = { + "overrule-shutdown": overrule_shutdown, + skiplock: skiplock, + }; return await this.#client.create( `/nodes/${this.#node}/lxc/${this.#vmid}/status/stop`, parameters @@ -12021,7 +12155,10 @@ class PVEStatusVmidLxcNodeNodesShutdown { * @returns {Promise} */ async vmShutdown(forceStop, timeout) { - const parameters = { forceStop: forceStop, timeout: timeout }; + const parameters = { + forceStop: forceStop, + timeout: timeout, + }; return await this.#client.create( `/nodes/${this.#node}/lxc/${this.#vmid}/status/shutdown`, parameters @@ -12155,7 +12292,10 @@ class PVEVmidLxcNodeNodesSnapshot { * @returns {Promise} */ async snapshot(snapname, description) { - const parameters = { snapname: snapname, description: description }; + const parameters = { + snapname: snapname, + description: description, + }; return await this.#client.create( `/nodes/${this.#node}/lxc/${this.#vmid}/snapshot`, parameters @@ -12665,7 +12805,11 @@ class PVEFirewallVmidLxcNodeNodesAliases { * @returns {Promise} */ async createAlias(cidr, name, comment) { - const parameters = { cidr: cidr, name: name, comment: comment }; + const parameters = { + cidr: cidr, + name: name, + comment: comment, + }; return await this.#client.create( `/nodes/${this.#node}/lxc/${this.#vmid}/firewall/aliases`, parameters @@ -12852,7 +12996,11 @@ class PVEItemIpsetFirewallVmidLxcNodeNodesName { * @returns {Promise} */ async createIp(cidr, comment, nomatch) { - const parameters = { cidr: cidr, comment: comment, nomatch: nomatch }; + const parameters = { + cidr: cidr, + comment: comment, + nomatch: nomatch, + }; return await this.#client.create( `/nodes/${this.#node}/lxc/${this.#vmid}/firewall/ipset/${this.#name}`, parameters @@ -12911,7 +13059,11 @@ class PVEItemNameIpsetFirewallVmidLxcNodeNodesCidr { * @returns {Promise} */ async updateIp(comment, digest, nomatch) { - const parameters = { comment: comment, digest: digest, nomatch: nomatch }; + const parameters = { + comment: comment, + digest: digest, + nomatch: nomatch, + }; return await this.#client.set( `/nodes/${this.#node}/lxc/${this.#vmid}/firewall/ipset/${this.#name}/${ this.#cidr @@ -13092,7 +13244,11 @@ class PVEVmidLxcNodeNodesRrd { * @returns {Promise} */ async rrd(ds, timeframe, cf) { - const parameters = { ds: ds, timeframe: timeframe, cf: cf }; + const parameters = { + ds: ds, + timeframe: timeframe, + cf: cf, + }; return await this.#client.get( `/nodes/${this.#node}/lxc/${this.#vmid}/rrd`, parameters @@ -13124,7 +13280,10 @@ class PVEVmidLxcNodeNodesRrddata { * @returns {Promise} */ async rrddata(timeframe, cf) { - const parameters = { timeframe: timeframe, cf: cf }; + const parameters = { + timeframe: timeframe, + cf: cf, + }; return await this.#client.get( `/nodes/${this.#node}/lxc/${this.#vmid}/rrddata`, parameters @@ -13155,7 +13314,11 @@ class PVEVmidLxcNodeNodesVncproxy { * @returns {Promise} */ async vncproxy(height, websocket, width) { - const parameters = { height: height, websocket: websocket, width: width }; + const parameters = { + height: height, + websocket: websocket, + width: width, + }; return await this.#client.create( `/nodes/${this.#node}/lxc/${this.#vmid}/vncproxy`, parameters @@ -13211,7 +13374,10 @@ class PVEVmidLxcNodeNodesVncwebsocket { * @returns {Promise} */ async vncwebsocket(port, vncticket) { - const parameters = { port: port, vncticket: vncticket }; + const parameters = { + port: port, + vncticket: vncticket, + }; return await this.#client.get( `/nodes/${this.#node}/lxc/${this.#vmid}/vncwebsocket`, parameters @@ -13369,7 +13535,10 @@ class PVEVmidLxcNodeNodesFeature { * @returns {Promise} */ async vmFeature(feature, snapname) { - const parameters = { feature: feature, snapname: snapname }; + const parameters = { + feature: feature, + snapname: snapname, + }; return await this.#client.get( `/nodes/${this.#node}/lxc/${this.#vmid}/feature`, parameters @@ -13484,7 +13653,11 @@ class PVEVmidLxcNodeNodesResize { * @returns {Promise} */ async resizeVm(disk, size, digest) { - const parameters = { disk: disk, size: size, digest: digest }; + const parameters = { + disk: disk, + size: size, + digest: digest, + }; return await this.#client.set( `/nodes/${this.#node}/lxc/${this.#vmid}/resize`, parameters @@ -13622,7 +13795,10 @@ class PVEVmidLxcNodeNodesMtunnel { * @returns {Promise} */ async mtunnel(bridges, storages) { - const parameters = { bridges: bridges, storages: storages }; + const parameters = { + bridges: bridges, + storages: storages, + }; return await this.#client.create( `/nodes/${this.#node}/lxc/${this.#vmid}/mtunnel`, parameters @@ -13652,7 +13828,10 @@ class PVEVmidLxcNodeNodesMtunnelwebsocket { * @returns {Promise} */ async mtunnelwebsocket(socket, ticket) { - const parameters = { socket: socket, ticket: ticket }; + const parameters = { + socket: socket, + ticket: ticket, + }; return await this.#client.get( `/nodes/${this.#node}/lxc/${this.#vmid}/mtunnelwebsocket`, parameters @@ -14533,7 +14712,10 @@ class PVEItemFsCephNodeNodesName { * @returns {Promise} */ async createfs(add_storage, pg_num) { - const parameters = { "add-storage": add_storage, pg_num: pg_num }; + const parameters = { + "add-storage": add_storage, + pg_num: pg_num, + }; return await this.#client.create( `/nodes/${this.#node}/ceph/fs/${this.#name}`, parameters @@ -14935,7 +15117,10 @@ class PVECephNodeNodesLog { * @returns {Promise} */ async log(limit, start) { - const parameters = { limit: limit, start: start }; + const parameters = { + limit: limit, + start: start, + }; return await this.#client.get(`/nodes/${this.#node}/ceph/log`, parameters); } } @@ -14985,7 +15170,11 @@ class PVECephNodeNodesCmdSafety { * @returns {Promise} */ async cmdSafety(action, id, service) { - const parameters = { action: action, id: id, service: service }; + const parameters = { + action: action, + id: id, + service: service, + }; return await this.#client.get( `/nodes/${this.#node}/ceph/cmd-safety`, parameters @@ -15041,19 +15230,22 @@ class PVENodeNodesVzdump { * Enum: 0,1,gzip,lzo,zstd * @param {string} dumpdir Store resulting files to specified directory. * @param {string} exclude Exclude specified guest systems (assumes --all) - * @param {array} exclude_path Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. + * @param {array} exclude_path Exclude certain files/directories (shell globs). Paths starting with '/' are anchored to the container's root, other paths match relative to each subdirectory. + * @param {string} fleecing Options for backup fleecing (VM only). * @param {int} ionice Set IO priority when using the BFQ scheduler. For snapshot and suspend mode backups of VMs, this only affects the compressor. A value of 8 means the idle priority is used, otherwise the best-effort priority is used with the specified value. * @param {int} lockwait Maximal time to wait for the global lock (minutes). - * @param {string} mailnotification Deprecated: use 'notification-policy' instead. + * @param {string} mailnotification Deprecated: use notification targets/matchers instead. Specify when to send a notification mail * Enum: always,failure - * @param {string} mailto Comma-separated list of email addresses or users that should receive email notifications. Has no effect if the 'notification-target' option is set at the same time. + * @param {string} mailto Deprecated: Use notification targets/matchers instead. Comma-separated list of email addresses or users that should receive email notifications. * @param {int} maxfiles Deprecated: use 'prune-backups' instead. Maximal number of backup files per guest system. * @param {string} mode Backup mode. * Enum: snapshot,suspend,stop * @param {string} notes_template Template string for generating notes for the backup(s). It can contain variables which will be replaced by their values. Currently supported are {{cluster}}, {{guestname}}, {{node}}, and {{vmid}}, but more might be added in the future. Needs to be a single line, newline and backslash need to be escaped as '\n' and '\\' respectively. - * @param {string} notification_policy Specify when to send a notification + * @param {string} notification_mode Determine which notification system to use. If set to 'legacy-sendmail', vzdump will consider the mailto/mailnotification parameters and send emails to the specified address(es) via the 'sendmail' command. If set to 'notification-system', a notification will be sent via PVE's notification system, and the mailto and mailnotification will be ignored. If set to 'auto' (default setting), an email will be sent if mailto is set, and the notification system will be used if not. + * Enum: auto,legacy-sendmail,notification-system + * @param {string} notification_policy Deprecated: Do not use * Enum: always,failure,never - * @param {string} notification_target Determine the target to which notifications should be sent. Can either be a notification endpoint or a notification group. This option takes precedence over 'mailto', meaning that if both are set, the 'mailto' option will be ignored. + * @param {string} notification_target Deprecated: Do not use * @param {string} performance Other performance-related settings. * @param {int} pigz Use pigz instead of gzip when N>0. N=1 uses half of cores, N>1 uses N as thread count. * @param {string} pool Backup all known guest systems included in the specified pool. @@ -15069,7 +15261,7 @@ class PVENodeNodesVzdump { * @param {string} storage Store resulting file to this storage. * @param {string} tmpdir Store temporary files to specified directory. * @param {string} vmid The ID of the guest system you want to backup. - * @param {int} zstd Zstd threads. N=0 uses half of the available cores, N>0 uses N as thread count. + * @param {int} zstd Zstd threads. N=0 uses half of the available cores, if N is set to a value bigger than 0, N is used as thread count. * @returns {Promise} */ async vzdump( @@ -15079,6 +15271,7 @@ class PVENodeNodesVzdump { dumpdir, exclude, exclude_path, + fleecing, ionice, lockwait, mailnotification, @@ -15086,6 +15279,7 @@ class PVENodeNodesVzdump { maxfiles, mode, notes_template, + notification_mode, notification_policy, notification_target, performance, @@ -15112,6 +15306,7 @@ class PVENodeNodesVzdump { dumpdir: dumpdir, exclude: exclude, "exclude-path": exclude_path, + fleecing: fleecing, ionice: ionice, lockwait: lockwait, mailnotification: mailnotification, @@ -15119,6 +15314,7 @@ class PVENodeNodesVzdump { maxfiles: maxfiles, mode: mode, "notes-template": notes_template, + "notification-mode": notification_mode, "notification-policy": notification_policy, "notification-target": notification_target, performance: performance, @@ -15932,7 +16128,11 @@ class PVEUpidTasksNodeNodesLog { * @returns {Promise} */ async readTaskLog(download, limit, start) { - const parameters = { download: download, limit: limit, start: start }; + const parameters = { + download: download, + limit: limit, + start: start, + }; return await this.#client.get( `/nodes/${this.#node}/tasks/${this.#upid}/log`, parameters @@ -16761,6 +16961,20 @@ class PVEItemStorageNodeNodesStorage { )) : this.#downloadUrl; } + #importMetadata; + /** + * Get StorageStorageNodeNodesImportMetadata + * @returns {PVEStorageStorageNodeNodesImportMetadata} + */ + get importMetadata() { + return this.#importMetadata == null + ? (this.#importMetadata = new PVEStorageStorageNodeNodesImportMetadata( + this.#client, + this.#node, + this.#storage + )) + : this.#importMetadata; + } /** * @@ -16863,7 +17077,10 @@ class PVEStorageStorageNodeNodesContent { * @returns {Promise} */ async index(content, vmid) { - const parameters = { content: content, vmid: vmid }; + const parameters = { + content: content, + vmid: vmid, + }; return await this.#client.get( `/nodes/${this.#node}/storage/${this.#storage}/content`, parameters @@ -16936,7 +17153,10 @@ class PVEItemContentStorageStorageNodeNodesVolume { * @returns {Promise} */ async copy(target, target_node) { - const parameters = { target: target, target_node: target_node }; + const parameters = { + target: target, + target_node: target_node, + }; return await this.#client.create( `/nodes/${this.#node}/storage/${this.#storage}/content/${this.#volume}`, parameters @@ -16949,7 +17169,10 @@ class PVEItemContentStorageStorageNodeNodesVolume { * @returns {Promise} */ async updateattributes(notes, protected_) { - const parameters = { notes: notes, protected: protected_ }; + const parameters = { + notes: notes, + protected: protected_, + }; return await this.#client.set( `/nodes/${this.#node}/storage/${this.#storage}/content/${this.#volume}`, parameters @@ -17023,7 +17246,10 @@ class PVEFileRestoreStorageStorageNodeNodesList { * @returns {Promise} */ async list(filepath, volume) { - const parameters = { filepath: filepath, volume: volume }; + const parameters = { + filepath: filepath, + volume: volume, + }; return await this.#client.get( `/nodes/${this.#node}/storage/${this.#storage}/file-restore/list`, parameters @@ -17054,7 +17280,11 @@ class PVEFileRestoreStorageStorageNodeNodesDownload { * @returns {Promise} */ async download(filepath, volume, tar) { - const parameters = { filepath: filepath, volume: volume, tar: tar }; + const parameters = { + filepath: filepath, + volume: volume, + tar: tar, + }; return await this.#client.get( `/nodes/${this.#node}/storage/${this.#storage}/file-restore/download`, parameters @@ -17113,7 +17343,11 @@ class PVEStorageStorageNodeNodesRrd { * @returns {Promise} */ async rrd(ds, timeframe, cf) { - const parameters = { ds: ds, timeframe: timeframe, cf: cf }; + const parameters = { + ds: ds, + timeframe: timeframe, + cf: cf, + }; return await this.#client.get( `/nodes/${this.#node}/storage/${this.#storage}/rrd`, parameters @@ -17145,7 +17379,10 @@ class PVEStorageStorageNodeNodesRrddata { * @returns {Promise} */ async rrddata(timeframe, cf) { - const parameters = { timeframe: timeframe, cf: cf }; + const parameters = { + timeframe: timeframe, + cf: cf, + }; return await this.#client.get( `/nodes/${this.#node}/storage/${this.#storage}/rrddata`, parameters @@ -17247,6 +17484,35 @@ class PVEStorageStorageNodeNodesDownloadUrl { } } +/** + * Class PVEStorageStorageNodeNodesImportMetadata + */ +class PVEStorageStorageNodeNodesImportMetadata { + #node; + #storage; + /** @type {PveClient} */ + #client; + + constructor(client, node, storage) { + this.#client = client; + this.#node = node; + this.#storage = storage; + } + + /** + * Get the base parameters for creating a guest which imports data from a foreign importable guest, like an ESXi VM + * @param {string} volume Volume identifier for the guest archive/entry. + * @returns {Promise} + */ + async getImportMetadata(volume) { + const parameters = { volume: volume }; + return await this.#client.get( + `/nodes/${this.#node}/storage/${this.#storage}/import-metadata`, + parameters + ); + } +} + /** * Class PVENodeNodesDisks */ @@ -17392,7 +17658,11 @@ class PVEDisksNodeNodesLvm { * @returns {Promise} */ async create(device, name, add_storage) { - const parameters = { device: device, name: name, add_storage: add_storage }; + const parameters = { + device: device, + name: name, + add_storage: add_storage, + }; return await this.#client.create( `/nodes/${this.#node}/disks/lvm`, parameters @@ -17469,7 +17739,11 @@ class PVEDisksNodeNodesLvmthin { * @returns {Promise} */ async create(device, name, add_storage) { - const parameters = { device: device, name: name, add_storage: add_storage }; + const parameters = { + device: device, + name: name, + add_storage: add_storage, + }; return await this.#client.create( `/nodes/${this.#node}/disks/lvmthin`, parameters @@ -17761,7 +18035,10 @@ class PVEDisksNodeNodesSmart { * @returns {Promise} */ async smart(disk, healthonly) { - const parameters = { disk: disk, healthonly: healthonly }; + const parameters = { + disk: disk, + healthonly: healthonly, + }; return await this.#client.get( `/nodes/${this.#node}/disks/smart`, parameters @@ -17789,7 +18066,10 @@ class PVEDisksNodeNodesInitgpt { * @returns {Promise} */ async initgpt(disk, uuid) { - const parameters = { disk: disk, uuid: uuid }; + const parameters = { + disk: disk, + uuid: uuid, + }; return await this.#client.create( `/nodes/${this.#node}/disks/initgpt`, parameters @@ -17919,7 +18199,10 @@ class PVEAptNodeNodesUpdate { * @returns {Promise} */ async updateDatabase(notify, quiet) { - const parameters = { notify: notify, quiet: quiet }; + const parameters = { + notify: notify, + quiet: quiet, + }; return await this.#client.create( `/nodes/${this.#node}/apt/update`, parameters @@ -17947,7 +18230,10 @@ class PVEAptNodeNodesChangelog { * @returns {Promise} */ async changelog(name, version) { - const parameters = { name: name, version: version }; + const parameters = { + name: name, + version: version, + }; return await this.#client.get( `/nodes/${this.#node}/apt/changelog`, parameters @@ -18002,7 +18288,10 @@ class PVEAptNodeNodesRepositories { * @returns {Promise} */ async addRepository(handle, digest) { - const parameters = { handle: handle, digest: digest }; + const parameters = { + handle: handle, + digest: digest, + }; return await this.#client.set( `/nodes/${this.#node}/apt/repositories`, parameters @@ -18314,6 +18603,7 @@ class PVEFirewallNodeNodesOptions { * @param {int} nf_conntrack_max Maximum number of tracked connections. * @param {int} nf_conntrack_tcp_timeout_established Conntrack established timeout. * @param {int} nf_conntrack_tcp_timeout_syn_recv Conntrack syn recv timeout. + * @param {boolean} nftables Enable nftables based firewall (tech preview) * @param {boolean} nosmurfs Enable SMURFS filter. * @param {boolean} protection_synflood Enable synflood protection * @param {int} protection_synflood_burst Synflood protection rate burst by ip src. @@ -18338,6 +18628,7 @@ class PVEFirewallNodeNodesOptions { nf_conntrack_max, nf_conntrack_tcp_timeout_established, nf_conntrack_tcp_timeout_syn_recv, + nftables, nosmurfs, protection_synflood, protection_synflood_burst, @@ -18360,6 +18651,7 @@ class PVEFirewallNodeNodesOptions { nf_conntrack_tcp_timeout_established: nf_conntrack_tcp_timeout_established, nf_conntrack_tcp_timeout_syn_recv: nf_conntrack_tcp_timeout_syn_recv, + nftables: nftables, nosmurfs: nosmurfs, protection_synflood: protection_synflood, protection_synflood_burst: protection_synflood_burst, @@ -18561,7 +18853,10 @@ class PVEIdReplicationNodeNodesLog { * @returns {Promise} */ async readJobLog(limit, start) { - const parameters = { limit: limit, start: start }; + const parameters = { + limit: limit, + start: start, + }; return await this.#client.get( `/nodes/${this.#node}/replication/${this.#id}/log`, parameters @@ -18839,7 +19134,7 @@ class PVENodeNodesConfig { * @param {string} description Description for the Node. Shown in the web-interface node notes panel. This is saved as comment inside the configuration file. * @param {string} digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. * @param {int} startall_onboot_delay Initial delay in seconds, before starting all the Virtual Guests with on-boot enabled. - * @param {string} wakeonlan MAC address for wake on LAN + * @param {string} wakeonlan Node specific wake on LAN settings. * @returns {Promise} */ async setOptions( @@ -19140,7 +19435,11 @@ class PVENodeNodesRrd { * @returns {Promise} */ async rrd(ds, timeframe, cf) { - const parameters = { ds: ds, timeframe: timeframe, cf: cf }; + const parameters = { + ds: ds, + timeframe: timeframe, + cf: cf, + }; return await this.#client.get(`/nodes/${this.#node}/rrd`, parameters); } } @@ -19167,7 +19466,10 @@ class PVENodeNodesRrddata { * @returns {Promise} */ async rrddata(timeframe, cf) { - const parameters = { timeframe: timeframe, cf: cf }; + const parameters = { + timeframe: timeframe, + cf: cf, + }; return await this.#client.get(`/nodes/${this.#node}/rrddata`, parameters); } } @@ -19256,7 +19558,7 @@ class PVENodeNodesVncshell { /** * Creates a VNC Shell proxy. * @param {string} cmd Run specific command or default to login (requires 'root@pam') - * Enum: ceph_install,login,upgrade + * Enum: upgrade,ceph_install,login * @param {string} cmd_opts Add parameters to a command. Encoded as null terminated strings. * @param {int} height sets the height of the console in pixels. * @param {boolean} websocket use websocket instead of standard vnc. @@ -19294,12 +19596,15 @@ class PVENodeNodesTermproxy { /** * Creates a VNC Shell proxy. * @param {string} cmd Run specific command or default to login (requires 'root@pam') - * Enum: ceph_install,login,upgrade + * Enum: upgrade,ceph_install,login * @param {string} cmd_opts Add parameters to a command. Encoded as null terminated strings. * @returns {Promise} */ async termproxy(cmd, cmd_opts) { - const parameters = { cmd: cmd, "cmd-opts": cmd_opts }; + const parameters = { + cmd: cmd, + "cmd-opts": cmd_opts, + }; return await this.#client.create( `/nodes/${this.#node}/termproxy`, parameters @@ -19327,7 +19632,10 @@ class PVENodeNodesVncwebsocket { * @returns {Promise} */ async vncwebsocket(port, vncticket) { - const parameters = { port: port, vncticket: vncticket }; + const parameters = { + port: port, + vncticket: vncticket, + }; return await this.#client.get( `/nodes/${this.#node}/vncwebsocket`, parameters @@ -19351,13 +19659,17 @@ class PVENodeNodesSpiceshell { /** * Creates a SPICE shell. * @param {string} cmd Run specific command or default to login (requires 'root@pam') - * Enum: ceph_install,login,upgrade + * Enum: upgrade,ceph_install,login * @param {string} cmd_opts Add parameters to a command. Encoded as null terminated strings. * @param {string} proxy SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. As reasonable setting is to use same node you use to connect to the API (This is window.location.hostname for the JS GUI). * @returns {Promise} */ async spiceshell(cmd, cmd_opts, proxy) { - const parameters = { cmd: cmd, "cmd-opts": cmd_opts, proxy: proxy }; + const parameters = { + cmd: cmd, + "cmd-opts": cmd_opts, + proxy: proxy, + }; return await this.#client.create( `/nodes/${this.#node}/spiceshell`, parameters @@ -19394,7 +19706,12 @@ class PVENodeNodesDns { * @returns {Promise} */ async updateDns(search, dns1, dns2, dns3) { - const parameters = { search: search, dns1: dns1, dns2: dns2, dns3: dns3 }; + const parameters = { + search: search, + dns1: dns1, + dns2: dns2, + dns3: dns3, + }; return await this.#client.set(`/nodes/${this.#node}/dns`, parameters); } } @@ -19457,7 +19774,10 @@ class PVENodeNodesAplinfo { * @returns {Promise} */ async aplDownload(storage, template) { - const parameters = { storage: storage, template: template }; + const parameters = { + storage: storage, + template: template, + }; return await this.#client.create( `/nodes/${this.#node}/aplinfo`, parameters @@ -19485,7 +19805,10 @@ class PVENodeNodesQueryUrlMetadata { * @returns {Promise} */ async queryUrlMetadata(url, verify_certificates) { - const parameters = { url: url, "verify-certificates": verify_certificates }; + const parameters = { + url: url, + "verify-certificates": verify_certificates, + }; return await this.#client.get( `/nodes/${this.#node}/query-url-metadata`, parameters @@ -19535,7 +19858,10 @@ class PVENodeNodesStartall { * @returns {Promise} */ async startall(force, vms) { - const parameters = { force: force, vms: vms }; + const parameters = { + force: force, + vms: vms, + }; return await this.#client.create( `/nodes/${this.#node}/startall`, parameters @@ -19564,7 +19890,11 @@ class PVENodeNodesStopall { * @returns {Promise} */ async stopall(force_stop, timeout, vms) { - const parameters = { "force-stop": force_stop, timeout: timeout, vms: vms }; + const parameters = { + "force-stop": force_stop, + timeout: timeout, + vms: vms, + }; return await this.#client.create( `/nodes/${this.#node}/stopall`, parameters @@ -19661,7 +19991,10 @@ class PVENodeNodesHosts { * @returns {Promise} */ async writeEtcHosts(data, digest) { - const parameters = { data: data, digest: digest }; + const parameters = { + data: data, + digest: digest, + }; return await this.#client.create(`/nodes/${this.#node}/hosts`, parameters); } } @@ -19689,7 +20022,7 @@ class PVEStorage { /** * Storage index. * @param {string} type Only list storage of specific type - * Enum: btrfs,cephfs,cifs,dir,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,pbs,rbd,zfs,zfspool + * Enum: btrfs,cephfs,cifs,dir,esxi,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,pbs,rbd,zfs,zfspool * @returns {Promise} */ async index(type) { @@ -19700,7 +20033,7 @@ class PVEStorage { * Create a new storage. * @param {string} storage The storage identifier. * @param {string} type Storage type. - * Enum: btrfs,cephfs,cifs,dir,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,pbs,rbd,zfs,zfspool + * Enum: btrfs,cephfs,cifs,dir,esxi,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,pbs,rbd,zfs,zfspool * @param {string} authsupported Authsupported. * @param {string} base Base volume. This volume is automatically activated. * @param {string} blocksize block size @@ -19734,7 +20067,7 @@ class PVEStorage { * @param {string} mountpoint mount point * @param {string} namespace Namespace. * @param {boolean} nocow Set the NOCOW flag on files. Disables data checksumming and causes data errors to be unrecoverable from while allowing direct I/O. Only use this if data does not need to be any more safe than on a single ext4 formatted disk with no underlying raid system. - * @param {string} nodes List of cluster node names. + * @param {string} nodes List of nodes for which the storage configuration applies. * @param {boolean} nowritecache disable write caching on the target * @param {string} options NFS/CIFS mount options (see 'man nfs' or 'man mount.cifs') * @param {string} password Password for accessing the share/datastore. @@ -19750,7 +20083,8 @@ class PVEStorage { * @param {string} server Server IP or DNS name. * @param {string} server2 Backup volfile server IP or DNS name. * @param {string} share CIFS share. - * @param {boolean} shared Mark storage as shared. + * @param {boolean} shared Indicate that this is a single storage with the same contents on all nodes (or all listed in the 'nodes' option). It will not make the contents of a local storage automatically accessible to other nodes, it just marks an already shared storage as such! + * @param {boolean} skip_cert_verification Disable TLS certificate verification, only enable on fully trusted networks! * @param {string} smbversion SMB protocol version. 'default' if not set, negotiates the highest SMB2+ version supported by both the client and server. * Enum: default,2.0,2.1,3,3.0,3.11 * @param {boolean} sparse use sparse volumes @@ -19817,6 +20151,7 @@ class PVEStorage { server2, share, shared, + skip_cert_verification, smbversion, sparse, subdir, @@ -19880,6 +20215,7 @@ class PVEStorage { server2: server2, share: share, shared: shared, + "skip-cert-verification": skip_cert_verification, smbversion: smbversion, sparse: sparse, subdir: subdir, @@ -19953,7 +20289,7 @@ class PVEItemStorageStorage { * @param {string} mountpoint mount point * @param {string} namespace Namespace. * @param {boolean} nocow Set the NOCOW flag on files. Disables data checksumming and causes data errors to be unrecoverable from while allowing direct I/O. Only use this if data does not need to be any more safe than on a single ext4 formatted disk with no underlying raid system. - * @param {string} nodes List of cluster node names. + * @param {string} nodes List of nodes for which the storage configuration applies. * @param {boolean} nowritecache disable write caching on the target * @param {string} options NFS/CIFS mount options (see 'man nfs' or 'man mount.cifs') * @param {string} password Password for accessing the share/datastore. @@ -19966,7 +20302,8 @@ class PVEItemStorageStorage { * @param {string} saferemove_throughput Wipe throughput (cstream -t parameter value). * @param {string} server Server IP or DNS name. * @param {string} server2 Backup volfile server IP or DNS name. - * @param {boolean} shared Mark storage as shared. + * @param {boolean} shared Indicate that this is a single storage with the same contents on all nodes (or all listed in the 'nodes' option). It will not make the contents of a local storage automatically accessible to other nodes, it just marks an already shared storage as such! + * @param {boolean} skip_cert_verification Disable TLS certificate verification, only enable on fully trusted networks! * @param {string} smbversion SMB protocol version. 'default' if not set, negotiates the highest SMB2+ version supported by both the client and server. * Enum: default,2.0,2.1,3,3.0,3.11 * @param {boolean} sparse use sparse volumes @@ -20021,6 +20358,7 @@ class PVEItemStorageStorage { server, server2, shared, + skip_cert_verification, smbversion, sparse, subdir, @@ -20072,6 +20410,7 @@ class PVEItemStorageStorage { server: server, server2: server2, shared: shared, + "skip-cert-verification": skip_cert_verification, smbversion: smbversion, sparse: sparse, subdir: subdir, @@ -20230,7 +20569,10 @@ class PVEAccessUsers { * @returns {Promise} */ async index(enabled, full) { - const parameters = { enabled: enabled, full: full }; + const parameters = { + enabled: enabled, + full: full, + }; return await this.#client.get(`/access/users`, parameters); } /** @@ -20500,7 +20842,11 @@ class PVEItemTokenUseridUsersAccessTokenid { * @returns {Promise} */ async generateToken(comment, expire, privsep) { - const parameters = { comment: comment, expire: expire, privsep: privsep }; + const parameters = { + comment: comment, + expire: expire, + privsep: privsep, + }; return await this.#client.create( `/access/users/${this.#userid}/token/${this.#tokenid}`, parameters @@ -20514,7 +20860,11 @@ class PVEItemTokenUseridUsersAccessTokenid { * @returns {Promise} */ async updateTokenInfo(comment, expire, privsep) { - const parameters = { comment: comment, expire: expire, privsep: privsep }; + const parameters = { + comment: comment, + expire: expire, + privsep: privsep, + }; return await this.#client.set( `/access/users/${this.#userid}/token/${this.#tokenid}`, parameters @@ -20556,7 +20906,10 @@ class PVEAccessGroups { * @returns {Promise} */ async createGroup(groupid, comment) { - const parameters = { groupid: groupid, comment: comment }; + const parameters = { + groupid: groupid, + comment: comment, + }; return await this.#client.create(`/access/groups`, parameters); } } @@ -20635,7 +20988,10 @@ class PVEAccessRoles { * @returns {Promise} */ async createRole(roleid, privs) { - const parameters = { roleid: roleid, privs: privs }; + const parameters = { + roleid: roleid, + privs: privs, + }; return await this.#client.create(`/access/roles`, parameters); } } @@ -20673,7 +21029,10 @@ class PVEItemRolesAccessRoleid { * @returns {Promise} */ async updateRole(append, privs) { - const parameters = { append: append, privs: privs }; + const parameters = { + append: append, + privs: privs, + }; return await this.#client.set(`/access/roles/${this.#roleid}`, parameters); } } @@ -21136,7 +21495,10 @@ class PVEOpenidAccessAuthUrl { * @returns {Promise} */ async authUrl(realm, redirect_url) { - const parameters = { realm: realm, "redirect-url": redirect_url }; + const parameters = { + realm: realm, + "redirect-url": redirect_url, + }; return await this.#client.create(`/access/openid/auth-url`, parameters); } } @@ -21232,7 +21594,7 @@ class PVEItemTfaAccessUserid { * Enum: totp,u2f,webauthn,recovery,yubico * @param {string} challenge When responding to a u2f challenge: the original challenge string * @param {string} description A description to distinguish multiple entries from one another - * @param {string} password The current password. + * @param {string} password The current password of the user performing the change. * @param {string} totp A totp URI. * @param {string} value The current value for the provided totp URI, or a Webauthn/U2F challenge response * @returns {Promise} @@ -21266,7 +21628,7 @@ class PVEItemUseridTfaAccessId { /** * Delete a TFA entry by ID. - * @param {string} password The current password. + * @param {string} password The current password of the user performing the change. * @returns {Promise} */ async deleteTfa(password) { @@ -21287,7 +21649,7 @@ class PVEItemUseridTfaAccessId { * Add a TFA entry for a user. * @param {string} description A description to distinguish multiple entries from one another * @param {boolean} enable Whether the entry should be enabled for login. - * @param {string} password The current password. + * @param {string} password The current password of the user performing the change. * @returns {Promise} */ async updateTfaEntry(description, enable, password) { @@ -21372,10 +21734,15 @@ class PVEAccessPassword { * Change user password. * @param {string} password The new password. * @param {string} userid Full User ID, in the `name@realm` format. + * @param {string} confirmation_password The current password of the user performing the change. * @returns {Promise} */ - async changePassword(password, userid) { - const parameters = { password: password, userid: userid }; + async changePassword(password, userid, confirmation_password) { + const parameters = { + password: password, + userid: userid, + "confirmation-password": confirmation_password, + }; return await this.#client.set(`/access/password`, parameters); } } @@ -21398,7 +21765,10 @@ class PVEAccessPermissions { * @returns {Promise} */ async permissions(path, userid) { - const parameters = { path: path, userid: userid }; + const parameters = { + path: path, + userid: userid, + }; return await this.#client.get(`/access/permissions`, parameters); } } @@ -21440,7 +21810,10 @@ class PVEPools { * @returns {Promise} */ async index(poolid, type) { - const parameters = { poolid: poolid, type: type }; + const parameters = { + poolid: poolid, + type: type, + }; return await this.#client.get(`/pools`, parameters); } /** @@ -21450,7 +21823,10 @@ class PVEPools { * @returns {Promise} */ async createPool(poolid, comment) { - const parameters = { poolid: poolid, comment: comment }; + const parameters = { + poolid: poolid, + comment: comment, + }; return await this.#client.create(`/pools`, parameters); } /**