
com.amazonaws.services.autoscaling.model.PredictiveScalingPredefinedMetricPair Maven / Gradle / Ivy
Show all versions of aws-java-sdk-autoscaling Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.autoscaling.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Represents a metric pair for a predictive scaling policy.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PredictiveScalingPredefinedMetricPair implements Serializable, Cloneable {
/**
*
* Indicates which metrics to use. There are two different types of metrics for each metric type: one is a load
* metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization
, the Auto
* Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used for the scaling
* metric.
*
*/
private String predefinedMetricType;
/**
*
* A label that uniquely identifies a specific Application Load Balancer target group from which to determine the
* total and average request count served by your Auto Scaling group. You can't specify a resource label unless the
* target group is attached to the Auto Scaling group.
*
*
* You create the resource label by appending the final portion of the load balancer ARN and the final portion of
* the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:
*
*
* app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff
.
*
*
* Where:
*
*
* -
*
* app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
*
*
* -
*
* targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.
*
*
*
*
* To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.
*
*/
private String resourceLabel;
/**
*
* Indicates which metrics to use. There are two different types of metrics for each metric type: one is a load
* metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization
, the Auto
* Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used for the scaling
* metric.
*
*
* @param predefinedMetricType
* Indicates which metrics to use. There are two different types of metrics for each metric type: one is a
* load metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization
* , the Auto Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used
* for the scaling metric.
* @see PredefinedMetricPairType
*/
public void setPredefinedMetricType(String predefinedMetricType) {
this.predefinedMetricType = predefinedMetricType;
}
/**
*
* Indicates which metrics to use. There are two different types of metrics for each metric type: one is a load
* metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization
, the Auto
* Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used for the scaling
* metric.
*
*
* @return Indicates which metrics to use. There are two different types of metrics for each metric type: one is a
* load metric and one is a scaling metric. For example, if the metric type is
* ASGCPUUtilization
, the Auto Scaling group's total CPU metric is used as the load metric, and
* the average CPU metric is used for the scaling metric.
* @see PredefinedMetricPairType
*/
public String getPredefinedMetricType() {
return this.predefinedMetricType;
}
/**
*
* Indicates which metrics to use. There are two different types of metrics for each metric type: one is a load
* metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization
, the Auto
* Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used for the scaling
* metric.
*
*
* @param predefinedMetricType
* Indicates which metrics to use. There are two different types of metrics for each metric type: one is a
* load metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization
* , the Auto Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used
* for the scaling metric.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PredefinedMetricPairType
*/
public PredictiveScalingPredefinedMetricPair withPredefinedMetricType(String predefinedMetricType) {
setPredefinedMetricType(predefinedMetricType);
return this;
}
/**
*
* Indicates which metrics to use. There are two different types of metrics for each metric type: one is a load
* metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization
, the Auto
* Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used for the scaling
* metric.
*
*
* @param predefinedMetricType
* Indicates which metrics to use. There are two different types of metrics for each metric type: one is a
* load metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization
* , the Auto Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used
* for the scaling metric.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PredefinedMetricPairType
*/
public PredictiveScalingPredefinedMetricPair withPredefinedMetricType(PredefinedMetricPairType predefinedMetricType) {
this.predefinedMetricType = predefinedMetricType.toString();
return this;
}
/**
*
* A label that uniquely identifies a specific Application Load Balancer target group from which to determine the
* total and average request count served by your Auto Scaling group. You can't specify a resource label unless the
* target group is attached to the Auto Scaling group.
*
*
* You create the resource label by appending the final portion of the load balancer ARN and the final portion of
* the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:
*
*
* app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff
.
*
*
* Where:
*
*
* -
*
* app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
*
*
* -
*
* targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.
*
*
*
*
* To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.
*
*
* @param resourceLabel
* A label that uniquely identifies a specific Application Load Balancer target group from which to determine
* the total and average request count served by your Auto Scaling group. You can't specify a resource label
* unless the target group is attached to the Auto Scaling group.
*
* You create the resource label by appending the final portion of the load balancer ARN and the final
* portion of the target group ARN into a single value, separated by a forward slash (/). The format of the
* resource label is:
*
*
* app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff
.
*
*
* Where:
*
*
* -
*
* app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
*
*
* -
*
* targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group
* ARN.
*
*
*
*
* To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.
*/
public void setResourceLabel(String resourceLabel) {
this.resourceLabel = resourceLabel;
}
/**
*
* A label that uniquely identifies a specific Application Load Balancer target group from which to determine the
* total and average request count served by your Auto Scaling group. You can't specify a resource label unless the
* target group is attached to the Auto Scaling group.
*
*
* You create the resource label by appending the final portion of the load balancer ARN and the final portion of
* the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:
*
*
* app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff
.
*
*
* Where:
*
*
* -
*
* app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
*
*
* -
*
* targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.
*
*
*
*
* To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.
*
*
* @return A label that uniquely identifies a specific Application Load Balancer target group from which to
* determine the total and average request count served by your Auto Scaling group. You can't specify a
* resource label unless the target group is attached to the Auto Scaling group.
*
* You create the resource label by appending the final portion of the load balancer ARN and the final
* portion of the target group ARN into a single value, separated by a forward slash (/). The format of the
* resource label is:
*
*
* app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff
.
*
*
* Where:
*
*
* -
*
* app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
*
*
* -
*
* targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group
* ARN.
*
*
*
*
* To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.
*/
public String getResourceLabel() {
return this.resourceLabel;
}
/**
*
* A label that uniquely identifies a specific Application Load Balancer target group from which to determine the
* total and average request count served by your Auto Scaling group. You can't specify a resource label unless the
* target group is attached to the Auto Scaling group.
*
*
* You create the resource label by appending the final portion of the load balancer ARN and the final portion of
* the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is:
*
*
* app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff
.
*
*
* Where:
*
*
* -
*
* app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
*
*
* -
*
* targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.
*
*
*
*
* To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.
*
*
* @param resourceLabel
* A label that uniquely identifies a specific Application Load Balancer target group from which to determine
* the total and average request count served by your Auto Scaling group. You can't specify a resource label
* unless the target group is attached to the Auto Scaling group.
*
* You create the resource label by appending the final portion of the load balancer ARN and the final
* portion of the target group ARN into a single value, separated by a forward slash (/). The format of the
* resource label is:
*
*
* app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff
.
*
*
* Where:
*
*
* -
*
* app/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN
*
*
* -
*
* targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group
* ARN.
*
*
*
*
* To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PredictiveScalingPredefinedMetricPair withResourceLabel(String resourceLabel) {
setResourceLabel(resourceLabel);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getPredefinedMetricType() != null)
sb.append("PredefinedMetricType: ").append(getPredefinedMetricType()).append(",");
if (getResourceLabel() != null)
sb.append("ResourceLabel: ").append(getResourceLabel());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PredictiveScalingPredefinedMetricPair == false)
return false;
PredictiveScalingPredefinedMetricPair other = (PredictiveScalingPredefinedMetricPair) obj;
if (other.getPredefinedMetricType() == null ^ this.getPredefinedMetricType() == null)
return false;
if (other.getPredefinedMetricType() != null && other.getPredefinedMetricType().equals(this.getPredefinedMetricType()) == false)
return false;
if (other.getResourceLabel() == null ^ this.getResourceLabel() == null)
return false;
if (other.getResourceLabel() != null && other.getResourceLabel().equals(this.getResourceLabel()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPredefinedMetricType() == null) ? 0 : getPredefinedMetricType().hashCode());
hashCode = prime * hashCode + ((getResourceLabel() == null) ? 0 : getResourceLabel().hashCode());
return hashCode;
}
@Override
public PredictiveScalingPredefinedMetricPair clone() {
try {
return (PredictiveScalingPredefinedMetricPair) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}