All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.k8s.api.autoscaling.v2.MetricSpec Maven / Gradle / Ivy

The newest version!
package io.k8s.api.autoscaling.v2;

import java.lang.String;

/**
 * MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).
 */
public class MetricSpec {
  public ContainerResourceMetricSource containerResource;

  public ExternalMetricSource external;

  public ObjectMetricSource object;

  public PodsMetricSource pods;

  public ResourceMetricSource resource;

  public String type;

  public MetricSpec containerResource(ContainerResourceMetricSource containerResource) {
    this.containerResource = containerResource;
    return this;
  }

  public MetricSpec external(ExternalMetricSource external) {
    this.external = external;
    return this;
  }

  public MetricSpec object(ObjectMetricSource object) {
    this.object = object;
    return this;
  }

  public MetricSpec pods(PodsMetricSource pods) {
    this.pods = pods;
    return this;
  }

  public MetricSpec resource(ResourceMetricSource resource) {
    this.resource = resource;
    return this;
  }

  /**
   * type is the type of metric source.  It should be one of "ContainerResource", "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object. Note: "ContainerResource" type is available on when the feature-gate HPAContainerMetrics is enabled
   */
  public MetricSpec type(String type) {
    this.type = type;
    return this;
  }

  public static MetricSpec metricSpec() {
    return new MetricSpec();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy