io.github.cdklabs.cdkmonitoringconstructs.BaseEc2ServiceAlarms Maven / Gradle / Ivy
package io.github.cdklabs.cdkmonitoringconstructs;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.93.0 (build 1706ca5)", date = "2024-01-08T00:34:46.530Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.cdkmonitoringconstructs.$Module.class, fqn = "cdk-monitoring-constructs.BaseEc2ServiceAlarms")
@software.amazon.jsii.Jsii.Proxy(BaseEc2ServiceAlarms.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface BaseEc2ServiceAlarms extends software.amazon.jsii.JsiiSerializable {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getAddCpuUsageAlarm() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getAddMemoryUsageAlarm() {
return null;
}
/**
* (experimental) Container Insights needs to be enabled for the cluster for this alarm.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getAddRunningTaskCountAlarm() {
return null;
}
/**
* (experimental) maximum number of tasks, as specified in your auto scaling config.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getMaxAutoScalingTaskCount() {
return null;
}
/**
* (experimental) minimum number of tasks, as specified in your auto scaling config.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getMinAutoScalingTaskCount() {
return null;
}
/**
* @return a {@link Builder} of {@link BaseEc2ServiceAlarms}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link BaseEc2ServiceAlarms}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.Map addCpuUsageAlarm;
java.util.Map addMemoryUsageAlarm;
java.util.Map addRunningTaskCountAlarm;
java.lang.Number maxAutoScalingTaskCount;
java.lang.Number minAutoScalingTaskCount;
/**
* Sets the value of {@link BaseEc2ServiceAlarms#getAddCpuUsageAlarm}
* @param addCpuUsageAlarm the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder addCpuUsageAlarm(java.util.Map addCpuUsageAlarm) {
this.addCpuUsageAlarm = (java.util.Map)addCpuUsageAlarm;
return this;
}
/**
* Sets the value of {@link BaseEc2ServiceAlarms#getAddMemoryUsageAlarm}
* @param addMemoryUsageAlarm the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder addMemoryUsageAlarm(java.util.Map addMemoryUsageAlarm) {
this.addMemoryUsageAlarm = (java.util.Map)addMemoryUsageAlarm;
return this;
}
/**
* Sets the value of {@link BaseEc2ServiceAlarms#getAddRunningTaskCountAlarm}
* @param addRunningTaskCountAlarm Container Insights needs to be enabled for the cluster for this alarm.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder addRunningTaskCountAlarm(java.util.Map addRunningTaskCountAlarm) {
this.addRunningTaskCountAlarm = (java.util.Map)addRunningTaskCountAlarm;
return this;
}
/**
* Sets the value of {@link BaseEc2ServiceAlarms#getMaxAutoScalingTaskCount}
* @param maxAutoScalingTaskCount maximum number of tasks, as specified in your auto scaling config.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder maxAutoScalingTaskCount(java.lang.Number maxAutoScalingTaskCount) {
this.maxAutoScalingTaskCount = maxAutoScalingTaskCount;
return this;
}
/**
* Sets the value of {@link BaseEc2ServiceAlarms#getMinAutoScalingTaskCount}
* @param minAutoScalingTaskCount minimum number of tasks, as specified in your auto scaling config.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder minAutoScalingTaskCount(java.lang.Number minAutoScalingTaskCount) {
this.minAutoScalingTaskCount = minAutoScalingTaskCount;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link BaseEc2ServiceAlarms}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public BaseEc2ServiceAlarms build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link BaseEc2ServiceAlarms}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements BaseEc2ServiceAlarms {
private final java.util.Map addCpuUsageAlarm;
private final java.util.Map addMemoryUsageAlarm;
private final java.util.Map addRunningTaskCountAlarm;
private final java.lang.Number maxAutoScalingTaskCount;
private final java.lang.Number minAutoScalingTaskCount;
/**
* 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.addCpuUsageAlarm = software.amazon.jsii.Kernel.get(this, "addCpuUsageAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.UsageThreshold.class)));
this.addMemoryUsageAlarm = software.amazon.jsii.Kernel.get(this, "addMemoryUsageAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.UsageThreshold.class)));
this.addRunningTaskCountAlarm = software.amazon.jsii.Kernel.get(this, "addRunningTaskCountAlarm", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(io.github.cdklabs.cdkmonitoringconstructs.RunningTaskCountThreshold.class)));
this.maxAutoScalingTaskCount = software.amazon.jsii.Kernel.get(this, "maxAutoScalingTaskCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.minAutoScalingTaskCount = software.amazon.jsii.Kernel.get(this, "minAutoScalingTaskCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.addCpuUsageAlarm = (java.util.Map)builder.addCpuUsageAlarm;
this.addMemoryUsageAlarm = (java.util.Map)builder.addMemoryUsageAlarm;
this.addRunningTaskCountAlarm = (java.util.Map)builder.addRunningTaskCountAlarm;
this.maxAutoScalingTaskCount = builder.maxAutoScalingTaskCount;
this.minAutoScalingTaskCount = builder.minAutoScalingTaskCount;
}
@Override
public final java.util.Map getAddCpuUsageAlarm() {
return this.addCpuUsageAlarm;
}
@Override
public final java.util.Map getAddMemoryUsageAlarm() {
return this.addMemoryUsageAlarm;
}
@Override
public final java.util.Map getAddRunningTaskCountAlarm() {
return this.addRunningTaskCountAlarm;
}
@Override
public final java.lang.Number getMaxAutoScalingTaskCount() {
return this.maxAutoScalingTaskCount;
}
@Override
public final java.lang.Number getMinAutoScalingTaskCount() {
return this.minAutoScalingTaskCount;
}
@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.getAddCpuUsageAlarm() != null) {
data.set("addCpuUsageAlarm", om.valueToTree(this.getAddCpuUsageAlarm()));
}
if (this.getAddMemoryUsageAlarm() != null) {
data.set("addMemoryUsageAlarm", om.valueToTree(this.getAddMemoryUsageAlarm()));
}
if (this.getAddRunningTaskCountAlarm() != null) {
data.set("addRunningTaskCountAlarm", om.valueToTree(this.getAddRunningTaskCountAlarm()));
}
if (this.getMaxAutoScalingTaskCount() != null) {
data.set("maxAutoScalingTaskCount", om.valueToTree(this.getMaxAutoScalingTaskCount()));
}
if (this.getMinAutoScalingTaskCount() != null) {
data.set("minAutoScalingTaskCount", om.valueToTree(this.getMinAutoScalingTaskCount()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("cdk-monitoring-constructs.BaseEc2ServiceAlarms"));
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;
BaseEc2ServiceAlarms.Jsii$Proxy that = (BaseEc2ServiceAlarms.Jsii$Proxy) o;
if (this.addCpuUsageAlarm != null ? !this.addCpuUsageAlarm.equals(that.addCpuUsageAlarm) : that.addCpuUsageAlarm != null) return false;
if (this.addMemoryUsageAlarm != null ? !this.addMemoryUsageAlarm.equals(that.addMemoryUsageAlarm) : that.addMemoryUsageAlarm != null) return false;
if (this.addRunningTaskCountAlarm != null ? !this.addRunningTaskCountAlarm.equals(that.addRunningTaskCountAlarm) : that.addRunningTaskCountAlarm != null) return false;
if (this.maxAutoScalingTaskCount != null ? !this.maxAutoScalingTaskCount.equals(that.maxAutoScalingTaskCount) : that.maxAutoScalingTaskCount != null) return false;
return this.minAutoScalingTaskCount != null ? this.minAutoScalingTaskCount.equals(that.minAutoScalingTaskCount) : that.minAutoScalingTaskCount == null;
}
@Override
public final int hashCode() {
int result = this.addCpuUsageAlarm != null ? this.addCpuUsageAlarm.hashCode() : 0;
result = 31 * result + (this.addMemoryUsageAlarm != null ? this.addMemoryUsageAlarm.hashCode() : 0);
result = 31 * result + (this.addRunningTaskCountAlarm != null ? this.addRunningTaskCountAlarm.hashCode() : 0);
result = 31 * result + (this.maxAutoScalingTaskCount != null ? this.maxAutoScalingTaskCount.hashCode() : 0);
result = 31 * result + (this.minAutoScalingTaskCount != null ? this.minAutoScalingTaskCount.hashCode() : 0);
return result;
}
}
}