using Newtonsoft.Json;
namespace PSProxmox.Models
{
///
/// Represents a network interface in Proxmox VE.
///
public class ProxmoxNetwork
{
///
/// Gets or sets the interface name.
///
[JsonProperty("iface")]
public string Interface { get; set; }
///
/// Gets or sets the interface type.
///
[JsonProperty("type")]
public string Type { get; set; }
///
/// Gets or sets the interface method.
///
[JsonProperty("method")]
public string Method { get; set; }
///
/// Gets or sets the interface IP address.
///
[JsonProperty("address")]
public string Address { get; set; }
///
/// Gets or sets the interface netmask.
///
[JsonProperty("netmask")]
public string Netmask { get; set; }
///
/// Gets or sets the interface gateway.
///
[JsonProperty("gateway")]
public string Gateway { get; set; }
///
/// Gets or sets the interface bridge ports.
///
[JsonProperty("bridge_ports")]
public string BridgePorts { get; set; }
///
/// Gets or sets the interface bridge STP.
///
[JsonProperty("bridge_stp")]
public string BridgeSTP { get; set; }
///
/// Gets or sets the interface bridge FD.
///
[JsonProperty("bridge_fd")]
public string BridgeFD { get; set; }
///
/// Gets or sets the interface bond slaves.
///
[JsonProperty("bond_slaves")]
public string BondSlaves { get; set; }
///
/// Gets or sets the interface bond mode.
///
[JsonProperty("bond_mode")]
public string BondMode { get; set; }
///
/// Gets or sets the interface VLAN ID.
///
[JsonProperty("vlan-id")]
public string VlanID { get; set; }
///
/// Gets or sets the interface VLAN raw device.
///
[JsonProperty("vlan-raw-device")]
public string VlanRawDevice { get; set; }
///
/// Gets or sets the interface autostart flag.
///
[JsonProperty("autostart")]
public bool Autostart { get; set; }
///
/// Gets or sets the interface active flag.
///
[JsonProperty("active")]
public bool Active { get; set; }
///
/// Gets or sets the interface comments.
///
[JsonProperty("comments")]
public string Comments { get; set; }
///
/// Gets or sets the interface node.
///
[JsonProperty("node")]
public string Node { get; set; }
///
/// Gets a value indicating whether the interface is a bridge.
///
[JsonIgnore]
public bool IsBridge => Type == "bridge";
///
/// Gets a value indicating whether the interface is a bond.
///
[JsonIgnore]
public bool IsBond => Type == "bond";
///
/// Gets a value indicating whether the interface is a VLAN.
///
[JsonIgnore]
public bool IsVlan => Type == "vlan";
///
/// Gets a value indicating whether the interface is a physical interface.
///
[JsonIgnore]
public bool IsPhysical => Type == "eth";
///
/// Gets a value indicating whether the interface uses DHCP.
///
[JsonIgnore]
public bool IsDHCP => Method == "dhcp";
///
/// Gets a value indicating whether the interface uses a static IP.
///
[JsonIgnore]
public bool IsStatic => Method == "static";
}
}