2020-12-19 11:26:25 -05:00
|
|
|
using k8s.Models;
|
2022-03-07 10:06:55 -08:00
|
|
|
using System.Text.Json.Serialization;
|
2020-12-19 11:26:25 -05:00
|
|
|
|
|
|
|
|
namespace customResource
|
|
|
|
|
{
|
|
|
|
|
public class CResource : CustomResource<CResourceSpec, CResourceStatus>
|
|
|
|
|
{
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
var labels = "{";
|
|
|
|
|
foreach (var kvp in Metadata.Labels)
|
|
|
|
|
{
|
|
|
|
|
labels += kvp.Key + " : " + kvp.Value + ", ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
labels = labels.TrimEnd(',', ' ') + "}";
|
|
|
|
|
|
|
|
|
|
return $"{Metadata.Name} (Labels: {labels}), Spec: {Spec.CityName}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class CResourceSpec
|
|
|
|
|
{
|
2022-03-07 10:06:55 -08:00
|
|
|
[JsonPropertyName("cityName")]
|
2020-12-19 11:26:25 -05:00
|
|
|
public string CityName { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class CResourceStatus : V1Status
|
|
|
|
|
{
|
2022-03-07 10:06:55 -08:00
|
|
|
[JsonPropertyName("temperature")]
|
2020-12-19 11:26:25 -05:00
|
|
|
public string Temperature { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|