mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-21 02:06:36 +00:00
a72642d203
Add 35 new cmdlets bringing the total to 118: - Firewall (21): rules, groups, aliases, IP sets, options at cluster/node/VM/container levels - Backup (5): ad-hoc vzdump and scheduled backup job CRUD - SDN IPAM/DNS/Controller (9): plugin management for SDN subsystem Also includes: - Fix: Remove-PveRole now has ConfirmImpact.High - Fix: URL-encode snapshot names in API paths - Refactor: extract auth header strings to constants in PveHttpClient - Add PSGallery version badge to README - Full test coverage: 11 JSON fixtures, xUnit model tests, Pester unit tests, and integration tests for firewall/backup/OVA import - Updated manifest, format file, CHANGELOG, README, API coverage docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
89 lines
2.5 KiB
C#
89 lines
2.5 KiB
C#
using System.Text.Json.Serialization;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace PSProxmoxVE.Core.Models.Firewall;
|
|
|
|
/// <summary>
|
|
/// Represents Proxmox VE firewall options as returned by
|
|
/// the firewall/options endpoints at cluster, node, VM, or container level.
|
|
/// </summary>
|
|
public class PveFirewallOptions
|
|
{
|
|
/// <summary>
|
|
/// Whether the firewall is enabled (1) or disabled (0).
|
|
/// </summary>
|
|
[JsonPropertyName("enable")]
|
|
[JsonProperty("enable")]
|
|
public int? Enable { get; set; }
|
|
|
|
/// <summary>
|
|
/// Default policy for incoming traffic (ACCEPT, DROP, REJECT).
|
|
/// </summary>
|
|
[JsonPropertyName("policy_in")]
|
|
[JsonProperty("policy_in")]
|
|
public string? PolicyIn { get; set; }
|
|
|
|
/// <summary>
|
|
/// Default policy for outgoing traffic (ACCEPT, DROP, REJECT).
|
|
/// </summary>
|
|
[JsonPropertyName("policy_out")]
|
|
[JsonProperty("policy_out")]
|
|
public string? PolicyOut { get; set; }
|
|
|
|
/// <summary>
|
|
/// Log level for incoming traffic (nolog, emerg, alert, crit, err, warning, notice, info, debug).
|
|
/// </summary>
|
|
[JsonPropertyName("log_level_in")]
|
|
[JsonProperty("log_level_in")]
|
|
public string? LogLevelIn { get; set; }
|
|
|
|
/// <summary>
|
|
/// Log level for outgoing traffic.
|
|
/// </summary>
|
|
[JsonPropertyName("log_level_out")]
|
|
[JsonProperty("log_level_out")]
|
|
public string? LogLevelOut { get; set; }
|
|
|
|
/// <summary>
|
|
/// Whether to allow DHCP traffic (VM/container level).
|
|
/// </summary>
|
|
[JsonPropertyName("dhcp")]
|
|
[JsonProperty("dhcp")]
|
|
public int? Dhcp { get; set; }
|
|
|
|
/// <summary>
|
|
/// Whether to allow NDP (IPv6 Neighbor Discovery Protocol).
|
|
/// </summary>
|
|
[JsonPropertyName("ndp")]
|
|
[JsonProperty("ndp")]
|
|
public int? Ndp { get; set; }
|
|
|
|
/// <summary>
|
|
/// Whether to allow Router Advertisement.
|
|
/// </summary>
|
|
[JsonPropertyName("radv")]
|
|
[JsonProperty("radv")]
|
|
public int? Radv { get; set; }
|
|
|
|
/// <summary>
|
|
/// Whether to enable MAC address filter (VM/container level).
|
|
/// </summary>
|
|
[JsonPropertyName("macfilter")]
|
|
[JsonProperty("macfilter")]
|
|
public int? MacFilter { get; set; }
|
|
|
|
/// <summary>
|
|
/// Whether to enable IP filter (VM/container level).
|
|
/// </summary>
|
|
[JsonPropertyName("ipfilter")]
|
|
[JsonProperty("ipfilter")]
|
|
public int? IpFilter { get; set; }
|
|
|
|
/// <inheritdoc />
|
|
public override string ToString()
|
|
{
|
|
var state = Enable == 1 ? "Enabled" : "Disabled";
|
|
return $"Firewall: {state} | In: {PolicyIn ?? "N/A"} | Out: {PolicyOut ?? "N/A"}";
|
|
}
|
|
}
|