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:
Clint Branham
2026-03-21 10:15:25 -05:00
parent df4cae01bc
commit 93e005f1a5
9 changed files with 19 additions and 1 deletions
@@ -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}...");