io.github.cdklabs.cdkecsserviceextensions.CpuScalingProps Maven / Gradle / Ivy
Show all versions of cdk-ecs-service-extensions Show documentation
package io.github.cdklabs.cdkecsserviceextensions;
/**
* (deprecated) The autoscaling settings.
*
* @deprecated use the minTaskCount
and maxTaskCount
properties of autoScaleTaskCount
in the Service
construct
* to configure the auto scaling target for the service. For more information, please refer
* https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk-containers/ecs-service-extensions/README.md#task-auto-scaling .
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-26T00:28:54.199Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdkecsserviceextensions.$Module.class, fqn = "@aws-cdk-containers/ecs-service-extensions.CpuScalingProps")
@software.amazon.jsii.Jsii.Proxy(CpuScalingProps.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public interface CpuScalingProps extends software.amazon.jsii.JsiiSerializable {
/**
* (deprecated) How many tasks to launch initially.
*
* Default: - 2
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
default @org.jetbrains.annotations.Nullable java.lang.Number getInitialTaskCount() {
return null;
}
/**
* (deprecated) The maximum number of tasks when scaling out.
*
* Default: - 8
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
default @org.jetbrains.annotations.Nullable java.lang.Number getMaxTaskCount() {
return null;
}
/**
* (deprecated) The minimum number of tasks when scaling in.
*
* Default: - 2
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
default @org.jetbrains.annotations.Nullable java.lang.Number getMinTaskCount() {
return null;
}
/**
* (deprecated) How long to wait between scale in actions.
*
* Default: - 60 seconds
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getScaleInCooldown() {
return null;
}
/**
* (deprecated) How long to wait between scale out actions.
*
* Default: - 60 seconds
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.Duration getScaleOutCooldown() {
return null;
}
/**
* (deprecated) The CPU utilization to try ot maintain.
*
* Default: - 50%
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
default @org.jetbrains.annotations.Nullable java.lang.Number getTargetCpuUtilization() {
return null;
}
/**
* @return a {@link Builder} of {@link CpuScalingProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link CpuScalingProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Number initialTaskCount;
java.lang.Number maxTaskCount;
java.lang.Number minTaskCount;
software.amazon.awscdk.Duration scaleInCooldown;
software.amazon.awscdk.Duration scaleOutCooldown;
java.lang.Number targetCpuUtilization;
/**
* Sets the value of {@link CpuScalingProps#getInitialTaskCount}
* @param initialTaskCount How many tasks to launch initially.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder initialTaskCount(java.lang.Number initialTaskCount) {
this.initialTaskCount = initialTaskCount;
return this;
}
/**
* Sets the value of {@link CpuScalingProps#getMaxTaskCount}
* @param maxTaskCount The maximum number of tasks when scaling out.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder maxTaskCount(java.lang.Number maxTaskCount) {
this.maxTaskCount = maxTaskCount;
return this;
}
/**
* Sets the value of {@link CpuScalingProps#getMinTaskCount}
* @param minTaskCount The minimum number of tasks when scaling in.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder minTaskCount(java.lang.Number minTaskCount) {
this.minTaskCount = minTaskCount;
return this;
}
/**
* Sets the value of {@link CpuScalingProps#getScaleInCooldown}
* @param scaleInCooldown How long to wait between scale in actions.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder scaleInCooldown(software.amazon.awscdk.Duration scaleInCooldown) {
this.scaleInCooldown = scaleInCooldown;
return this;
}
/**
* Sets the value of {@link CpuScalingProps#getScaleOutCooldown}
* @param scaleOutCooldown How long to wait between scale out actions.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder scaleOutCooldown(software.amazon.awscdk.Duration scaleOutCooldown) {
this.scaleOutCooldown = scaleOutCooldown;
return this;
}
/**
* Sets the value of {@link CpuScalingProps#getTargetCpuUtilization}
* @param targetCpuUtilization The CPU utilization to try ot maintain.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
public Builder targetCpuUtilization(java.lang.Number targetCpuUtilization) {
this.targetCpuUtilization = targetCpuUtilization;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link CpuScalingProps}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
@Override
public CpuScalingProps build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link CpuScalingProps}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Deprecated)
@Deprecated
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements CpuScalingProps {
private final java.lang.Number initialTaskCount;
private final java.lang.Number maxTaskCount;
private final java.lang.Number minTaskCount;
private final software.amazon.awscdk.Duration scaleInCooldown;
private final software.amazon.awscdk.Duration scaleOutCooldown;
private final java.lang.Number targetCpuUtilization;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.initialTaskCount = software.amazon.jsii.Kernel.get(this, "initialTaskCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.maxTaskCount = software.amazon.jsii.Kernel.get(this, "maxTaskCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.minTaskCount = software.amazon.jsii.Kernel.get(this, "minTaskCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.scaleInCooldown = software.amazon.jsii.Kernel.get(this, "scaleInCooldown", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
this.scaleOutCooldown = software.amazon.jsii.Kernel.get(this, "scaleOutCooldown", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.Duration.class));
this.targetCpuUtilization = software.amazon.jsii.Kernel.get(this, "targetCpuUtilization", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.initialTaskCount = builder.initialTaskCount;
this.maxTaskCount = builder.maxTaskCount;
this.minTaskCount = builder.minTaskCount;
this.scaleInCooldown = builder.scaleInCooldown;
this.scaleOutCooldown = builder.scaleOutCooldown;
this.targetCpuUtilization = builder.targetCpuUtilization;
}
@Override
public final java.lang.Number getInitialTaskCount() {
return this.initialTaskCount;
}
@Override
public final java.lang.Number getMaxTaskCount() {
return this.maxTaskCount;
}
@Override
public final java.lang.Number getMinTaskCount() {
return this.minTaskCount;
}
@Override
public final software.amazon.awscdk.Duration getScaleInCooldown() {
return this.scaleInCooldown;
}
@Override
public final software.amazon.awscdk.Duration getScaleOutCooldown() {
return this.scaleOutCooldown;
}
@Override
public final java.lang.Number getTargetCpuUtilization() {
return this.targetCpuUtilization;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getInitialTaskCount() != null) {
data.set("initialTaskCount", om.valueToTree(this.getInitialTaskCount()));
}
if (this.getMaxTaskCount() != null) {
data.set("maxTaskCount", om.valueToTree(this.getMaxTaskCount()));
}
if (this.getMinTaskCount() != null) {
data.set("minTaskCount", om.valueToTree(this.getMinTaskCount()));
}
if (this.getScaleInCooldown() != null) {
data.set("scaleInCooldown", om.valueToTree(this.getScaleInCooldown()));
}
if (this.getScaleOutCooldown() != null) {
data.set("scaleOutCooldown", om.valueToTree(this.getScaleOutCooldown()));
}
if (this.getTargetCpuUtilization() != null) {
data.set("targetCpuUtilization", om.valueToTree(this.getTargetCpuUtilization()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk-containers/ecs-service-extensions.CpuScalingProps"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CpuScalingProps.Jsii$Proxy that = (CpuScalingProps.Jsii$Proxy) o;
if (this.initialTaskCount != null ? !this.initialTaskCount.equals(that.initialTaskCount) : that.initialTaskCount != null) return false;
if (this.maxTaskCount != null ? !this.maxTaskCount.equals(that.maxTaskCount) : that.maxTaskCount != null) return false;
if (this.minTaskCount != null ? !this.minTaskCount.equals(that.minTaskCount) : that.minTaskCount != null) return false;
if (this.scaleInCooldown != null ? !this.scaleInCooldown.equals(that.scaleInCooldown) : that.scaleInCooldown != null) return false;
if (this.scaleOutCooldown != null ? !this.scaleOutCooldown.equals(that.scaleOutCooldown) : that.scaleOutCooldown != null) return false;
return this.targetCpuUtilization != null ? this.targetCpuUtilization.equals(that.targetCpuUtilization) : that.targetCpuUtilization == null;
}
@Override
public final int hashCode() {
int result = this.initialTaskCount != null ? this.initialTaskCount.hashCode() : 0;
result = 31 * result + (this.maxTaskCount != null ? this.maxTaskCount.hashCode() : 0);
result = 31 * result + (this.minTaskCount != null ? this.minTaskCount.hashCode() : 0);
result = 31 * result + (this.scaleInCooldown != null ? this.scaleInCooldown.hashCode() : 0);
result = 31 * result + (this.scaleOutCooldown != null ? this.scaleOutCooldown.hashCode() : 0);
result = 31 * result + (this.targetCpuUtilization != null ? this.targetCpuUtilization.hashCode() : 0);
return result;
}
}
}