Class V2ContainerResourceMetricSource

java.lang.Object
io.kubernetes.client.openapi.models.V2ContainerResourceMetricSource

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2025-05-20T20:47:13.890592Z[Etc/UTC]", comments="Generator version: 7.13.0") public class V2ContainerResourceMetricSource extends Object
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.
  • Field Details

  • Constructor Details

    • V2ContainerResourceMetricSource

      public V2ContainerResourceMetricSource()
  • Method Details

    • container

      public V2ContainerResourceMetricSource container(@Nonnull String container)
    • getContainer

      @Nonnull public String getContainer()
      container is the name of the container in the pods of the scaling target
      Returns:
      container
    • setContainer

      public void setContainer(@Nonnull String container)
    • name

      public V2ContainerResourceMetricSource name(@Nonnull String name)
    • getName

      @Nonnull public String getName()
      name is the name of the resource in question.
      Returns:
      name
    • setName

      public void setName(@Nonnull String name)
    • target

      public V2ContainerResourceMetricSource target(@Nonnull V2MetricTarget target)
    • getTarget

      @Nonnull public V2MetricTarget getTarget()
      Get target
      Returns:
      target
    • setTarget

      public void setTarget(@Nonnull V2MetricTarget target)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to V2ContainerResourceMetricSource
    • fromJson

      public static V2ContainerResourceMetricSource fromJson(String jsonString) throws IOException
      Create an instance of V2ContainerResourceMetricSource given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of V2ContainerResourceMetricSource
      Throws:
      IOException - if the JSON string is invalid with respect to V2ContainerResourceMetricSource
    • toJson

      public String toJson()
      Convert an instance of V2ContainerResourceMetricSource to an JSON string
      Returns:
      JSON string