//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
//
namespace k8s.Models
{
using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
///
/// ContainerResourceMetricSource indicates how to scale on a resource
/// metric known to Kubernetes, as specified in requests and limits,
/// describing each pod in the current scale target (e.g. CPU or memory).
/// The values will be averaged together before being compared to the
/// target. Such metrics are built in to Kubernetes, and have special
/// scaling options on top of those available to normal per-pod metrics
/// using the "pods" source. Only one "target" type should be set.
///
public partial class V2beta1ContainerResourceMetricSource
{
///
/// Initializes a new instance of the
/// V2beta1ContainerResourceMetricSource class.
///
public V2beta1ContainerResourceMetricSource()
{
CustomInit();
}
///
/// Initializes a new instance of the
/// V2beta1ContainerResourceMetricSource class.
///
/// container is the name of the container in
/// the pods of the scaling target
/// name is the name of the resource in
/// question.
/// targetAverageUtilization is
/// the target value of the average of the resource metric across all
/// relevant pods, represented as a percentage of the requested value
/// of the resource for the pods.
/// targetAverageValue is the target
/// value of the average of the resource metric across all relevant
/// pods, as a raw value (instead of as a percentage of the request),
/// similar to the "pods" metric source type.
public V2beta1ContainerResourceMetricSource(string container, string name, int? targetAverageUtilization = default(int?), ResourceQuantity targetAverageValue = default(ResourceQuantity))
{
Container = container;
Name = name;
TargetAverageUtilization = targetAverageUtilization;
TargetAverageValue = targetAverageValue;
CustomInit();
}
///
/// An initialization method that performs custom operations like setting defaults
///
partial void CustomInit();
///
/// Gets or sets container is the name of the container in the pods of
/// the scaling target
///
[JsonProperty(PropertyName = "container")]
public string Container { get; set; }
///
/// Gets or sets name is the name of the resource in question.
///
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
///
/// Gets or sets targetAverageUtilization is the target value of the
/// average of the resource metric across all relevant pods,
/// represented as a percentage of the requested value of the resource
/// for the pods.
///
[JsonProperty(PropertyName = "targetAverageUtilization")]
public int? TargetAverageUtilization { get; set; }
///
/// Gets or sets targetAverageValue is the target value of the average
/// of the resource metric across all relevant pods, as a raw value
/// (instead of as a percentage of the request), similar to the "pods"
/// metric source type.
///
[JsonProperty(PropertyName = "targetAverageValue")]
public ResourceQuantity TargetAverageValue { get; set; }
///
/// Validate the object.
///
///
/// Thrown if validation fails
///
public virtual void Validate()
{
if (Container == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Container");
}
if (Name == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Name");
}
}
}
}