diff --git a/src/PSProxmoxVE.Core/Authentication/PveSession.cs b/src/PSProxmoxVE.Core/Authentication/PveSession.cs index 487d077..3e1d50a 100644 --- a/src/PSProxmoxVE.Core/Authentication/PveSession.cs +++ b/src/PSProxmoxVE.Core/Authentication/PveSession.cs @@ -14,7 +14,7 @@ namespace PSProxmoxVE.Core.Authentication public string? Ticket { get; } public string? CsrfToken { get; } public DateTime TicketExpiry { get; } - public PveVersion ServerVersion { get; internal set; } + public PveVersion? ServerVersion { get; internal set; } /// Returns true if the ticket has expired (only relevant for Ticket auth mode) public bool IsExpired diff --git a/src/PSProxmoxVE.Core/Client/PveHttpClient.cs b/src/PSProxmoxVE.Core/Client/PveHttpClient.cs index c9cf102..721eca2 100644 --- a/src/PSProxmoxVE.Core/Client/PveHttpClient.cs +++ b/src/PSProxmoxVE.Core/Client/PveHttpClient.cs @@ -372,7 +372,7 @@ namespace PSProxmoxVE.Core.Client // Some endpoints return a plain string in "message" var message = json["message"]?.ToString(); if (!string.IsNullOrWhiteSpace(message)) - return message; + return message!; } catch { diff --git a/src/PSProxmoxVE.Core/Services/NetworkService.cs b/src/PSProxmoxVE.Core/Services/NetworkService.cs index eb1c253..e383092 100644 --- a/src/PSProxmoxVE.Core/Services/NetworkService.cs +++ b/src/PSProxmoxVE.Core/Services/NetworkService.cs @@ -23,6 +23,8 @@ namespace PSProxmoxVE.Core.Services /// /// Returns network interface configurations for a node. /// + /// The authenticated PVE session. + /// The cluster node name. /// /// Optional interface type filter (e.g. "bridge", "bond", "eth", "vlan", "alias"). /// @@ -45,6 +47,9 @@ namespace PSProxmoxVE.Core.Services /// Creates a network interface on a node. Changes are pending until /// is called. Returns the new interface config. /// + /// The authenticated PVE session. + /// The cluster node name. + /// Network interface configuration parameters. public PveNetwork CreateNetwork( PveSession session, string node, @@ -68,6 +73,10 @@ namespace PSProxmoxVE.Core.Services /// Updates an existing network interface on a node. Changes are pending until /// is called. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The network interface name. + /// Network interface configuration parameters to update. public void SetNetwork( PveSession session, string node, @@ -91,6 +100,9 @@ namespace PSProxmoxVE.Core.Services /// Removes a network interface from a node. Changes are pending until /// is called. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The network interface name to remove. public void RemoveNetwork(PveSession session, string node, string iface) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -104,6 +116,8 @@ namespace PSProxmoxVE.Core.Services /// /// Applies pending network configuration changes on a node. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. public PveTask ApplyNetworkConfig(PveSession session, string node) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -122,6 +136,7 @@ namespace PSProxmoxVE.Core.Services /// /// Returns all SDN zone definitions. Requires PVE 8.0+. /// + /// The authenticated PVE session. public PveSdnZone[] GetSdnZones(PveSession session) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -136,6 +151,7 @@ namespace PSProxmoxVE.Core.Services /// /// Returns all SDN VNet definitions. Requires PVE 8.0+. /// + /// The authenticated PVE session. public PveSdnVnet[] GetSdnVnets(PveSession session) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -150,6 +166,8 @@ namespace PSProxmoxVE.Core.Services /// /// Creates an SDN zone. Requires PVE 8.0+. /// + /// The authenticated PVE session. + /// SDN zone configuration parameters. public PveSdnZone CreateSdnZone( PveSession session, Dictionary config) @@ -171,6 +189,8 @@ namespace PSProxmoxVE.Core.Services /// /// Removes an SDN zone. Requires PVE 8.0+. /// + /// The authenticated PVE session. + /// The SDN zone identifier to remove. public void RemoveSdnZone(PveSession session, string zone) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -184,6 +204,8 @@ namespace PSProxmoxVE.Core.Services /// /// Creates an SDN VNet. Requires PVE 8.0+. /// + /// The authenticated PVE session. + /// SDN VNet configuration parameters. public PveSdnVnet CreateSdnVnet( PveSession session, Dictionary config) @@ -205,6 +227,8 @@ namespace PSProxmoxVE.Core.Services /// /// Removes an SDN VNet. Requires PVE 8.0+. /// + /// The authenticated PVE session. + /// The SDN VNet identifier to remove. public void RemoveSdnVnet(PveSession session, string vnet) { if (session == null) throw new ArgumentNullException(nameof(session)); diff --git a/src/PSProxmoxVE.Core/Services/SnapshotService.cs b/src/PSProxmoxVE.Core/Services/SnapshotService.cs index 0af377f..e69acd4 100644 --- a/src/PSProxmoxVE.Core/Services/SnapshotService.cs +++ b/src/PSProxmoxVE.Core/Services/SnapshotService.cs @@ -16,6 +16,9 @@ namespace PSProxmoxVE.Core.Services /// /// Returns all snapshots for a VM. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. public PveSnapshot[] GetSnapshots(PveSession session, string node, int vmid) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -31,6 +34,9 @@ namespace PSProxmoxVE.Core.Services /// /// Creates a snapshot of a VM. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. /// Snapshot name (alphanumeric, no spaces). /// Optional description. /// Whether to save VM RAM state (live snapshot). Default false. @@ -63,6 +69,10 @@ namespace PSProxmoxVE.Core.Services /// /// Removes a snapshot from a VM. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. + /// The snapshot name to remove. public PveTask RemoveSnapshot( PveSession session, string node, @@ -82,6 +92,10 @@ namespace PSProxmoxVE.Core.Services /// /// Rolls a VM back to a snapshot. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. + /// The snapshot name to roll back to. public PveTask RollbackSnapshot( PveSession session, string node, diff --git a/src/PSProxmoxVE.Core/Services/StorageService.cs b/src/PSProxmoxVE.Core/Services/StorageService.cs index 0351837..9fd1ec6 100644 --- a/src/PSProxmoxVE.Core/Services/StorageService.cs +++ b/src/PSProxmoxVE.Core/Services/StorageService.cs @@ -22,6 +22,8 @@ namespace PSProxmoxVE.Core.Services /// Returns storage definitions. If is null, returns /// the cluster-wide storage list; otherwise returns storage visible on that node. /// + /// The authenticated PVE session. + /// Optional cluster node name to filter storage by node. public PveStorage[] GetStorages(PveSession session, string? node = null) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -39,6 +41,9 @@ namespace PSProxmoxVE.Core.Services /// /// Returns the contents of a storage volume on a specific node. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The storage identifier. /// /// Optional content type filter (e.g. "iso", "vztmpl", "images", "backup"). /// @@ -69,6 +74,10 @@ namespace PSProxmoxVE.Core.Services /// /// Uploads an ISO (or other file) to a storage on a node. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The storage identifier. + /// Path to the file to upload. /// Optional checksum value. /// Optional checksum algorithm (e.g. "sha256"). /// Optional callback with (bytesSent, totalBytes). @@ -106,6 +115,12 @@ namespace PSProxmoxVE.Core.Services /// /// Downloads a file from a URL directly to a storage on a node. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The storage identifier. + /// The URL to download from. + /// The target filename on the storage. + /// The content type (e.g. "iso", "vztmpl"). public PveTask DownloadUrl( PveSession session, string node, @@ -142,6 +157,8 @@ namespace PSProxmoxVE.Core.Services /// Creates a new storage definition at the cluster level. Returns the task UPID or /// null if the API returns no task (some storage types apply immediately). /// + /// The authenticated PVE session. + /// Storage configuration parameters. public PveStorage CreateStorage(PveSession session, Dictionary config) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -159,6 +176,8 @@ namespace PSProxmoxVE.Core.Services /// /// Removes a cluster-level storage definition. /// + /// The authenticated PVE session. + /// The storage identifier to remove. public void RemoveStorage(PveSession session, string storage) { if (session == null) throw new ArgumentNullException(nameof(session)); diff --git a/src/PSProxmoxVE.Core/Services/TemplateService.cs b/src/PSProxmoxVE.Core/Services/TemplateService.cs index 5919d7a..f7211d9 100644 --- a/src/PSProxmoxVE.Core/Services/TemplateService.cs +++ b/src/PSProxmoxVE.Core/Services/TemplateService.cs @@ -18,6 +18,8 @@ namespace PSProxmoxVE.Core.Services /// /// Returns all VM templates. If is null, searches all cluster nodes. /// + /// The authenticated PVE session. + /// Optional cluster node name to filter templates by node. public PveVm[] GetTemplates(PveSession session, string? node = null) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -29,6 +31,9 @@ namespace PSProxmoxVE.Core.Services /// /// Converts an existing VM into a template. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. /// /// The VM must be stopped and must not already be a template. /// Once converted, this operation cannot be reversed via the API. @@ -47,6 +52,9 @@ namespace PSProxmoxVE.Core.Services /// /// Removes a VM template (delegates to ). /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. /// /// If true, also removes all associated backup files and jobs. /// diff --git a/src/PSProxmoxVE.Core/Services/UserService.cs b/src/PSProxmoxVE.Core/Services/UserService.cs index bdbe957..6368186 100644 --- a/src/PSProxmoxVE.Core/Services/UserService.cs +++ b/src/PSProxmoxVE.Core/Services/UserService.cs @@ -18,6 +18,7 @@ namespace PSProxmoxVE.Core.Services // ------------------------------------------------------------------------- /// Returns all users. + /// The authenticated PVE session. public PveUser[] GetUsers(PveSession session) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -29,6 +30,8 @@ namespace PSProxmoxVE.Core.Services } /// Returns a single user by their user ID (e.g. "admin@pam"). + /// The authenticated PVE session. + /// The user ID in "username@realm" format. public PveUser GetUser(PveSession session, string userId) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -48,6 +51,7 @@ namespace PSProxmoxVE.Core.Services /// /// Creates a new user account. /// + /// The authenticated PVE session. /// User ID in "username@realm" format. /// Additional fields (password, email, firstname, lastname, etc.). public void CreateUser( @@ -70,6 +74,8 @@ namespace PSProxmoxVE.Core.Services } /// Removes a user account. + /// The authenticated PVE session. + /// The user ID in "username@realm" format. public void RemoveUser(PveSession session, string userId) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -81,6 +87,9 @@ namespace PSProxmoxVE.Core.Services } /// Updates one or more properties of an existing user. + /// The authenticated PVE session. + /// The user ID in "username@realm" format. + /// User properties to update. public void SetUser( PveSession session, string userId, @@ -103,6 +112,8 @@ namespace PSProxmoxVE.Core.Services // ------------------------------------------------------------------------- /// Returns all API tokens for the specified user. + /// The authenticated PVE session. + /// The user ID in "username@realm" format. public PveApiToken[] GetApiTokens(PveSession session, string userId) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -122,6 +133,7 @@ namespace PSProxmoxVE.Core.Services /// Creates a new API token for the specified user and returns the token object, /// including the secret Value (shown only once). /// + /// The authenticated PVE session. /// User ID in "username@realm" format. /// Token identifier (alphanumeric and hyphens). /// Optional description. @@ -161,6 +173,9 @@ namespace PSProxmoxVE.Core.Services } /// Removes an API token. + /// The authenticated PVE session. + /// The user ID in "username@realm" format. + /// The token identifier to remove. public void RemoveApiToken(PveSession session, string userId, string tokenId) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -179,6 +194,7 @@ namespace PSProxmoxVE.Core.Services // ------------------------------------------------------------------------- /// Returns all roles. + /// The authenticated PVE session. public PveRole[] GetRoles(PveSession session) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -190,6 +206,7 @@ namespace PSProxmoxVE.Core.Services } /// Creates a new role. + /// The authenticated PVE session. /// Role name. /// Comma-separated list of privilege strings. public void CreateRole(PveSession session, string roleId, string? privileges = null) @@ -206,6 +223,8 @@ namespace PSProxmoxVE.Core.Services } /// Removes a role. + /// The authenticated PVE session. + /// The role name to remove. public void RemoveRole(PveSession session, string roleId) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -223,6 +242,7 @@ namespace PSProxmoxVE.Core.Services /// /// Returns the effective permissions (resolved privilege set) for a user or token. /// + /// The authenticated PVE session. /// Optional user ID to query; defaults to the authenticated user. /// Optional path to restrict the query. public PvePermission[] GetPermissions( @@ -262,6 +282,7 @@ namespace PSProxmoxVE.Core.Services /// /// Sets (adds or updates) an ACL entry. /// + /// The authenticated PVE session. /// Access control path (e.g. "/", "/nodes/pve", "/vms/100"). /// Comma-separated role IDs. /// Comma-separated user IDs. diff --git a/src/PSProxmoxVE.Core/Services/VmService.cs b/src/PSProxmoxVE.Core/Services/VmService.cs index 2b36348..826a203 100644 --- a/src/PSProxmoxVE.Core/Services/VmService.cs +++ b/src/PSProxmoxVE.Core/Services/VmService.cs @@ -23,6 +23,8 @@ namespace PSProxmoxVE.Core.Services /// /// Returns VMs. If is null, queries every cluster node. /// + /// The authenticated PVE session. + /// Optional cluster node name to filter VMs by node. public PveVm[] GetVms(PveSession session, string? node = null) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -62,6 +64,9 @@ namespace PSProxmoxVE.Core.Services /// /// Returns a single VM by its ID on the specified node. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. public PveVm GetVm(PveSession session, string node, int vmid) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -78,6 +83,9 @@ namespace PSProxmoxVE.Core.Services /// /// Returns the full configuration of a VM. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. public PveVmConfig GetVmConfig(PveSession session, string node, int vmid) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -97,6 +105,10 @@ namespace PSProxmoxVE.Core.Services /// /// Updates one or more VM configuration settings. Changes are applied immediately (POST). /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. + /// VM configuration parameters to update. public void SetVmConfig(PveSession session, string node, int vmid, Dictionary config) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -118,6 +130,9 @@ namespace PSProxmoxVE.Core.Services /// /// Creates a new VM. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// VM configuration parameters. public PveTask CreateVm(PveSession session, string node, Dictionary config) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -134,14 +149,24 @@ namespace PSProxmoxVE.Core.Services } /// Starts a VM. Returns the task UPID. + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. public PveTask StartVm(PveSession session, string node, int vmid) => PostStatus(session, node, vmid, "start"); /// Stops a VM (hard power-off). Returns the task UPID. + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. public PveTask StopVm(PveSession session, string node, int vmid) => PostStatus(session, node, vmid, "stop"); /// Gracefully shuts down a VM. Returns the task UPID. + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. + /// Optional shutdown timeout in seconds. public PveTask ShutdownVm(PveSession session, string node, int vmid, int? timeoutSeconds = null) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -158,14 +183,23 @@ namespace PSProxmoxVE.Core.Services } /// Resets a VM (hard reset). Returns the task UPID. + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. public PveTask ResetVm(PveSession session, string node, int vmid) => PostStatus(session, node, vmid, "reset"); /// Suspends a VM (writes RAM state to disk). Returns the task UPID. + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. public PveTask SuspendVm(PveSession session, string node, int vmid) => PostStatus(session, node, vmid, "suspend"); /// Resumes a suspended VM. Returns the task UPID. + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. public PveTask ResumeVm(PveSession session, string node, int vmid) => PostStatus(session, node, vmid, "resume"); @@ -176,6 +210,10 @@ namespace PSProxmoxVE.Core.Services /// /// Removes a VM. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. + /// If true, also removes all associated backup files and jobs. public PveTask RemoveVm(PveSession session, string node, int vmid, bool purge = false) { if (session == null) throw new ArgumentNullException(nameof(session)); @@ -191,6 +229,13 @@ namespace PSProxmoxVE.Core.Services /// /// Clones a VM. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The source VM ID to clone. + /// The VM ID for the new clone. + /// Optional name for the cloned VM. + /// Optional target node for the clone. + /// If true, creates a full clone; otherwise a linked clone. public PveTask CloneVm( PveSession session, string node, @@ -220,6 +265,11 @@ namespace PSProxmoxVE.Core.Services /// /// Migrates a VM to another node. Returns the task UPID. /// + /// The authenticated PVE session. + /// The source cluster node name. + /// The VM ID. + /// The target node to migrate to. + /// If true, performs an online (live) migration. public PveTask MigrateVm( PveSession session, string node, @@ -246,6 +296,9 @@ namespace PSProxmoxVE.Core.Services /// /// Resizes a disk attached to a VM. Returns the task UPID. /// + /// The authenticated PVE session. + /// The cluster node name. + /// The VM ID. /// Disk identifier, e.g. "scsi0" or "virtio0". /// /// New absolute size (e.g. "32G") or relative increase with "+" prefix (e.g. "+10G"). diff --git a/src/PSProxmoxVE/Cmdlets/Vms/CopyPveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/CopyPveVmCmdlet.cs index 4ebc5a2..bd7ed15 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/CopyPveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/CopyPveVmCmdlet.cs @@ -83,7 +83,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, SourceNode, task.Upid, null, null, null); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/MovePveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/MovePveVmCmdlet.cs index 38539f4..a6e8732 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/MovePveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/MovePveVmCmdlet.cs @@ -64,7 +64,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, Node, task.Upid, null, null, null); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/NewPveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/NewPveVmCmdlet.cs index 5f30ab9..77a14d5 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/NewPveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/NewPveVmCmdlet.cs @@ -181,7 +181,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, Node, task.Upid, null, null, null); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/RemovePveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/RemovePveVmCmdlet.cs index bd3813d..1abe7dc 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/RemovePveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/RemovePveVmCmdlet.cs @@ -66,7 +66,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, Node, task.Upid, null, null, null); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/ResetPveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/ResetPveVmCmdlet.cs index 0d9e44e..1f564bd 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/ResetPveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/ResetPveVmCmdlet.cs @@ -50,7 +50,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, Node, task.Upid, null, null, null); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/ResizePveVmDiskCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/ResizePveVmDiskCmdlet.cs index abaec99..78c334a 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/ResizePveVmDiskCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/ResizePveVmDiskCmdlet.cs @@ -68,7 +68,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, Node, task.Upid, null, null, null); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/RestartPveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/RestartPveVmCmdlet.cs index ca33251..b495054 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/RestartPveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/RestartPveVmCmdlet.cs @@ -57,13 +57,13 @@ namespace PSProxmoxVE.Cmdlets.Vms var shutdownTask = vmService.ShutdownVm(session, Node, VmId, Timeout); if (Wait.IsPresent) - taskService.WaitForTask(session, shutdownTask.Node, shutdownTask.Upid, null, null, null); + taskService.WaitForTask(session, Node, shutdownTask.Upid, null, null, null); // Start var startTask = vmService.StartVm(session, Node, VmId); if (Wait.IsPresent) - startTask = taskService.WaitForTask(session, startTask.Node, startTask.Upid, null, null, null); + startTask = taskService.WaitForTask(session, Node, startTask.Upid, null, null, null); WriteObject(startTask); } diff --git a/src/PSProxmoxVE/Cmdlets/Vms/ResumePveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/ResumePveVmCmdlet.cs index 54ba77c..1fd98aa 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/ResumePveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/ResumePveVmCmdlet.cs @@ -48,7 +48,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, Node, task.Upid, null, null, null); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/StartPveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/StartPveVmCmdlet.cs index 9dd632c..d21a446 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/StartPveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/StartPveVmCmdlet.cs @@ -48,7 +48,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, Node, task.Upid, null, null, null); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/StopPveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/StopPveVmCmdlet.cs index f897a97..4d46bb2 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/StopPveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/StopPveVmCmdlet.cs @@ -50,7 +50,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, Node, task.Upid, null, null, null); } WriteObject(task); diff --git a/src/PSProxmoxVE/Cmdlets/Vms/SuspendPveVmCmdlet.cs b/src/PSProxmoxVE/Cmdlets/Vms/SuspendPveVmCmdlet.cs index d89c010..898b6a0 100644 --- a/src/PSProxmoxVE/Cmdlets/Vms/SuspendPveVmCmdlet.cs +++ b/src/PSProxmoxVE/Cmdlets/Vms/SuspendPveVmCmdlet.cs @@ -49,7 +49,7 @@ namespace PSProxmoxVE.Cmdlets.Vms if (Wait.IsPresent) { var taskService = new TaskService(); - task = taskService.WaitForTask(session, task.Node, task.Upid, null, null, null); + task = taskService.WaitForTask(session, Node, task.Upid, null, null, null); } WriteObject(task); diff --git a/tests/PSProxmoxVE.Core.Tests/Authentication/PveAuthenticatorTests.cs b/tests/PSProxmoxVE.Core.Tests/Authentication/PveAuthenticatorTests.cs index 654714d..58c15ae 100644 --- a/tests/PSProxmoxVE.Core.Tests/Authentication/PveAuthenticatorTests.cs +++ b/tests/PSProxmoxVE.Core.Tests/Authentication/PveAuthenticatorTests.cs @@ -56,7 +56,7 @@ namespace PSProxmoxVE.Core.Tests.Authentication [InlineData(null)] [InlineData("")] [InlineData(" ")] - public void ValidateHostname_NullOrEmpty_Throws_ForCredentials(string hostname) + public void ValidateHostname_NullOrEmpty_Throws_ForCredentials(string? hostname) { Assert.Throws(() => PveAuthenticator.AuthenticateWithCredentials(hostname, ValidPort, false, "root@pam", "password")); @@ -66,7 +66,7 @@ namespace PSProxmoxVE.Core.Tests.Authentication [InlineData(null)] [InlineData("")] [InlineData(" ")] - public void ValidateHostname_NullOrEmpty_Throws_ForApiToken(string hostname) + public void ValidateHostname_NullOrEmpty_Throws_ForApiToken(string? hostname) { Assert.Throws(() => PveAuthenticator.AuthenticateWithApiToken(hostname, ValidPort, false, "root@pam!mytoken=uuid")); @@ -76,7 +76,7 @@ namespace PSProxmoxVE.Core.Tests.Authentication [InlineData(null)] [InlineData("")] [InlineData(" ")] - public void ValidateApiToken_NullOrEmpty_Throws(string token) + public void ValidateApiToken_NullOrEmpty_Throws(string? token) { Assert.Throws(() => PveAuthenticator.AuthenticateWithApiToken(ValidHostname, ValidPort, false, token)); diff --git a/tests/PSProxmoxVE.Core.Tests/Authentication/PveVersionTests.cs b/tests/PSProxmoxVE.Core.Tests/Authentication/PveVersionTests.cs index 6e85816..a232cac 100644 --- a/tests/PSProxmoxVE.Core.Tests/Authentication/PveVersionTests.cs +++ b/tests/PSProxmoxVE.Core.Tests/Authentication/PveVersionTests.cs @@ -42,7 +42,7 @@ namespace PSProxmoxVE.Core.Tests.Authentication [InlineData(null)] [InlineData("")] [InlineData(" ")] - public void Parse_NullOrEmpty_Throws(string input) + public void Parse_NullOrEmpty_Throws(string? input) { Assert.Throws(() => PveVersion.Parse(input)); }