diff --git a/src/PSProxmoxVE.Core/Models/Backup/PveBackupJob.cs b/src/PSProxmoxVE.Core/Models/Backup/PveBackupJob.cs index c476e61..4bba724 100644 --- a/src/PSProxmoxVE.Core/Models/Backup/PveBackupJob.cs +++ b/src/PSProxmoxVE.Core/Models/Backup/PveBackupJob.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Backup; @@ -12,119 +11,102 @@ public class PveBackupJob /// /// The backup job identifier. /// - [JsonPropertyName("id")] [JsonProperty("id")] public string Id { get; set; } = string.Empty; /// /// The job type (typically "vzdump"). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } /// /// Whether the job is enabled (1) or disabled (0). /// - [JsonPropertyName("enabled")] [JsonProperty("enabled")] public int? Enabled { get; set; } /// /// The cron-style schedule (e.g. "0 2 * * *"). /// - [JsonPropertyName("schedule")] [JsonProperty("schedule")] public string? Schedule { get; set; } /// /// The target storage for backup files. /// - [JsonPropertyName("storage")] [JsonProperty("storage")] public string? Storage { get; set; } /// /// Backup mode: "snapshot", "suspend", or "stop". /// - [JsonPropertyName("mode")] [JsonProperty("mode")] public string? Mode { get; set; } /// /// Comma-separated list of VM/container IDs to back up, or empty for all. /// - [JsonPropertyName("vmid")] [JsonProperty("vmid")] public string? VmId { get; set; } /// /// Whether to back up all VMs/containers (1 = all). /// - [JsonPropertyName("all")] [JsonProperty("all")] public int? All { get; set; } /// /// Compression algorithm (e.g. "zstd", "lzo", "gzip"). /// - [JsonPropertyName("compress")] [JsonProperty("compress")] public string? Compress { get; set; } /// /// Deprecated — maximum number of backup files to keep. Use prune-backups instead. /// - [JsonPropertyName("maxfiles")] [JsonProperty("maxfiles")] public int? MaxFiles { get; set; } /// /// Retention policy string (e.g. "keep-daily=7,keep-weekly=4"). /// - [JsonPropertyName("prune-backups")] [JsonProperty("prune-backups")] public string? PruneBackups { get; set; } /// /// Template for backup notes. /// - [JsonPropertyName("notes-template")] [JsonProperty("notes-template")] public string? NotesTemplate { get; set; } /// /// Optional comment describing the backup job. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } /// /// Mail notification setting (e.g. "always", "failure"). /// - [JsonPropertyName("mailnotification")] [JsonProperty("mailnotification")] public string? MailNotification { get; set; } /// /// Email address to send notifications to. /// - [JsonPropertyName("mailto")] [JsonProperty("mailto")] public string? MailTo { get; set; } /// /// Specific node to run the backup on (empty = any node). /// - [JsonPropertyName("node")] [JsonProperty("node")] public string? Node { get; set; } /// /// Comma-separated list of excluded VM/container IDs. /// - [JsonPropertyName("exclude")] [JsonProperty("exclude")] public string? Exclude { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Cluster/PveClusterNode.cs b/src/PSProxmoxVE.Core/Models/Cluster/PveClusterNode.cs index ea551d8..a6a2794 100644 --- a/src/PSProxmoxVE.Core/Models/Cluster/PveClusterNode.cs +++ b/src/PSProxmoxVE.Core/Models/Cluster/PveClusterNode.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Cluster; @@ -12,49 +11,42 @@ public class PveClusterNode /// /// The node name (e.g., "pve", "pve2"). /// - [JsonPropertyName("name")] [JsonProperty("name")] public string Name { get; set; } = string.Empty; /// /// Indicates whether this node is currently online (1) or offline (0). /// - [JsonPropertyName("online")] [JsonProperty("online")] public int? Online { get; set; } /// /// Indicates whether this is the local node making the request (1) or a remote node (0). /// - [JsonPropertyName("local")] [JsonProperty("local")] public int? Local { get; set; } /// /// The numeric node ID within the cluster Corosync configuration. /// - [JsonPropertyName("nodeid")] [JsonProperty("nodeid")] public int? NodeId { get; set; } /// /// The IP address used for cluster communication on this node. /// - [JsonPropertyName("ip")] [JsonProperty("ip")] public string? Ip { get; set; } /// /// The cluster membership level of this node (e.g., "c" for configured member). /// - [JsonPropertyName("level")] [JsonProperty("level")] public string? Level { get; set; } /// /// The item type as returned by the cluster status endpoint (always "node" for this model). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Cluster/PveClusterResource.cs b/src/PSProxmoxVE.Core/Models/Cluster/PveClusterResource.cs index b494c66..84d362e 100644 --- a/src/PSProxmoxVE.Core/Models/Cluster/PveClusterResource.cs +++ b/src/PSProxmoxVE.Core/Models/Cluster/PveClusterResource.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Cluster; @@ -12,112 +11,96 @@ public class PveClusterResource /// /// The unique resource identifier (e.g., "node/pve1", "qemu/100", "storage/local"). /// - [JsonPropertyName("id")] [JsonProperty("id")] public string? Id { get; set; } /// /// The resource type: "vm" (QEMU), "lxc" (container), "node", "storage", or "sdn". /// - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } /// /// The current status of the resource (e.g., "running", "stopped", "online"). /// - [JsonPropertyName("status")] [JsonProperty("status")] public string? Status { get; set; } /// /// The display name of the resource. /// - [JsonPropertyName("name")] [JsonProperty("name")] public string? Name { get; set; } /// /// The node on which this resource resides. /// - [JsonPropertyName("node")] [JsonProperty("node")] public string? Node { get; set; } /// /// The pool this resource belongs to, if any. /// - [JsonPropertyName("pool")] [JsonProperty("pool")] public string? Pool { get; set; } /// /// Uptime in seconds. /// - [JsonPropertyName("uptime")] [JsonProperty("uptime")] public long? Uptime { get; set; } /// /// Maximum number of CPUs/cores available to this resource. /// - [JsonPropertyName("maxcpu")] [JsonProperty("maxcpu")] public double? MaxCpu { get; set; } /// /// Current CPU usage as a fraction (0.0 to 1.0). /// - [JsonPropertyName("cpu")] [JsonProperty("cpu")] public double? Cpu { get; set; } /// /// Maximum memory in bytes. /// - [JsonPropertyName("maxmem")] [JsonProperty("maxmem")] public long? MaxMem { get; set; } /// /// Current memory usage in bytes. /// - [JsonPropertyName("mem")] [JsonProperty("mem")] public long? Mem { get; set; } /// /// Maximum disk space in bytes. /// - [JsonPropertyName("maxdisk")] [JsonProperty("maxdisk")] public long? MaxDisk { get; set; } /// /// Current disk usage in bytes. /// - [JsonPropertyName("disk")] [JsonProperty("disk")] public long? Disk { get; set; } /// /// Whether this resource is a template (1) or not (0). Only for VM/LXC types. /// - [JsonPropertyName("template")] [JsonProperty("template")] public int? Template { get; set; } /// /// The VM or container ID. Only for VM/LXC types. /// - [JsonPropertyName("vmid")] [JsonProperty("vmid")] public int? VmId { get; set; } /// /// The HA (High Availability) state of the resource, if managed by HA. /// - [JsonPropertyName("hastate")] [JsonProperty("hastate")] public string? HaState { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Cluster/PveClusterStatus.cs b/src/PSProxmoxVE.Core/Models/Cluster/PveClusterStatus.cs index 1c8bc35..366d69f 100644 --- a/src/PSProxmoxVE.Core/Models/Cluster/PveClusterStatus.cs +++ b/src/PSProxmoxVE.Core/Models/Cluster/PveClusterStatus.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Cluster; @@ -13,21 +12,18 @@ public class PveClusterStatus /// /// The entry type: "cluster" for the cluster-wide record, or "node" for a node record. /// - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } /// /// The name of the cluster (present when Type == "cluster") or the node name (when Type == "node"). /// - [JsonPropertyName("name")] [JsonProperty("name")] public string? Name { get; set; } /// /// The total number of nodes in the cluster. Only present when Type == "cluster". /// - [JsonPropertyName("nodes")] [JsonProperty("nodes")] public int? Nodes { get; set; } @@ -36,14 +32,12 @@ public class PveClusterStatus /// Without quorum, most write operations are blocked to maintain data consistency. /// Only present when Type == "cluster". /// - [JsonPropertyName("quorate")] [JsonProperty("quorate")] public int? Quorate { get; set; } /// /// The cluster configuration version number. Only present when Type == "cluster". /// - [JsonPropertyName("version")] [JsonProperty("version")] public int? Version { get; set; } @@ -51,7 +45,6 @@ public class PveClusterStatus /// The IP address used for cluster communication on this node. /// Only present when Type == "node". /// - [JsonPropertyName("ip")] [JsonProperty("ip")] public string? Ip { get; set; } @@ -59,7 +52,6 @@ public class PveClusterStatus /// Indicates whether this node is currently online (1) or offline (0). /// Only present when Type == "node". /// - [JsonPropertyName("online")] [JsonProperty("online")] public int? Online { get; set; } @@ -67,7 +59,6 @@ public class PveClusterStatus /// Indicates whether this is the local node making the request (1) or a remote node (0). /// Only present when Type == "node". /// - [JsonPropertyName("local")] [JsonProperty("local")] public int? Local { get; set; } @@ -75,7 +66,6 @@ public class PveClusterStatus /// The numeric node ID within the cluster Corosync configuration. /// Only present when Type == "node". /// - [JsonPropertyName("nodeid")] [JsonProperty("nodeid")] public int? NodeId { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Cluster/PvePool.cs b/src/PSProxmoxVE.Core/Models/Cluster/PvePool.cs index d424b7b..6c45837 100644 --- a/src/PSProxmoxVE.Core/Models/Cluster/PvePool.cs +++ b/src/PSProxmoxVE.Core/Models/Cluster/PvePool.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -12,14 +11,12 @@ public class PvePool /// /// The pool identifier. /// - [JsonPropertyName("poolid")] [JsonProperty("poolid")] public string? PoolId { get; set; } /// /// An optional comment or description for the pool. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } @@ -27,7 +24,6 @@ public class PvePool /// The pool members (VMs, containers, storage). Returned as a raw array /// when querying a specific pool. /// - [JsonPropertyName("members")] [JsonProperty("members")] public JArray? Members { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Containers/PveContainer.cs b/src/PSProxmoxVE.Core/Models/Containers/PveContainer.cs index ab84e37..7c5c4ed 100644 --- a/src/PSProxmoxVE.Core/Models/Containers/PveContainer.cs +++ b/src/PSProxmoxVE.Core/Models/Containers/PveContainer.cs @@ -1,5 +1,4 @@ using System; -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Containers; @@ -12,91 +11,78 @@ public class PveContainer /// /// The unique container identifier. /// - [JsonPropertyName("vmid")] [JsonProperty("vmid")] public int VmId { get; set; } /// /// The hostname / display name of the container. /// - [JsonPropertyName("name")] [JsonProperty("name")] public string? Name { get; set; } /// /// The current runtime status of the container (e.g., "running", "stopped"). /// - [JsonPropertyName("status")] [JsonProperty("status")] public string? Status { get; set; } /// /// The node on which the container resides. /// - [JsonPropertyName("node")] [JsonProperty("node")] public string? Node { get; set; } /// /// The number of CPU cores assigned to the container. /// - [JsonPropertyName("cpus")] [JsonProperty("cpus")] public int? CpuCount { get; set; } /// /// Maximum memory allocated to the container, in bytes. /// - [JsonPropertyName("maxmem")] [JsonProperty("maxmem")] public long? MaxMem { get; set; } /// /// Maximum swap space allocated to the container, in bytes. /// - [JsonPropertyName("maxswap")] [JsonProperty("maxswap")] public long? MaxSwap { get; set; } /// /// Root filesystem disk size allocated to the container, in bytes. /// - [JsonPropertyName("maxdisk")] [JsonProperty("maxdisk")] public long? RootFsSize { get; set; } /// /// The OS template type used for this container (e.g., "debian", "ubuntu"). /// - [JsonPropertyName("ostype")] [JsonProperty("ostype")] public string? OsType { get; set; } /// /// Indicates whether the container runs in unprivileged mode (1) or privileged mode (0). /// - [JsonPropertyName("unprivileged")] [JsonProperty("unprivileged")] public int? Unprivileged { get; set; } /// /// The current lock type applied to the container, if any (e.g., "migrate", "backup"). /// - [JsonPropertyName("lock")] [JsonProperty("lock")] public string? Lock { get; set; } /// /// Container uptime in seconds. /// - [JsonPropertyName("uptime")] [JsonProperty("uptime")] public long? Uptime { get; set; } /// /// Semicolon-separated list of tags assigned to the container. /// - [JsonPropertyName("tags")] [JsonProperty("tags")] public string? Tags { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Containers/PveContainerConfig.cs b/src/PSProxmoxVE.Core/Models/Containers/PveContainerConfig.cs index 7461668..8c5e46f 100644 --- a/src/PSProxmoxVE.Core/Models/Containers/PveContainerConfig.cs +++ b/src/PSProxmoxVE.Core/Models/Containers/PveContainerConfig.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Containers; @@ -16,28 +15,24 @@ public class PveContainerConfig /// /// The container hostname. /// - [JsonPropertyName("hostname")] [JsonProperty("hostname")] public string? Hostname { get; set; } /// /// The OS type used for the container (e.g., "debian", "ubuntu", "alpine"). /// - [JsonPropertyName("ostype")] [JsonProperty("ostype")] public string? OsType { get; set; } /// /// Container architecture (e.g., "amd64", "arm64"). /// - [JsonPropertyName("arch")] [JsonProperty("arch")] public string? Arch { get; set; } /// /// Indicates whether the container runs unprivileged (1) or privileged (0). /// - [JsonPropertyName("unprivileged")] [JsonProperty("unprivileged")] public int? Unprivileged { get; set; } @@ -48,28 +43,24 @@ public class PveContainerConfig /// /// Memory limit in megabytes. /// - [JsonPropertyName("memory")] [JsonProperty("memory")] public int? Memory { get; set; } /// /// Swap space limit in megabytes. 0 disables swap. /// - [JsonPropertyName("swap")] [JsonProperty("swap")] public int? Swap { get; set; } /// /// Number of CPU cores allocated to the container. /// - [JsonPropertyName("cores")] [JsonProperty("cores")] public int? Cores { get; set; } /// /// Root filesystem configuration string (e.g., "local-lvm:8"). /// - [JsonPropertyName("rootfs")] [JsonProperty("rootfs")] public string? RootFs { get; set; } @@ -80,35 +71,30 @@ public class PveContainerConfig /// /// Human-readable description or notes for the container. /// - [JsonPropertyName("description")] [JsonProperty("description")] public string? Description { get; set; } /// /// Semicolon-separated list of tags assigned to the container. /// - [JsonPropertyName("tags")] [JsonProperty("tags")] public string? Tags { get; set; } /// /// When set to 1, prevents the container from being deleted or modified accidentally. /// - [JsonPropertyName("protection")] [JsonProperty("protection")] public int? Protection { get; set; } /// /// Startup / shutdown order and delay configuration string. /// - [JsonPropertyName("startup")] [JsonProperty("startup")] public string? Startup { get; set; } /// /// Feature flags for the container (e.g., "nesting=1,keyctl=1"). /// - [JsonPropertyName("features")] [JsonProperty("features")] public string? Features { get; set; } @@ -117,42 +103,34 @@ public class PveContainerConfig // ------------------------------------------------------------------------- /// Network interface 0 configuration string. - [JsonPropertyName("net0")] [JsonProperty("net0")] public string? Net0 { get; set; } /// Network interface 1 configuration string. - [JsonPropertyName("net1")] [JsonProperty("net1")] public string? Net1 { get; set; } /// Network interface 2 configuration string. - [JsonPropertyName("net2")] [JsonProperty("net2")] public string? Net2 { get; set; } /// Network interface 3 configuration string. - [JsonPropertyName("net3")] [JsonProperty("net3")] public string? Net3 { get; set; } /// Network interface 4 configuration string. - [JsonPropertyName("net4")] [JsonProperty("net4")] public string? Net4 { get; set; } /// Network interface 5 configuration string. - [JsonPropertyName("net5")] [JsonProperty("net5")] public string? Net5 { get; set; } /// Network interface 6 configuration string. - [JsonPropertyName("net6")] [JsonProperty("net6")] public string? Net6 { get; set; } /// Network interface 7 configuration string. - [JsonPropertyName("net7")] [JsonProperty("net7")] public string? Net7 { get; set; } @@ -161,42 +139,34 @@ public class PveContainerConfig // ------------------------------------------------------------------------- /// Mount point 0 configuration string (e.g., "local-lvm:10,mp=/data"). - [JsonPropertyName("mp0")] [JsonProperty("mp0")] public string? Mp0 { get; set; } /// Mount point 1 configuration string. - [JsonPropertyName("mp1")] [JsonProperty("mp1")] public string? Mp1 { get; set; } /// Mount point 2 configuration string. - [JsonPropertyName("mp2")] [JsonProperty("mp2")] public string? Mp2 { get; set; } /// Mount point 3 configuration string. - [JsonPropertyName("mp3")] [JsonProperty("mp3")] public string? Mp3 { get; set; } /// Mount point 4 configuration string. - [JsonPropertyName("mp4")] [JsonProperty("mp4")] public string? Mp4 { get; set; } /// Mount point 5 configuration string. - [JsonPropertyName("mp5")] [JsonProperty("mp5")] public string? Mp5 { get; set; } /// Mount point 6 configuration string. - [JsonPropertyName("mp6")] [JsonProperty("mp6")] public string? Mp6 { get; set; } /// Mount point 7 configuration string. - [JsonPropertyName("mp7")] [JsonProperty("mp7")] public string? Mp7 { get; set; } @@ -207,21 +177,18 @@ public class PveContainerConfig /// /// DNS nameserver(s) for the container. /// - [JsonPropertyName("nameserver")] [JsonProperty("nameserver")] public string? Nameserver { get; set; } /// /// DNS search domain for the container. /// - [JsonPropertyName("searchdomain")] [JsonProperty("searchdomain")] public string? Searchdomain { get; set; } /// /// SSH public keys injected into the container's root account. /// - [JsonPropertyName("ssh-public-keys")] [JsonProperty("ssh-public-keys")] public string? SshPublicKeys { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Containers/PveContainerInterface.cs b/src/PSProxmoxVE.Core/Models/Containers/PveContainerInterface.cs index c74329a..f635af3 100644 --- a/src/PSProxmoxVE.Core/Models/Containers/PveContainerInterface.cs +++ b/src/PSProxmoxVE.Core/Models/Containers/PveContainerInterface.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Containers; @@ -9,22 +8,18 @@ namespace PSProxmoxVE.Core.Models.Containers; public class PveContainerInterface { /// The interface name (e.g., "eth0", "lo"). - [JsonPropertyName("name")] [JsonProperty("name")] public string? Name { get; set; } /// The hardware (MAC) address of the interface. - [JsonPropertyName("hwaddr")] [JsonProperty("hwaddr")] public string? HwAddr { get; set; } /// The IPv4 address assigned to this interface. - [JsonPropertyName("inet")] [JsonProperty("inet")] public string? Inet { get; set; } /// The IPv6 address assigned to this interface. - [JsonPropertyName("inet6")] [JsonProperty("inet6")] public string? Inet6 { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallAlias.cs b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallAlias.cs index 9d7e517..bdaacc9 100644 --- a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallAlias.cs +++ b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallAlias.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Firewall; @@ -12,21 +11,18 @@ public class PveFirewallAlias /// /// The alias name. /// - [JsonPropertyName("name")] [JsonProperty("name")] public string Name { get; set; } = string.Empty; /// /// The CIDR network or IP address (e.g. "10.0.0.0/8" or "192.168.1.1"). /// - [JsonPropertyName("cidr")] [JsonProperty("cidr")] public string Cidr { get; set; } = string.Empty; /// /// Optional comment describing the alias. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallGroup.cs b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallGroup.cs index 7414d8f..8396fba 100644 --- a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallGroup.cs +++ b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallGroup.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Firewall; @@ -12,21 +11,18 @@ public class PveFirewallGroup /// /// The security group name. /// - [JsonPropertyName("group")] [JsonProperty("group")] public string Group { get; set; } = string.Empty; /// /// Optional comment describing the group. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } /// /// Configuration digest for detecting concurrent modifications. /// - [JsonPropertyName("digest")] [JsonProperty("digest")] public string? Digest { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallIpSet.cs b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallIpSet.cs index 328eb6f..1b4f25e 100644 --- a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallIpSet.cs +++ b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallIpSet.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Firewall; @@ -12,21 +11,18 @@ public class PveFirewallIpSet /// /// The IP set name. /// - [JsonPropertyName("name")] [JsonProperty("name")] public string Name { get; set; } = string.Empty; /// /// Optional comment describing the IP set. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } /// /// Configuration digest for detecting concurrent modifications. /// - [JsonPropertyName("digest")] [JsonProperty("digest")] public string? Digest { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallIpSetEntry.cs b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallIpSetEntry.cs index 4d58372..20794f1 100644 --- a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallIpSetEntry.cs +++ b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallIpSetEntry.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Firewall; @@ -12,21 +11,18 @@ public class PveFirewallIpSetEntry /// /// The CIDR network or IP address (e.g. "192.168.1.0/24" or "10.0.0.1"). /// - [JsonPropertyName("cidr")] [JsonProperty("cidr")] public string Cidr { get; set; } = string.Empty; /// /// Whether this is an exclusion entry (1 = exclude from set). /// - [JsonPropertyName("nomatch")] [JsonProperty("nomatch")] public int? NoMatch { get; set; } /// /// Optional comment describing the entry. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallOptions.cs b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallOptions.cs index c25623f..6b9156f 100644 --- a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallOptions.cs +++ b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallOptions.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Firewall; @@ -12,70 +11,60 @@ public class PveFirewallOptions /// /// Whether the firewall is enabled (1) or disabled (0). /// - [JsonPropertyName("enable")] [JsonProperty("enable")] public int? Enable { get; set; } /// /// Default policy for incoming traffic (ACCEPT, DROP, REJECT). /// - [JsonPropertyName("policy_in")] [JsonProperty("policy_in")] public string? PolicyIn { get; set; } /// /// Default policy for outgoing traffic (ACCEPT, DROP, REJECT). /// - [JsonPropertyName("policy_out")] [JsonProperty("policy_out")] public string? PolicyOut { get; set; } /// /// Log level for incoming traffic (nolog, emerg, alert, crit, err, warning, notice, info, debug). /// - [JsonPropertyName("log_level_in")] [JsonProperty("log_level_in")] public string? LogLevelIn { get; set; } /// /// Log level for outgoing traffic. /// - [JsonPropertyName("log_level_out")] [JsonProperty("log_level_out")] public string? LogLevelOut { get; set; } /// /// Whether to allow DHCP traffic (VM/container level). /// - [JsonPropertyName("dhcp")] [JsonProperty("dhcp")] public int? Dhcp { get; set; } /// /// Whether to allow NDP (IPv6 Neighbor Discovery Protocol). /// - [JsonPropertyName("ndp")] [JsonProperty("ndp")] public int? Ndp { get; set; } /// /// Whether to allow Router Advertisement. /// - [JsonPropertyName("radv")] [JsonProperty("radv")] public int? Radv { get; set; } /// /// Whether to enable MAC address filter (VM/container level). /// - [JsonPropertyName("macfilter")] [JsonProperty("macfilter")] public int? MacFilter { get; set; } /// /// Whether to enable IP filter (VM/container level). /// - [JsonPropertyName("ipfilter")] [JsonProperty("ipfilter")] public int? IpFilter { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallRef.cs b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallRef.cs index 29491f8..fa78fe3 100644 --- a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallRef.cs +++ b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallRef.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Firewall; @@ -12,21 +11,18 @@ public class PveFirewallRef /// /// The reference type (e.g. "alias", "ipset"). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string Type { get; set; } = string.Empty; /// /// The reference name. /// - [JsonPropertyName("name")] [JsonProperty("name")] public string Name { get; set; } = string.Empty; /// /// Optional comment. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallRule.cs b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallRule.cs index eba503b..4d8a796 100644 --- a/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallRule.cs +++ b/src/PSProxmoxVE.Core/Models/Firewall/PveFirewallRule.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Firewall; @@ -12,91 +11,78 @@ public class PveFirewallRule /// /// Rule position (used for ordering and as identifier for updates/deletes). /// - [JsonPropertyName("pos")] [JsonProperty("pos")] public int? Pos { get; set; } /// /// Rule type: "in", "out", or "group". /// - [JsonPropertyName("type")] [JsonProperty("type")] public string Type { get; set; } = string.Empty; /// /// Action to take: ACCEPT, DROP, or REJECT. /// - [JsonPropertyName("action")] [JsonProperty("action")] public string Action { get; set; } = string.Empty; /// /// Whether the rule is enabled (1) or disabled (0). /// - [JsonPropertyName("enable")] [JsonProperty("enable")] public int? Enable { get; set; } /// /// Source address or alias. /// - [JsonPropertyName("source")] [JsonProperty("source")] public string? Source { get; set; } /// /// Destination address or alias. /// - [JsonPropertyName("dest")] [JsonProperty("dest")] public string? Dest { get; set; } /// /// Protocol (e.g. tcp, udp, icmp). /// - [JsonPropertyName("proto")] [JsonProperty("proto")] public string? Proto { get; set; } /// /// Destination port or port range. /// - [JsonPropertyName("dport")] [JsonProperty("dport")] public string? Dport { get; set; } /// /// Source port or port range. /// - [JsonPropertyName("sport")] [JsonProperty("sport")] public string? Sport { get; set; } /// /// Optional comment describing the rule. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } /// /// Predefined macro name (e.g. "SSH", "HTTP", "DNS"). /// - [JsonPropertyName("macro")] [JsonProperty("macro")] public string? Macro { get; set; } /// /// Log level for matched packets (e.g. "nolog", "info", "warning"). /// - [JsonPropertyName("log")] [JsonProperty("log")] public string? Log { get; set; } /// /// Network interface to match (e.g. "net0"). /// - [JsonPropertyName("iface")] [JsonProperty("iface")] public string? Iface { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Network/PveNetwork.cs b/src/PSProxmoxVE.Core/Models/Network/PveNetwork.cs index 397d41a..97b653c 100644 --- a/src/PSProxmoxVE.Core/Models/Network/PveNetwork.cs +++ b/src/PSProxmoxVE.Core/Models/Network/PveNetwork.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Network; @@ -12,105 +11,90 @@ public class PveNetwork /// /// The interface name (e.g., "vmbr0", "eth0", "bond0"). /// - [JsonPropertyName("iface")] [JsonProperty("iface")] public string Iface { get; set; } = string.Empty; /// /// The interface type (e.g., "bridge", "bond", "eth", "vlan", "OVSBridge"). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } /// /// The IPv4 address assigned to this interface. /// - [JsonPropertyName("address")] [JsonProperty("address")] public string? Address { get; set; } /// /// The IPv4 netmask for this interface. /// - [JsonPropertyName("netmask")] [JsonProperty("netmask")] public string? Netmask { get; set; } /// /// The IPv4 default gateway associated with this interface. /// - [JsonPropertyName("gateway")] [JsonProperty("gateway")] public string? Gateway { get; set; } /// /// Space-separated list of physical ports attached to this bridge. /// - [JsonPropertyName("bridge_ports")] [JsonProperty("bridge_ports")] public string? BridgePorts { get; set; } /// /// Space-separated list of slave interfaces for bond/team interfaces. /// - [JsonPropertyName("slaves")] [JsonProperty("slaves")] public string? BondSlaves { get; set; } /// /// VLAN ID for VLAN sub-interfaces. /// - [JsonPropertyName("vlan-id")] [JsonProperty("vlan-id")] public int? VlanId { get; set; } /// /// The Maximum Transmission Unit in bytes. /// - [JsonPropertyName("mtu")] [JsonProperty("mtu")] public int? Mtu { get; set; } /// /// Indicates whether the interface is brought up automatically at boot (1) or not (0). /// - [JsonPropertyName("autostart")] [JsonProperty("autostart")] public int? Autostart { get; set; } /// /// Indicates whether the interface is currently active/up (1) or down (0). /// - [JsonPropertyName("active")] [JsonProperty("active")] public int? Active { get; set; } /// /// Optional comment or description for this interface. /// - [JsonPropertyName("comments")] [JsonProperty("comments")] public string? Comments { get; set; } /// /// IPv4 address in CIDR notation (e.g., "192.168.1.1/24"). /// - [JsonPropertyName("cidr")] [JsonProperty("cidr")] public string? Cidr { get; set; } /// /// Indicates whether VLAN-aware bridging is enabled on this bridge (1) or not (0). /// - [JsonPropertyName("bridge_vlan_aware")] [JsonProperty("bridge_vlan_aware")] public int? BridgeVlanAware { get; set; } /// /// The bonding mode for bond interfaces (e.g., "active-backup", "802.3ad", "balance-rr"). /// - [JsonPropertyName("bond_mode")] [JsonProperty("bond_mode")] public string? BondMode { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Network/PveSdnController.cs b/src/PSProxmoxVE.Core/Models/Network/PveSdnController.cs index 425dd13..f78d470 100644 --- a/src/PSProxmoxVE.Core/Models/Network/PveSdnController.cs +++ b/src/PSProxmoxVE.Core/Models/Network/PveSdnController.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Network; @@ -12,35 +11,30 @@ public class PveSdnController /// /// The controller identifier. /// - [JsonPropertyName("controller")] [JsonProperty("controller")] public string Controller { get; set; } = string.Empty; /// /// The controller type (e.g. "evpn", "bgp"). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string Type { get; set; } = string.Empty; /// /// The Autonomous System Number for BGP/EVPN. /// - [JsonPropertyName("asn")] [JsonProperty("asn")] public int? Asn { get; set; } /// /// Comma-separated list of BGP peer addresses. /// - [JsonPropertyName("peers")] [JsonProperty("peers")] public string? Peers { get; set; } /// /// The node this controller is configured on. /// - [JsonPropertyName("node")] [JsonProperty("node")] public string? Node { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Network/PveSdnDns.cs b/src/PSProxmoxVE.Core/Models/Network/PveSdnDns.cs index f825d49..07faf2a 100644 --- a/src/PSProxmoxVE.Core/Models/Network/PveSdnDns.cs +++ b/src/PSProxmoxVE.Core/Models/Network/PveSdnDns.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Network; @@ -12,42 +11,36 @@ public class PveSdnDns /// /// The DNS plugin identifier. /// - [JsonPropertyName("dns")] [JsonProperty("dns")] public string Dns { get; set; } = string.Empty; /// /// The DNS plugin type (e.g. "powerdns"). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string Type { get; set; } = string.Empty; /// /// The URL of the DNS service API. /// - [JsonPropertyName("url")] [JsonProperty("url")] public string? Url { get; set; } /// /// The API key for the DNS service. /// - [JsonPropertyName("key")] [JsonProperty("key")] public string? Key { get; set; } /// /// The IPv6 reverse zone mask length. /// - [JsonPropertyName("reversemaskv6")] [JsonProperty("reversemaskv6")] public int? ReverseMaskV6 { get; set; } /// /// The TTL (time-to-live) for DNS records. /// - [JsonPropertyName("ttl")] [JsonProperty("ttl")] public int? Ttl { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Network/PveSdnIpam.cs b/src/PSProxmoxVE.Core/Models/Network/PveSdnIpam.cs index 0c04a7e..f356a16 100644 --- a/src/PSProxmoxVE.Core/Models/Network/PveSdnIpam.cs +++ b/src/PSProxmoxVE.Core/Models/Network/PveSdnIpam.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Network; @@ -12,35 +11,30 @@ public class PveSdnIpam /// /// The IPAM plugin identifier. /// - [JsonPropertyName("ipam")] [JsonProperty("ipam")] public string Ipam { get; set; } = string.Empty; /// /// The IPAM type (e.g. "pve", "netbox", "phpipam"). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string Type { get; set; } = string.Empty; /// /// The URL of the external IPAM service (for netbox/phpipam types). /// - [JsonPropertyName("url")] [JsonProperty("url")] public string? Url { get; set; } /// /// The API token for the external IPAM service. /// - [JsonPropertyName("token")] [JsonProperty("token")] public string? Token { get; set; } /// /// The configuration section identifier. /// - [JsonPropertyName("section")] [JsonProperty("section")] public int? Section { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Network/PveSdnSubnet.cs b/src/PSProxmoxVE.Core/Models/Network/PveSdnSubnet.cs index ee9c3a3..6ecffd9 100644 --- a/src/PSProxmoxVE.Core/Models/Network/PveSdnSubnet.cs +++ b/src/PSProxmoxVE.Core/Models/Network/PveSdnSubnet.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Network; @@ -13,56 +12,48 @@ public class PveSdnSubnet /// /// The subnet CIDR (e.g. "10.0.0.0/24" or "2001:db8::/64"). /// - [JsonPropertyName("subnet")] [JsonProperty("subnet")] public string Subnet { get; set; } = string.Empty; /// /// The VNet this subnet belongs to. /// - [JsonPropertyName("vnet")] [JsonProperty("vnet")] public string? Vnet { get; set; } /// /// The gateway IP address for this subnet. /// - [JsonPropertyName("gateway")] [JsonProperty("gateway")] public string? Gateway { get; set; } /// /// Whether SNAT (source NAT) is enabled for this subnet. /// - [JsonPropertyName("snat")] [JsonProperty("snat")] public int? Snat { get; set; } /// /// The DNS zone name for this subnet. /// - [JsonPropertyName("dnszoneprefix")] [JsonProperty("dnszoneprefix")] public string? DnsZonePrefix { get; set; } /// /// The DHCP range configurations for automatic IP assignment. /// - [JsonPropertyName("dhcp-range")] [JsonProperty("dhcp-range")] public string[]? DhcpRanges { get; set; } /// /// The subnet type identifier used internally by PVE. /// - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } /// /// Optional comment or description. /// - [JsonPropertyName("comments")] [JsonProperty("comments")] public string? Comments { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Network/PveSdnVnet.cs b/src/PSProxmoxVE.Core/Models/Network/PveSdnVnet.cs index f8612e6..32bbdb5 100644 --- a/src/PSProxmoxVE.Core/Models/Network/PveSdnVnet.cs +++ b/src/PSProxmoxVE.Core/Models/Network/PveSdnVnet.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Network; @@ -13,42 +12,36 @@ public class PveSdnVnet /// /// The unique VNet identifier. /// - [JsonPropertyName("vnet")] [JsonProperty("vnet")] public string Vnet { get; set; } = string.Empty; /// /// The SDN zone this VNet belongs to. /// - [JsonPropertyName("zone")] [JsonProperty("zone")] public string? Zone { get; set; } /// /// The VLAN or VXLAN tag associated with this VNet. /// - [JsonPropertyName("tag")] [JsonProperty("tag")] public int? Tag { get; set; } /// /// An optional human-readable alias for this VNet. /// - [JsonPropertyName("alias")] [JsonProperty("alias")] public string? Alias { get; set; } /// /// Indicates whether VLAN-aware mode is enabled on this VNet (1) or not (0). /// - [JsonPropertyName("vlanaware")] [JsonProperty("vlanaware")] public int? VlanAware { get; set; } /// /// Optional comment or description for this SDN VNet. /// - [JsonPropertyName("comments")] [JsonProperty("comments")] public string? Comments { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Network/PveSdnZone.cs b/src/PSProxmoxVE.Core/Models/Network/PveSdnZone.cs index 39813fd..9a2f169 100644 --- a/src/PSProxmoxVE.Core/Models/Network/PveSdnZone.cs +++ b/src/PSProxmoxVE.Core/Models/Network/PveSdnZone.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Network; @@ -13,70 +12,60 @@ public class PveSdnZone /// /// The unique zone identifier. /// - [JsonPropertyName("zone")] [JsonProperty("zone")] public string Zone { get; set; } = string.Empty; /// /// The zone type (e.g., "simple", "vlan", "qinq", "vxlan", "evpn"). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } /// /// The DNS server address associated with this zone. /// - [JsonPropertyName("dns")] [JsonProperty("dns")] public string? Dns { get; set; } /// /// The reverse DNS zone name for this SDN zone. /// - [JsonPropertyName("reversedns")] [JsonProperty("reversedns")] public string? Reversedns { get; set; } /// /// The DNS zone name used for forward lookups. /// - [JsonPropertyName("dnszone")] [JsonProperty("dnszone")] public string? DnsZone { get; set; } /// /// The IPAM plugin to use for IP address management in this zone. /// - [JsonPropertyName("ipam")] [JsonProperty("ipam")] public string? Ipam { get; set; } /// /// The Maximum Transmission Unit in bytes for this zone. /// - [JsonPropertyName("mtu")] [JsonProperty("mtu")] public int? Mtu { get; set; } /// /// Comma-separated list of nodes that participate in this SDN zone. /// - [JsonPropertyName("nodes")] [JsonProperty("nodes")] public string? Nodes { get; set; } /// /// Indicates whether the zone has pending (unapplied) configuration changes (1) or not (0). /// - [JsonPropertyName("pending")] [JsonProperty("pending")] public int? Pending { get; set; } /// /// Optional comment or description for this SDN zone. /// - [JsonPropertyName("comments")] [JsonProperty("comments")] public string? Comments { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Nodes/PveNode.cs b/src/PSProxmoxVE.Core/Models/Nodes/PveNode.cs index d0e67b7..2c06e6a 100644 --- a/src/PSProxmoxVE.Core/Models/Nodes/PveNode.cs +++ b/src/PSProxmoxVE.Core/Models/Nodes/PveNode.cs @@ -1,5 +1,4 @@ using System; -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Nodes; @@ -12,63 +11,54 @@ public class PveNode /// /// The name of the node. /// - [JsonPropertyName("node")] [JsonProperty("node")] public string Name { get; set; } = string.Empty; /// /// The current status of the node (e.g., "online" or "offline"). /// - [JsonPropertyName("status")] [JsonProperty("status")] public string Status { get; set; } = string.Empty; /// /// The total number of CPU cores available on the node. /// - [JsonPropertyName("maxcpu")] [JsonProperty("maxcpu")] public int? CpuCount { get; set; } /// /// Total memory in bytes available on the node. /// - [JsonPropertyName("maxmem")] [JsonProperty("maxmem")] public long? MemoryTotal { get; set; } /// /// Memory currently in use on the node, in bytes. /// - [JsonPropertyName("mem")] [JsonProperty("mem")] public long? MemoryUsed { get; set; } /// /// Node uptime in seconds. /// - [JsonPropertyName("uptime")] [JsonProperty("uptime")] public long? Uptime { get; set; } /// /// The version of Proxmox VE running on the node. /// - [JsonPropertyName("pveversion")] [JsonProperty("pveversion")] public string? PveVersion { get; set; } /// /// The Linux kernel version running on the node. /// - [JsonPropertyName("kversion")] [JsonProperty("kversion")] public string? KernelVersion { get; set; } /// /// The 1-minute, 5-minute, and 15-minute load averages for the node. /// - [JsonPropertyName("loadavg")] [JsonProperty("loadavg")] public double[]? LoadAverage { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Nodes/PveNodeStatus.cs b/src/PSProxmoxVE.Core/Models/Nodes/PveNodeStatus.cs index 4f67d9e..45b0ca4 100644 --- a/src/PSProxmoxVE.Core/Models/Nodes/PveNodeStatus.cs +++ b/src/PSProxmoxVE.Core/Models/Nodes/PveNodeStatus.cs @@ -1,5 +1,4 @@ using System; -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Nodes; @@ -13,91 +12,78 @@ public class PveNodeStatus /// /// The name of the node. /// - [JsonPropertyName("node")] [JsonProperty("node")] public string Node { get; set; } = string.Empty; /// /// The current status of the node (e.g., "online" or "offline"). /// - [JsonPropertyName("status")] [JsonProperty("status")] public string Status { get; set; } = string.Empty; /// /// The total number of CPU cores available on the node. /// - [JsonPropertyName("maxcpu")] [JsonProperty("maxcpu")] public int? CpuCount { get; set; } /// /// Total memory in bytes available on the node. /// - [JsonPropertyName("maxmem")] [JsonProperty("maxmem")] public long? MemoryTotal { get; set; } /// /// Memory currently in use on the node, in bytes. /// - [JsonPropertyName("mem")] [JsonProperty("mem")] public long? MemoryUsed { get; set; } /// /// Node uptime in seconds. /// - [JsonPropertyName("uptime")] [JsonProperty("uptime")] public long? Uptime { get; set; } /// /// The version of Proxmox VE running on the node. /// - [JsonPropertyName("pveversion")] [JsonProperty("pveversion")] public string? PveVersion { get; set; } /// /// The Linux kernel version running on the node. /// - [JsonPropertyName("kversion")] [JsonProperty("kversion")] public string? KernelVersion { get; set; } /// /// The 1-minute, 5-minute, and 15-minute load averages for the node. /// - [JsonPropertyName("loadavg")] [JsonProperty("loadavg")] public double[]? LoadAverage { get; set; } /// /// Total root filesystem size in bytes. /// - [JsonPropertyName("rootfs.total")] [JsonProperty("rootfs.total")] public long? DiskTotal { get; set; } /// /// Used root filesystem space in bytes. /// - [JsonPropertyName("rootfs.used")] [JsonProperty("rootfs.used")] public long? DiskUsed { get; set; } /// /// Current CPU utilization as a fraction between 0.0 and 1.0. /// - [JsonPropertyName("cpu")] [JsonProperty("cpu")] public double? CpuUsage { get; set; } /// /// Memory utilization as a percentage (0–100), computed from MemoryUsed / MemoryTotal. /// - [System.Text.Json.Serialization.JsonIgnore] [Newtonsoft.Json.JsonIgnore] public double? MemoryUsage => MemoryTotal.HasValue && MemoryTotal.Value > 0 && MemoryUsed.HasValue @@ -107,28 +93,24 @@ public class PveNodeStatus /// /// Total swap space in bytes. /// - [JsonPropertyName("swap.total")] [JsonProperty("swap.total")] public long? SwapTotal { get; set; } /// /// Used swap space in bytes. /// - [JsonPropertyName("swap.used")] [JsonProperty("swap.used")] public long? SwapUsed { get; set; } /// /// Total bytes received over the network since boot. /// - [JsonPropertyName("netin")] [JsonProperty("netin")] public long? NetworkIn { get; set; } /// /// Total bytes transmitted over the network since boot. /// - [JsonPropertyName("netout")] [JsonProperty("netout")] public long? NetworkOut { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Storage/PveStorage.cs b/src/PSProxmoxVE.Core/Models/Storage/PveStorage.cs index 32ae490..0127dca 100644 --- a/src/PSProxmoxVE.Core/Models/Storage/PveStorage.cs +++ b/src/PSProxmoxVE.Core/Models/Storage/PveStorage.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Storage; @@ -11,14 +10,12 @@ public class PveStorage /// /// The unique identifier / name of the storage pool. /// - [JsonPropertyName("storage")] [JsonProperty("storage")] public string Storage { get; set; } = string.Empty; /// /// The storage backend type (e.g., "dir", "lvm", "zfspool", "nfs", "cifs", "rbd"). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } @@ -26,49 +23,42 @@ public class PveStorage /// Comma-separated list of content types this storage supports /// (e.g., "images,rootdir,backup,snippets,iso,vztmpl"). /// - [JsonPropertyName("content")] [JsonProperty("content")] public string? Content { get; set; } /// /// Total capacity of the storage pool, in bytes. /// - [JsonPropertyName("total")] [JsonProperty("total")] public long? Total { get; set; } /// /// Used capacity of the storage pool, in bytes. /// - [JsonPropertyName("used")] [JsonProperty("used")] public long? Used { get; set; } /// /// Available (free) capacity of the storage pool, in bytes. /// - [JsonPropertyName("avail")] [JsonProperty("avail")] public long? Available { get; set; } /// /// Indicates whether the storage is enabled (1) or disabled (0) in the configuration. /// - [JsonPropertyName("enabled")] [JsonProperty("enabled")] public int? Enabled { get; set; } /// /// Indicates whether the storage is shared across all cluster nodes (1) or node-local (0). /// - [JsonPropertyName("shared")] [JsonProperty("shared")] public int? Shared { get; set; } /// /// Indicates whether the storage is currently active and reachable (1) or not (0). /// - [JsonPropertyName("active")] [JsonProperty("active")] public int? Active { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Storage/PveStorageContent.cs b/src/PSProxmoxVE.Core/Models/Storage/PveStorageContent.cs index b56a982..611ace3 100644 --- a/src/PSProxmoxVE.Core/Models/Storage/PveStorageContent.cs +++ b/src/PSProxmoxVE.Core/Models/Storage/PveStorageContent.cs @@ -1,5 +1,4 @@ using System; -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Storage; @@ -15,56 +14,48 @@ public class PveStorageContent /// The full volume identifier in the form "storage:volumename" /// (e.g., "local-lvm:vm-100-disk-0"). /// - [JsonPropertyName("volid")] [JsonProperty("volid")] public string VolId { get; set; } = string.Empty; /// /// The content type of this volume (e.g., "images", "backup", "iso", "vztmpl", "rootdir"). /// - [JsonPropertyName("content")] [JsonProperty("content")] public string? Content { get; set; } /// /// The disk image format (e.g., "raw", "qcow2", "vmdk", "subvol"). /// - [JsonPropertyName("format")] [JsonProperty("format")] public string? Format { get; set; } /// /// The size of the volume in bytes. /// - [JsonPropertyName("size")] [JsonProperty("size")] public long? Size { get; set; } /// /// Unix timestamp of when the volume was created. /// - [JsonPropertyName("ctime")] [JsonProperty("ctime")] public long? CreationTime { get; set; } /// /// The VM or container ID that owns this volume, if applicable (e.g., for disk images and backups). /// - [JsonPropertyName("vmid")] [JsonProperty("vmid")] public int? VmId { get; set; } /// /// Optional notes or description attached to the volume (commonly used on backup files). /// - [JsonPropertyName("notes")] [JsonProperty("notes")] public string? Notes { get; set; } /// /// Verification status of the volume, if applicable (e.g., for backups verified with vzdump). /// - [JsonPropertyName("verification")] [JsonProperty("verification")] public string? Verification { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Storage/PveStorageStatus.cs b/src/PSProxmoxVE.Core/Models/Storage/PveStorageStatus.cs index 13f1b61..2d1cf94 100644 --- a/src/PSProxmoxVE.Core/Models/Storage/PveStorageStatus.cs +++ b/src/PSProxmoxVE.Core/Models/Storage/PveStorageStatus.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Storage; @@ -10,42 +9,34 @@ namespace PSProxmoxVE.Core.Models.Storage; public class PveStorageStatus { /// Total capacity in bytes. - [JsonPropertyName("total")] [JsonProperty("total")] public long? Total { get; set; } /// Used capacity in bytes. - [JsonPropertyName("used")] [JsonProperty("used")] public long? Used { get; set; } /// Available (free) capacity in bytes. - [JsonPropertyName("avail")] [JsonProperty("avail")] public long? Available { get; set; } /// Whether the storage is currently active (1) or not (0). - [JsonPropertyName("active")] [JsonProperty("active")] public int? Active { get; set; } /// Comma-separated list of supported content types. - [JsonPropertyName("content")] [JsonProperty("content")] public string? Content { get; set; } /// Whether the storage is enabled (1) or disabled (0). - [JsonPropertyName("enabled")] [JsonProperty("enabled")] public int? Enabled { get; set; } /// Whether the storage is shared across cluster nodes (1) or node-local (0). - [JsonPropertyName("shared")] [JsonProperty("shared")] public int? Shared { get; set; } /// The storage backend type. - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Users/PveApiToken.cs b/src/PSProxmoxVE.Core/Models/Users/PveApiToken.cs index f526436..44a0c8e 100644 --- a/src/PSProxmoxVE.Core/Models/Users/PveApiToken.cs +++ b/src/PSProxmoxVE.Core/Models/Users/PveApiToken.cs @@ -1,5 +1,4 @@ using System; -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Users; @@ -13,14 +12,12 @@ public class PveApiToken /// The user ID that owns this token (e.g., "admin@pam"). /// Not returned by the API — populated by the cmdlet from the request path. /// - [JsonPropertyName("userid")] [JsonProperty("userid")] public string UserId { get; set; } = string.Empty; /// /// The token identifier (the part after "!"), e.g., "automation". /// - [JsonPropertyName("tokenid")] [JsonProperty("tokenid")] public string TokenId { get; set; } = string.Empty; @@ -28,7 +25,6 @@ public class PveApiToken /// The full token identifier in "user@realm!tokenid" format, e.g., "admin@pam!automation". /// Only populated by New-PveApiToken; not returned by the list/get endpoints. /// - [JsonPropertyName("full-tokenid")] [JsonProperty("full-tokenid")] public string? FullTokenId { get; set; } @@ -36,21 +32,18 @@ public class PveApiToken /// The token secret UUID. Only present on creation — store it immediately, /// as it cannot be retrieved again. /// - [JsonPropertyName("value")] [JsonProperty("value")] public string? Value { get; set; } /// /// Optional comment or description for this token. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } /// /// Token expiry as a Unix timestamp. 0 or null means the token never expires. /// - [JsonPropertyName("expire")] [JsonProperty("expire")] public long? Expire { get; set; } @@ -59,7 +52,6 @@ public class PveApiToken /// When enabled, the token's permissions are the intersection of the user's ACLs and /// any explicit ACLs granted to the token itself. /// - [JsonPropertyName("privsep")] [JsonProperty("privsep")] public int? PrivilegeSeparation { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Users/PveDomain.cs b/src/PSProxmoxVE.Core/Models/Users/PveDomain.cs index b8f1226..b450cd8 100644 --- a/src/PSProxmoxVE.Core/Models/Users/PveDomain.cs +++ b/src/PSProxmoxVE.Core/Models/Users/PveDomain.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Users; @@ -9,27 +8,22 @@ namespace PSProxmoxVE.Core.Models.Users; public class PveDomain { /// The realm identifier (e.g., "pam", "pve", "myldap"). - [JsonPropertyName("realm")] [JsonProperty("realm")] public string Realm { get; set; } = string.Empty; /// The domain type (e.g., "pam", "pve", "ad", "ldap", "openid"). - [JsonPropertyName("type")] [JsonProperty("type")] public string Type { get; set; } = string.Empty; /// Optional comment/description for the domain. - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } /// Whether this is the default realm (1) or not (0). - [JsonPropertyName("default")] [JsonProperty("default")] public int? Default { get; set; } /// TFA configuration string, if any. - [JsonPropertyName("tfa")] [JsonProperty("tfa")] public string? Tfa { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Users/PveGroup.cs b/src/PSProxmoxVE.Core/Models/Users/PveGroup.cs index 4b0d26d..0cd0d67 100644 --- a/src/PSProxmoxVE.Core/Models/Users/PveGroup.cs +++ b/src/PSProxmoxVE.Core/Models/Users/PveGroup.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Users; @@ -9,22 +8,18 @@ namespace PSProxmoxVE.Core.Models.Users; public class PveGroup { /// The unique group identifier. - [JsonPropertyName("groupid")] [JsonProperty("groupid")] public string GroupId { get; set; } = string.Empty; /// Optional comment/description for the group. - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } /// Comma-separated list of user IDs that belong to this group. - [JsonPropertyName("users")] [JsonProperty("users")] public string? Users { get; set; } /// Array of member user IDs. Populated when available. - [JsonPropertyName("members")] [JsonProperty("members")] public string[]? Members { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Users/PvePermission.cs b/src/PSProxmoxVE.Core/Models/Users/PvePermission.cs index b14b397..d619097 100644 --- a/src/PSProxmoxVE.Core/Models/Users/PvePermission.cs +++ b/src/PSProxmoxVE.Core/Models/Users/PvePermission.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Users; @@ -12,21 +11,18 @@ public class PvePermission /// /// The resource path this ACL entry applies to (e.g., "/", "/nodes/pve", "/vms/100"). /// - [JsonPropertyName("path")] [JsonProperty("path")] public string? Path { get; set; } /// /// The role ID granted by this ACL entry (e.g., "Administrator", "PVEVMAdmin"). /// - [JsonPropertyName("roleid")] [JsonProperty("roleid")] public string? RoleId { get; set; } /// /// Indicates whether the permission propagates to sub-paths (1) or is restricted to the exact path (0). /// - [JsonPropertyName("propagate")] [JsonProperty("propagate")] public int? Propagate { get; set; } @@ -34,7 +30,6 @@ public class PvePermission /// The user ID or group ID (with "@" prefix for groups) that this ACL entry applies to. /// Maps to the "ugid" JSON field. /// - [JsonPropertyName("ugid")] [JsonProperty("ugid")] public string? UserId { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Users/PveRole.cs b/src/PSProxmoxVE.Core/Models/Users/PveRole.cs index 49a23b7..a044669 100644 --- a/src/PSProxmoxVE.Core/Models/Users/PveRole.cs +++ b/src/PSProxmoxVE.Core/Models/Users/PveRole.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Users; @@ -12,7 +11,6 @@ public class PveRole /// /// The unique role identifier (e.g., "Administrator", "PVEVMAdmin", "PVEDatastoreUser"). /// - [JsonPropertyName("roleid")] [JsonProperty("roleid")] public string RoleId { get; set; } = string.Empty; @@ -20,7 +18,6 @@ public class PveRole /// Comma-separated list of privilege strings assigned to this role /// (e.g., "VM.Allocate,VM.Config.Disk,Datastore.AllocateSpace"). /// - [JsonPropertyName("privs")] [JsonProperty("privs")] public string? Privileges { get; set; } @@ -28,7 +25,6 @@ public class PveRole /// Indicates whether this is a built-in / special role (1) that cannot be deleted, /// or a custom role (0). /// - [JsonPropertyName("special")] [JsonProperty("special")] public int? Special { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Users/PveUser.cs b/src/PSProxmoxVE.Core/Models/Users/PveUser.cs index f1ca079..5e2e711 100644 --- a/src/PSProxmoxVE.Core/Models/Users/PveUser.cs +++ b/src/PSProxmoxVE.Core/Models/Users/PveUser.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Users; @@ -13,63 +12,54 @@ public class PveUser /// /// The full user ID in the format "username@realm" (e.g., "admin@pam", "user@pve"). /// - [JsonPropertyName("userid")] [JsonProperty("userid")] public string UserId { get; set; } = string.Empty; /// /// The user's first name. /// - [JsonPropertyName("firstname")] [JsonProperty("firstname")] public string? FirstName { get; set; } /// /// The user's last name. /// - [JsonPropertyName("lastname")] [JsonProperty("lastname")] public string? LastName { get; set; } /// /// The user's email address. /// - [JsonPropertyName("email")] [JsonProperty("email")] public string? Email { get; set; } /// /// Indicates whether the user account is enabled (1) or disabled (0). /// - [JsonPropertyName("enable")] [JsonProperty("enable")] public int? Enabled { get; set; } /// /// The authentication realm for this user (e.g., "pam", "pve", "ldap"). /// - [JsonPropertyName("realm")] [JsonProperty("realm")] public string? Realm { get; set; } /// /// Comma-separated list of groups this user is a member of. /// - [JsonPropertyName("groups")] [JsonProperty("groups")] public string? Groups { get; set; } /// /// Optional comment or description for this user account. /// - [JsonPropertyName("comment")] [JsonProperty("comment")] public string? Comment { get; set; } /// /// Account expiry as a Unix timestamp. 0 or null means the account never expires. /// - [JsonPropertyName("expire")] [JsonProperty("expire")] public long? Expire { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Vms/PveGuestFsInfo.cs b/src/PSProxmoxVE.Core/Models/Vms/PveGuestFsInfo.cs index 08f6951..e8fdbd4 100644 --- a/src/PSProxmoxVE.Core/Models/Vms/PveGuestFsInfo.cs +++ b/src/PSProxmoxVE.Core/Models/Vms/PveGuestFsInfo.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Vms; @@ -9,32 +8,26 @@ namespace PSProxmoxVE.Core.Models.Vms; public class PveGuestFsInfo { /// The filesystem name/device. - [JsonPropertyName("name")] [JsonProperty("name")] public string? Name { get; set; } /// The mount point path. - [JsonPropertyName("mountpoint")] [JsonProperty("mountpoint")] public string? MountPoint { get; set; } /// The filesystem type (e.g., "ext4", "ntfs"). - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } /// Total size of the filesystem in bytes. - [JsonPropertyName("total-bytes")] [JsonProperty("total-bytes")] public long? TotalBytes { get; set; } /// Used space on the filesystem in bytes. - [JsonPropertyName("used-bytes")] [JsonProperty("used-bytes")] public long? UsedBytes { get; set; } /// List of disk devices backing this filesystem. - [JsonPropertyName("disk")] [JsonProperty("disk")] public string[]? DiskList { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Vms/PveGuestIpAddress.cs b/src/PSProxmoxVE.Core/Models/Vms/PveGuestIpAddress.cs index be0fc64..45bdcc2 100644 --- a/src/PSProxmoxVE.Core/Models/Vms/PveGuestIpAddress.cs +++ b/src/PSProxmoxVE.Core/Models/Vms/PveGuestIpAddress.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Vms; @@ -9,17 +8,14 @@ namespace PSProxmoxVE.Core.Models.Vms; public class PveGuestIpAddress { /// The IP address string (e.g., "192.168.1.100" or "fe80::1"). - [JsonPropertyName("ip-address")] [JsonProperty("ip-address")] public string Address { get; set; } = string.Empty; /// The address type: "ipv4" or "ipv6". - [JsonPropertyName("ip-address-type")] [JsonProperty("ip-address-type")] public string Type { get; set; } = string.Empty; /// The network prefix length (e.g., 24 for a /24 subnet). - [JsonPropertyName("prefix")] [JsonProperty("prefix")] public int Prefix { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Vms/PveGuestNetworkInterface.cs b/src/PSProxmoxVE.Core/Models/Vms/PveGuestNetworkInterface.cs index 4060885..7aea71d 100644 --- a/src/PSProxmoxVE.Core/Models/Vms/PveGuestNetworkInterface.cs +++ b/src/PSProxmoxVE.Core/Models/Vms/PveGuestNetworkInterface.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Vms; @@ -9,17 +8,14 @@ namespace PSProxmoxVE.Core.Models.Vms; public class PveGuestNetworkInterface { /// The interface name (e.g., "eth0", "ens18", "lo"). - [JsonPropertyName("name")] [JsonProperty("name")] public string Name { get; set; } = string.Empty; /// The hardware (MAC) address of the interface. - [JsonPropertyName("hardware-address")] [JsonProperty("hardware-address")] public string? HardwareAddress { get; set; } /// The IP addresses assigned to this interface. - [JsonPropertyName("ip-addresses")] [JsonProperty("ip-addresses")] public PveGuestIpAddress[] IpAddresses { get; set; } = System.Array.Empty(); diff --git a/src/PSProxmoxVE.Core/Models/Vms/PveGuestOsInfo.cs b/src/PSProxmoxVE.Core/Models/Vms/PveGuestOsInfo.cs index 646b7cb..009c03c 100644 --- a/src/PSProxmoxVE.Core/Models/Vms/PveGuestOsInfo.cs +++ b/src/PSProxmoxVE.Core/Models/Vms/PveGuestOsInfo.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Vms; @@ -9,32 +8,26 @@ namespace PSProxmoxVE.Core.Models.Vms; public class PveGuestOsInfo { /// The OS identifier (e.g., "mswindows", "linux"). - [JsonPropertyName("id")] [JsonProperty("id")] public string? Id { get; set; } /// The OS name (e.g., "Microsoft Windows 10 Enterprise"). - [JsonPropertyName("name")] [JsonProperty("name")] public string? Name { get; set; } /// The kernel release string. - [JsonPropertyName("kernel-release")] [JsonProperty("kernel-release")] public string? KernelRelease { get; set; } /// The kernel version string. - [JsonPropertyName("kernel-version")] [JsonProperty("kernel-version")] public string? KernelVersion { get; set; } /// The machine hardware name. - [JsonPropertyName("machine")] [JsonProperty("machine")] public string? Machine { get; set; } /// The OS version details. - [JsonPropertyName("version")] [JsonProperty("version")] public PveGuestOsVersion? Version { get; set; } @@ -52,17 +45,14 @@ public class PveGuestOsInfo public class PveGuestOsVersion { /// The version identifier string. - [JsonPropertyName("id")] [JsonProperty("id")] public string? Id { get; set; } /// The major version number. - [JsonPropertyName("major")] [JsonProperty("major")] public int? Major { get; set; } /// The minor version number. - [JsonPropertyName("minor")] [JsonProperty("minor")] public int? Minor { get; set; } } diff --git a/src/PSProxmoxVE.Core/Models/Vms/PveSnapshot.cs b/src/PSProxmoxVE.Core/Models/Vms/PveSnapshot.cs index af17441..55afcac 100644 --- a/src/PSProxmoxVE.Core/Models/Vms/PveSnapshot.cs +++ b/src/PSProxmoxVE.Core/Models/Vms/PveSnapshot.cs @@ -1,5 +1,4 @@ using System; -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Vms; @@ -12,35 +11,30 @@ public class PveSnapshot /// /// The snapshot name / identifier. /// - [JsonPropertyName("name")] [JsonProperty("name")] public string Name { get; set; } = string.Empty; /// /// Optional human-readable description of what this snapshot captures. /// - [JsonPropertyName("description")] [JsonProperty("description")] public string? Description { get; set; } /// /// Unix timestamp when the snapshot was created. /// - [JsonPropertyName("snaptime")] [JsonProperty("snaptime")] public long? SnapTime { get; set; } /// /// Indicates whether the VM RAM state was saved with this snapshot (1) or not (0). /// - [JsonPropertyName("vmstate")] [JsonProperty("vmstate")] public int? VmState { get; set; } /// /// The name of the parent snapshot, or null if this is the root snapshot. /// - [JsonPropertyName("parent")] [JsonProperty("parent")] public string? Parent { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Vms/PveTask.cs b/src/PSProxmoxVE.Core/Models/Vms/PveTask.cs index 617c2cb..33e5e33 100644 --- a/src/PSProxmoxVE.Core/Models/Vms/PveTask.cs +++ b/src/PSProxmoxVE.Core/Models/Vms/PveTask.cs @@ -1,5 +1,4 @@ using System; -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Vms; @@ -15,70 +14,60 @@ public class PveTask /// The Unique Process Identifier for this task /// (e.g., "UPID:pve:000ABC:00000001:5F1234AB:qmstart:100:root@pam:"). /// - [JsonPropertyName("upid")] [JsonProperty("upid")] public string Upid { get; set; } = string.Empty; /// /// The task type string (e.g., "qmstart", "qmstop", "qmmigrate", "vzrestore"). /// - [JsonPropertyName("type")] [JsonProperty("type")] public string? Type { get; set; } /// /// The current task status: "running" while in progress, "stopped" when complete. /// - [JsonPropertyName("status")] [JsonProperty("status")] public string? Status { get; set; } /// /// The exit status when the task has stopped (e.g., "OK" on success, or an error message). /// - [JsonPropertyName("exitstatus")] [JsonProperty("exitstatus")] public string? ExitStatus { get; set; } /// /// The node on which this task is executing. /// - [JsonPropertyName("node")] [JsonProperty("node")] public string? Node { get; set; } /// /// Unix timestamp of when the task started. /// - [JsonPropertyName("starttime")] [JsonProperty("starttime")] public long? StartTime { get; set; } /// /// Unix timestamp of when the task ended. Null if still running. /// - [JsonPropertyName("endtime")] [JsonProperty("endtime")] public long? EndTime { get; set; } /// /// The user that initiated the task (e.g., "root@pam"). /// - [JsonPropertyName("user")] [JsonProperty("user")] public string? User { get; set; } /// /// The object ID the task is operating on (e.g., a VM ID or storage name). /// - [JsonPropertyName("id")] [JsonProperty("id")] public string? Id { get; set; } /// /// Returns true when the task completed successfully (stopped with exit status "OK"). /// - [System.Text.Json.Serialization.JsonIgnore] [Newtonsoft.Json.JsonIgnore] public bool IsSuccessful => Status == "stopped" && ExitStatus == "OK"; diff --git a/src/PSProxmoxVE.Core/Models/Vms/PveVm.cs b/src/PSProxmoxVE.Core/Models/Vms/PveVm.cs index dd8df0e..33bea52 100644 --- a/src/PSProxmoxVE.Core/Models/Vms/PveVm.cs +++ b/src/PSProxmoxVE.Core/Models/Vms/PveVm.cs @@ -1,5 +1,4 @@ using System; -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Vms; @@ -12,14 +11,12 @@ public class PveVm /// /// The unique VM identifier. /// - [JsonPropertyName("vmid")] [JsonProperty("vmid")] public int VmId { get; set; } /// /// The name of the virtual machine. /// - [JsonPropertyName("name")] [JsonProperty("name")] public string? Name { get; set; } @@ -29,70 +26,60 @@ public class PveVm /// detection, use or , /// which are populated when using Get-PveVm -Detailed. /// - [JsonPropertyName("status")] [JsonProperty("status")] public string? Status { get; set; } /// /// The node on which the VM resides. /// - [JsonPropertyName("node")] [JsonProperty("node")] public string? Node { get; set; } /// /// The number of virtual CPU cores assigned to the VM. /// - [JsonPropertyName("cpus")] [JsonProperty("cpus")] public int? CpuCount { get; set; } /// /// Maximum memory allocated to the VM, in bytes. /// - [JsonPropertyName("maxmem")] [JsonProperty("maxmem")] public long? MaxMem { get; set; } /// /// Maximum disk size allocated to the VM, in bytes. /// - [JsonPropertyName("maxdisk")] [JsonProperty("maxdisk")] public long? MaxDisk { get; set; } /// /// VM uptime in seconds. /// - [JsonPropertyName("uptime")] [JsonProperty("uptime")] public long? Uptime { get; set; } /// /// Semicolon-separated list of tags assigned to the VM. /// - [JsonPropertyName("tags")] [JsonProperty("tags")] public string? Tags { get; set; } /// /// Indicates whether the VM is a template (1) or a regular VM (0). /// - [JsonPropertyName("template")] [JsonProperty("template")] public int? Template { get; set; } /// /// The current lock type applied to the VM, if any (e.g., "migrate", "backup"). /// - [JsonPropertyName("lock")] [JsonProperty("lock")] public string? Lock { get; set; } /// /// The process ID of the running QEMU process, if applicable. /// - [JsonPropertyName("pid")] [JsonProperty("pid")] public int? Pid { get; set; } @@ -100,7 +87,6 @@ public class PveVm /// The QMP (QEMU Machine Protocol) status string (e.g., "running", "paused", "stopped"). /// Only populated from the status/current endpoint (Get-PveVm -Detailed), not the list endpoint. /// - [JsonPropertyName("qmpstatus")] [JsonProperty("qmpstatus")] public string? QmpStatus { get; set; } @@ -108,14 +94,12 @@ public class PveVm /// The effective runtime status, preferring QmpStatus over Status for accurate /// pause detection. Returns QmpStatus when available (from -Detailed), otherwise Status. /// - [System.Text.Json.Serialization.JsonIgnore] [Newtonsoft.Json.JsonIgnore] public string? EffectiveStatus => QmpStatus ?? Status; /// /// Indicates whether the QEMU guest agent is running (non-zero) inside the VM. /// - [JsonPropertyName("agent")] [JsonProperty("agent")] public int? AgentStatus { get; set; } diff --git a/src/PSProxmoxVE.Core/Models/Vms/PveVmConfig.cs b/src/PSProxmoxVE.Core/Models/Vms/PveVmConfig.cs index ebf90a5..8fbf688 100644 --- a/src/PSProxmoxVE.Core/Models/Vms/PveVmConfig.cs +++ b/src/PSProxmoxVE.Core/Models/Vms/PveVmConfig.cs @@ -1,4 +1,3 @@ -using System.Text.Json.Serialization; using Newtonsoft.Json; namespace PSProxmoxVE.Core.Models.Vms; @@ -16,28 +15,24 @@ public class PveVmConfig /// /// Number of CPU cores per socket. /// - [JsonPropertyName("cores")] [JsonProperty("cores")] public int? Cores { get; set; } /// /// Number of CPU sockets. /// - [JsonPropertyName("sockets")] [JsonProperty("sockets")] public int? Sockets { get; set; } /// /// Memory size in megabytes. /// - [JsonPropertyName("memory")] [JsonProperty("memory")] public int? Memory { get; set; } /// /// Emulated CPU type (e.g., "host", "x86-64-v2-AES"). /// - [JsonPropertyName("cpu")] [JsonProperty("cpu")] public string? CpuType { get; set; } @@ -48,14 +43,12 @@ public class PveVmConfig /// /// BIOS implementation to use: "seabios" (default) or "ovmf" (UEFI). /// - [JsonPropertyName("bios")] [JsonProperty("bios")] public string? Bios { get; set; } /// /// Emulated machine type (e.g., "q35", "i440fx"). /// - [JsonPropertyName("machine")] [JsonProperty("machine")] public string? Machine { get; set; } @@ -66,14 +59,12 @@ public class PveVmConfig /// /// Boot order specification string. /// - [JsonPropertyName("boot")] [JsonProperty("boot")] public string? Boot { get; set; } /// /// Arbitrary QEMU command-line arguments appended to the QEMU launch command. /// - [JsonPropertyName("args")] [JsonProperty("args")] public string? Args { get; set; } @@ -84,42 +75,36 @@ public class PveVmConfig /// /// Human-readable description or notes for the VM. /// - [JsonPropertyName("description")] [JsonProperty("description")] public string? Description { get; set; } /// /// Semicolon-separated list of tags assigned to the VM. /// - [JsonPropertyName("tags")] [JsonProperty("tags")] public string? Tags { get; set; } /// /// When set to 1, prevents the VM from being deleted or modified accidentally. /// - [JsonPropertyName("protection")] [JsonProperty("protection")] public int? Protection { get; set; } /// /// NUMA topology enabled (1) or disabled (0). /// - [JsonPropertyName("numa")] [JsonProperty("numa")] public int? Numa { get; set; } /// /// VirtIO balloon device target memory in MB. 0 disables ballooning. /// - [JsonPropertyName("balloon")] [JsonProperty("balloon")] public int? Balloon { get; set; } /// /// Guest OS type hint (e.g., "l26" for Linux 2.6+, "win10"). /// - [JsonPropertyName("ostype")] [JsonProperty("ostype")] public string? OsType { get; set; } @@ -128,22 +113,18 @@ public class PveVmConfig // ------------------------------------------------------------------------- /// VirtIO disk slot 0 configuration string. - [JsonPropertyName("virtio0")] [JsonProperty("virtio0")] public string? Virtio0 { get; set; } /// VirtIO disk slot 1 configuration string. - [JsonPropertyName("virtio1")] [JsonProperty("virtio1")] public string? Virtio1 { get; set; } /// VirtIO disk slot 2 configuration string. - [JsonPropertyName("virtio2")] [JsonProperty("virtio2")] public string? Virtio2 { get; set; } /// VirtIO disk slot 3 configuration string. - [JsonPropertyName("virtio3")] [JsonProperty("virtio3")] public string? Virtio3 { get; set; } @@ -152,42 +133,34 @@ public class PveVmConfig // ------------------------------------------------------------------------- /// SCSI disk slot 0 configuration string. - [JsonPropertyName("scsi0")] [JsonProperty("scsi0")] public string? Scsi0 { get; set; } /// SCSI disk slot 1 configuration string. - [JsonPropertyName("scsi1")] [JsonProperty("scsi1")] public string? Scsi1 { get; set; } /// SCSI disk slot 2 configuration string. - [JsonPropertyName("scsi2")] [JsonProperty("scsi2")] public string? Scsi2 { get; set; } /// SCSI disk slot 3 configuration string. - [JsonPropertyName("scsi3")] [JsonProperty("scsi3")] public string? Scsi3 { get; set; } /// SCSI disk slot 4 configuration string. - [JsonPropertyName("scsi4")] [JsonProperty("scsi4")] public string? Scsi4 { get; set; } /// SCSI disk slot 5 configuration string. - [JsonPropertyName("scsi5")] [JsonProperty("scsi5")] public string? Scsi5 { get; set; } /// SCSI disk slot 6 configuration string. - [JsonPropertyName("scsi6")] [JsonProperty("scsi6")] public string? Scsi6 { get; set; } /// SCSI disk slot 7 configuration string. - [JsonPropertyName("scsi7")] [JsonProperty("scsi7")] public string? Scsi7 { get; set; } @@ -196,22 +169,18 @@ public class PveVmConfig // ------------------------------------------------------------------------- /// IDE disk/CDROM slot 0 configuration string. - [JsonPropertyName("ide0")] [JsonProperty("ide0")] public string? Ide0 { get; set; } /// IDE disk/CDROM slot 1 configuration string. - [JsonPropertyName("ide1")] [JsonProperty("ide1")] public string? Ide1 { get; set; } /// IDE disk/CDROM slot 2 configuration string. - [JsonPropertyName("ide2")] [JsonProperty("ide2")] public string? Ide2 { get; set; } /// IDE disk/CDROM slot 3 configuration string. - [JsonPropertyName("ide3")] [JsonProperty("ide3")] public string? Ide3 { get; set; } @@ -220,32 +189,26 @@ public class PveVmConfig // ------------------------------------------------------------------------- /// SATA disk slot 0 configuration string. - [JsonPropertyName("sata0")] [JsonProperty("sata0")] public string? Sata0 { get; set; } /// SATA disk slot 1 configuration string. - [JsonPropertyName("sata1")] [JsonProperty("sata1")] public string? Sata1 { get; set; } /// SATA disk slot 2 configuration string. - [JsonPropertyName("sata2")] [JsonProperty("sata2")] public string? Sata2 { get; set; } /// SATA disk slot 3 configuration string. - [JsonPropertyName("sata3")] [JsonProperty("sata3")] public string? Sata3 { get; set; } /// SATA disk slot 4 configuration string. - [JsonPropertyName("sata4")] [JsonProperty("sata4")] public string? Sata4 { get; set; } /// SATA disk slot 5 configuration string. - [JsonPropertyName("sata5")] [JsonProperty("sata5")] public string? Sata5 { get; set; } @@ -254,42 +217,34 @@ public class PveVmConfig // ------------------------------------------------------------------------- /// Network interface 0 configuration string (e.g., "virtio=XX:XX:XX:XX:XX:XX,bridge=vmbr0"). - [JsonPropertyName("net0")] [JsonProperty("net0")] public string? Net0 { get; set; } /// Network interface 1 configuration string. - [JsonPropertyName("net1")] [JsonProperty("net1")] public string? Net1 { get; set; } /// Network interface 2 configuration string. - [JsonPropertyName("net2")] [JsonProperty("net2")] public string? Net2 { get; set; } /// Network interface 3 configuration string. - [JsonPropertyName("net3")] [JsonProperty("net3")] public string? Net3 { get; set; } /// Network interface 4 configuration string. - [JsonPropertyName("net4")] [JsonProperty("net4")] public string? Net4 { get; set; } /// Network interface 5 configuration string. - [JsonPropertyName("net5")] [JsonProperty("net5")] public string? Net5 { get; set; } /// Network interface 6 configuration string. - [JsonPropertyName("net6")] [JsonProperty("net6")] public string? Net6 { get; set; } /// Network interface 7 configuration string. - [JsonPropertyName("net7")] [JsonProperty("net7")] public string? Net7 { get; set; } @@ -298,47 +253,38 @@ public class PveVmConfig // ------------------------------------------------------------------------- /// Cloud-Init default user name. - [JsonPropertyName("ciuser")] [JsonProperty("ciuser")] public string? CiUser { get; set; } /// Cloud-Init default user password (hashed or plaintext depending on PVE version). - [JsonPropertyName("cipassword")] [JsonProperty("cipassword")] public string? CiPassword { get; set; } /// URL-encoded SSH public keys injected by Cloud-Init. - [JsonPropertyName("sshkeys")] [JsonProperty("sshkeys")] public string? SshKeys { get; set; } /// Cloud-Init IP configuration for interface 0. - [JsonPropertyName("ipconfig0")] [JsonProperty("ipconfig0")] public string? IpConfig0 { get; set; } /// Cloud-Init IP configuration for interface 1. - [JsonPropertyName("ipconfig1")] [JsonProperty("ipconfig1")] public string? IpConfig1 { get; set; } /// Cloud-Init IP configuration for interface 2. - [JsonPropertyName("ipconfig2")] [JsonProperty("ipconfig2")] public string? IpConfig2 { get; set; } /// Cloud-Init IP configuration for interface 3. - [JsonPropertyName("ipconfig3")] [JsonProperty("ipconfig3")] public string? IpConfig3 { get; set; } /// DNS nameserver(s) injected via Cloud-Init. - [JsonPropertyName("nameserver")] [JsonProperty("nameserver")] public string? Nameserver { get; set; } /// DNS search domain injected via Cloud-Init. - [JsonPropertyName("searchdomain")] [JsonProperty("searchdomain")] public string? Searchdomain { get; set; }