Files
csharp/src/KubernetesClient/generated/Models/V1PodDisruptionBudgetStatus.cs
Boshi Lian 463e2d94df Fix 712 (#713)
* fix iter obj validate might npe

* generated models
2021-09-24 19:34:21 -07:00

175 lines
8.2 KiB
C#
Generated

// <auto-generated>
// Code generated by https://github.com/kubernetes-client/csharp/tree/master/gen/KubernetesGenerator
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace k8s.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
/// <summary>
/// PodDisruptionBudgetStatus represents information about the status of a
/// PodDisruptionBudget. Status may trail the actual state of a system.
/// </summary>
public partial class V1PodDisruptionBudgetStatus
{
/// <summary>
/// Initializes a new instance of the V1PodDisruptionBudgetStatus class.
/// </summary>
public V1PodDisruptionBudgetStatus()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the V1PodDisruptionBudgetStatus class.
/// </summary>
/// <param name="currentHealthy">
/// current number of healthy pods
/// </param>
/// <param name="desiredHealthy">
/// minimum desired number of healthy pods
/// </param>
/// <param name="disruptionsAllowed">
/// Number of pod disruptions that are currently allowed.
/// </param>
/// <param name="expectedPods">
/// total number of pods counted by this disruption budget
/// </param>
/// <param name="conditions">
/// Conditions contain conditions for PDB. The disruption controller sets the
/// DisruptionAllowed condition. The following are known values for the reason field
/// (additional reasons could be added in the future): - SyncFailed: The controller
/// encountered an error and wasn&apos;t able to compute
/// the number of allowed disruptions. Therefore no disruptions are
/// allowed and the status of the condition will be False.
/// - InsufficientPods: The number of pods are either at or below the number
/// required by the PodDisruptionBudget. No disruptions are
/// allowed and the status of the condition will be False.
/// - SufficientPods: There are more pods than required by the PodDisruptionBudget.
/// The condition will be True, and the number of allowed
/// disruptions are provided by the disruptionsAllowed property.
/// </param>
/// <param name="disruptedPods">
/// DisruptedPods contains information about pods whose eviction was processed by
/// the API server eviction subresource handler but has not yet been observed by the
/// PodDisruptionBudget controller. A pod will be in this map from the time when the
/// API server processed the eviction request to the time when the pod is seen by
/// PDB controller as having been marked for deletion (or after a timeout). The key
/// in the map is the name of the pod and the value is the time when the API server
/// processed the eviction request. If the deletion didn&apos;t occur and a pod is still
/// there it will be removed from the list automatically by PodDisruptionBudget
/// controller after some time. If everything goes smooth this map should be empty
/// for the most of the time. Large number of entries in the map may indicate
/// problems with pod deletions.
/// </param>
/// <param name="observedGeneration">
/// Most recent generation observed when updating this PDB status.
/// DisruptionsAllowed and other status information is valid only if
/// observedGeneration equals to PDB&apos;s object generation.
/// </param>
public V1PodDisruptionBudgetStatus(int currentHealthy, int desiredHealthy, int disruptionsAllowed, int expectedPods, IList<V1Condition> conditions = null, IDictionary<string, System.DateTime?> disruptedPods = null, long? observedGeneration = null)
{
Conditions = conditions;
CurrentHealthy = currentHealthy;
DesiredHealthy = desiredHealthy;
DisruptedPods = disruptedPods;
DisruptionsAllowed = disruptionsAllowed;
ExpectedPods = expectedPods;
ObservedGeneration = observedGeneration;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Conditions contain conditions for PDB. The disruption controller sets the
/// DisruptionAllowed condition. The following are known values for the reason field
/// (additional reasons could be added in the future): - SyncFailed: The controller
/// encountered an error and wasn&apos;t able to compute
/// the number of allowed disruptions. Therefore no disruptions are
/// allowed and the status of the condition will be False.
/// - InsufficientPods: The number of pods are either at or below the number
/// required by the PodDisruptionBudget. No disruptions are
/// allowed and the status of the condition will be False.
/// - SufficientPods: There are more pods than required by the PodDisruptionBudget.
/// The condition will be True, and the number of allowed
/// disruptions are provided by the disruptionsAllowed property.
/// </summary>
[JsonProperty(PropertyName = "conditions")]
public IList<V1Condition> Conditions { get; set; }
/// <summary>
/// current number of healthy pods
/// </summary>
[JsonProperty(PropertyName = "currentHealthy")]
public int CurrentHealthy { get; set; }
/// <summary>
/// minimum desired number of healthy pods
/// </summary>
[JsonProperty(PropertyName = "desiredHealthy")]
public int DesiredHealthy { get; set; }
/// <summary>
/// DisruptedPods contains information about pods whose eviction was processed by
/// the API server eviction subresource handler but has not yet been observed by the
/// PodDisruptionBudget controller. A pod will be in this map from the time when the
/// API server processed the eviction request to the time when the pod is seen by
/// PDB controller as having been marked for deletion (or after a timeout). The key
/// in the map is the name of the pod and the value is the time when the API server
/// processed the eviction request. If the deletion didn&apos;t occur and a pod is still
/// there it will be removed from the list automatically by PodDisruptionBudget
/// controller after some time. If everything goes smooth this map should be empty
/// for the most of the time. Large number of entries in the map may indicate
/// problems with pod deletions.
/// </summary>
[JsonProperty(PropertyName = "disruptedPods")]
public IDictionary<string, System.DateTime?> DisruptedPods { get; set; }
/// <summary>
/// Number of pod disruptions that are currently allowed.
/// </summary>
[JsonProperty(PropertyName = "disruptionsAllowed")]
public int DisruptionsAllowed { get; set; }
/// <summary>
/// total number of pods counted by this disruption budget
/// </summary>
[JsonProperty(PropertyName = "expectedPods")]
public int ExpectedPods { get; set; }
/// <summary>
/// Most recent generation observed when updating this PDB status.
/// DisruptionsAllowed and other status information is valid only if
/// observedGeneration equals to PDB&apos;s object generation.
/// </summary>
[JsonProperty(PropertyName = "observedGeneration")]
public long? ObservedGeneration { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (Conditions != null){
foreach(var obj in Conditions)
{
obj.Validate();
}
}
}
}
}