Files
csharp/src/KubernetesClient/generated/Models/V2beta1ContainerResourceMetricSource.cs
Boshi Lian c0e96f516b deprecate net452 + generate model based on v1.20.0 (#536)
* remove most net452 related code

* first net4 remove

* migrate test proj to net5 base

* fix format

* update sta xunit to fix platform not support

* Squashed commit of the following:

commit 16e1f819058ad281e1571b356c10d4d6ce77cf38
Author: Boshi Lian <farmer1992@gmail.com>
Date:   Tue Dec 8 22:42:57 2020 -0800

    temp disable some version converter

commit 7d1a651f4e7d27d1e61c91f46f73ac8d04ea8ab9
Author: Boshi Lian <farmer1992@gmail.com>
Date:   Tue Dec 8 20:55:44 2020 -0800

    add missing watcher generator files

commit 3f3199aad269bf89406ea71d0bc63f1a7ec23245
Author: Boshi Lian <farmer1992@gmail.com>
Date:   Tue Dec 8 22:14:47 2020 +0000

    gen v1.20.0

* bump version to 4.0

* support empty spec

* fix version converter for generator

* add generated header

* fix warning

* rerun generator
2020-12-13 19:55:27 -08:00

113 lines
4.5 KiB
C#
Generated

// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// 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.Linq;
/// <summary>
/// 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.
/// </summary>
public partial class V2beta1ContainerResourceMetricSource
{
/// <summary>
/// Initializes a new instance of the
/// V2beta1ContainerResourceMetricSource class.
/// </summary>
public V2beta1ContainerResourceMetricSource()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the
/// V2beta1ContainerResourceMetricSource class.
/// </summary>
/// <param name="container">container is the name of the container in
/// the pods of the scaling target</param>
/// <param name="name">name is the name of the resource in
/// question.</param>
/// <param name="targetAverageUtilization">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.</param>
/// <param name="targetAverageValue">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.</param>
public V2beta1ContainerResourceMetricSource(string container, string name, int? targetAverageUtilization = default(int?), ResourceQuantity targetAverageValue = default(ResourceQuantity))
{
Container = container;
Name = name;
TargetAverageUtilization = targetAverageUtilization;
TargetAverageValue = targetAverageValue;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets or sets container is the name of the container in the pods of
/// the scaling target
/// </summary>
[JsonProperty(PropertyName = "container")]
public string Container { get; set; }
/// <summary>
/// Gets or sets name is the name of the resource in question.
/// </summary>
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
/// <summary>
/// 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.
/// </summary>
[JsonProperty(PropertyName = "targetAverageUtilization")]
public int? TargetAverageUtilization { get; set; }
/// <summary>
/// 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.
/// </summary>
[JsonProperty(PropertyName = "targetAverageValue")]
public ResourceQuantity TargetAverageValue { get; set; }
/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (Container == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Container");
}
if (Name == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "Name");
}
}
}
}