mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-07-26 07:58:14 +00:00
feat: add version gating from PVE API history, document version policy
Add RequireVersion calls based on pve_api endpoint-history.json data: - Cloud-Init management: introduced PVE 7.2 - Storage URL download: introduced PVE 7.0 - Backup compliance info: introduced PVE 7.0 - Container interfaces: introduced PVE 8.1 - Pool update/delete: introduced PVE 8.1 Update README with version policy: - PVE 9.x: primary target - PVE 8.x: supported - PVE 7.x (7.0+): best-effort with clear version errors - PVE 6.x and older: hard blocked - Document two-tier gating (introduced vs default) behavior Parameter-level version changes are not gated — the API returns clear errors for unknown parameters, which is acceptable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,17 @@ A production-grade C# binary PowerShell module for managing Proxmox VE environme
|
||||
|---|---|
|
||||
| 9.x (current, 9.1.6+) | **Primary target — fully supported** |
|
||||
| 8.x | Supported |
|
||||
| 7.x | EOL 2024 — **not supported** |
|
||||
| 7.x (7.0+) | **Best-effort** — core cmdlets work, newer features emit clear version errors |
|
||||
| 6.x and older | **Not supported** — hard blocked by version checks |
|
||||
|
||||
### Version Gating Policy
|
||||
|
||||
The module uses a two-tier version check for cmdlets that require newer PVE APIs:
|
||||
|
||||
- **Hard block** (introduced version): The API endpoint doesn't exist — the cmdlet emits a terminating error with a clear message like *"This operation requires Proxmox VE 8.1 or later."*
|
||||
- **Warning** (default version): The feature exists but may not be enabled by default — a warning is emitted but the command proceeds, allowing users who manually enabled the feature to succeed.
|
||||
|
||||
Most cmdlets target endpoints available since PVE 4.2 and require no version check. Cmdlets that need newer APIs include SDN (introduced 6.2, default 8.0+), cloud-init management (7.2+), container interfaces (8.1+), VM disk import (8.1+), and pool management (8.1+ for update/delete).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace PSProxmoxVE.Cmdlets.Backup
|
||||
protected override void ProcessRecord()
|
||||
{
|
||||
var session = GetSession();
|
||||
RequireVersion(session, "Backup compliance info", 7, 0);
|
||||
var service = new BackupService();
|
||||
|
||||
WriteVerbose("Getting guests not covered by backup jobs...");
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace PSProxmoxVE.Cmdlets.CloudInit
|
||||
protected override void ProcessRecord()
|
||||
{
|
||||
var session = GetSession();
|
||||
RequireVersion(session, "Cloud-Init management", 7, 2);
|
||||
using var client = new PveHttpClient(session);
|
||||
|
||||
WriteVerbose($"Getting cloud-init config for VM {VmId}...");
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace PSProxmoxVE.Cmdlets.CloudInit
|
||||
return;
|
||||
|
||||
var session = GetSession();
|
||||
RequireVersion(session, "Cloud-Init management", 7, 2);
|
||||
|
||||
WriteVerbose($"Regenerating cloud-init drive for VM {VmId}...");
|
||||
var service = new CloudInitService();
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace PSProxmoxVE.Cmdlets.CloudInit
|
||||
protected override void ProcessRecord()
|
||||
{
|
||||
var session = GetSession();
|
||||
RequireVersion(session, "Cloud-Init management", 7, 2);
|
||||
|
||||
if (!ShouldProcess($"VM {VmId} on {Node}", "Set PVE Cloud-Init Config"))
|
||||
return;
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace PSProxmoxVE.Cmdlets.Containers
|
||||
protected override void ProcessRecord()
|
||||
{
|
||||
var session = GetSession();
|
||||
RequireVersion(session, "Container interface listing", 8, 1);
|
||||
|
||||
WriteVerbose($"Getting network interfaces for container {VmId}...");
|
||||
var service = new ContainerService();
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace PSProxmoxVE.Cmdlets.Pools
|
||||
return;
|
||||
|
||||
var session = GetSession();
|
||||
RequireVersion(session, "Pool deletion", 8, 1);
|
||||
var service = new PoolService();
|
||||
|
||||
WriteVerbose($"Removing pool '{PoolId}'...");
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace PSProxmoxVE.Cmdlets.Pools
|
||||
return;
|
||||
|
||||
var session = GetSession();
|
||||
RequireVersion(session, "Pool update", 8, 1);
|
||||
var service = new PoolService();
|
||||
|
||||
var config = new Dictionary<string, string>();
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace PSProxmoxVE.Cmdlets.Storage
|
||||
return;
|
||||
|
||||
var session = GetSession();
|
||||
RequireVersion(session, "Storage URL download", 7, 0);
|
||||
using var client = new PveHttpClient(session);
|
||||
|
||||
WriteVerbose($"Downloading '{Url}' to {Node}/{Storage}...");
|
||||
|
||||
Reference in New Issue
Block a user