using Newtonsoft.Json;
namespace PSProxmox.Models
{
///
/// Represents a storage in Proxmox VE.
///
public class ProxmoxStorage
{
///
/// Gets or sets the storage name.
///
[JsonProperty("storage")]
public string Name { get; set; }
///
/// Gets or sets the storage type.
///
[JsonProperty("type")]
public string Type { get; set; }
///
/// Gets or sets the storage content types.
///
[JsonProperty("content")]
public string Content { get; set; }
///
/// Gets or sets the storage path.
///
[JsonProperty("path")]
public string Path { get; set; }
///
/// Gets or sets the storage node.
///
[JsonProperty("node")]
public string Node { get; set; }
///
/// Gets or sets the storage used space in bytes.
///
[JsonProperty("used")]
public long Used { get; set; }
///
/// Gets or sets the storage available space in bytes.
///
[JsonProperty("avail")]
public long Available { get; set; }
///
/// Gets or sets the storage total space in bytes.
///
[JsonProperty("total")]
public long Total { get; set; }
///
/// Gets or sets a value indicating whether the storage is enabled.
///
[JsonProperty("enabled")]
public bool Enabled { get; set; }
///
/// Gets or sets a value indicating whether the storage is shared.
///
[JsonProperty("shared")]
public bool Shared { get; set; }
///
/// Gets or sets a value indicating whether the storage is active.
///
[JsonProperty("active")]
public bool Active { get; set; }
///
/// Gets the storage used space in gigabytes.
///
[JsonIgnore]
public double UsedGB => Used / 1024.0 / 1024.0 / 1024.0;
///
/// Gets the storage available space in gigabytes.
///
[JsonIgnore]
public double AvailableGB => Available / 1024.0 / 1024.0 / 1024.0;
///
/// Gets the storage total space in gigabytes.
///
[JsonIgnore]
public double TotalGB => Total / 1024.0 / 1024.0 / 1024.0;
///
/// Gets the storage usage percentage.
///
[JsonIgnore]
public double UsagePercent => Total > 0 ? (double)Used / Total * 100 : 0;
}
}