/** * <p> * The name of the Auto Scaling group. * </p> * * @param autoScalingGroupName * The name of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAutoScalingGroupRequest withAutoScalingGroupName(String autoScalingGroupName) { setAutoScalingGroupName(autoScalingGroupName); return this; }
/** * <p> * The number of EC2 instances that should be running in the Auto Scaling group. This number must be greater than or * equal to the minimum size of the group and less than or equal to the maximum size of the group. * </p> * * @param desiredCapacity * The number of EC2 instances that should be running in the Auto Scaling group. This number must be greater * than or equal to the minimum size of the group and less than or equal to the maximum size of the group. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAutoScalingGroupRequest withDesiredCapacity(Integer desiredCapacity) { setDesiredCapacity(desiredCapacity); return this; }
/** * <p> * The maximum size of the Auto Scaling group. * </p> * * @param maxSize * The maximum size of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAutoScalingGroupRequest withMaxSize(Integer maxSize) { setMaxSize(maxSize); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode()); hashCode = prime * hashCode + ((getLaunchConfigurationName() == null) ? 0 : getLaunchConfigurationName().hashCode()); hashCode = prime * hashCode + ((getLaunchTemplate() == null) ? 0 : getLaunchTemplate().hashCode()); hashCode = prime * hashCode + ((getMixedInstancesPolicy() == null) ? 0 : getMixedInstancesPolicy().hashCode()); hashCode = prime * hashCode + ((getMinSize() == null) ? 0 : getMinSize().hashCode()); hashCode = prime * hashCode + ((getMaxSize() == null) ? 0 : getMaxSize().hashCode()); hashCode = prime * hashCode + ((getDesiredCapacity() == null) ? 0 : getDesiredCapacity().hashCode()); hashCode = prime * hashCode + ((getDefaultCooldown() == null) ? 0 : getDefaultCooldown().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode()); hashCode = prime * hashCode + ((getHealthCheckType() == null) ? 0 : getHealthCheckType().hashCode()); hashCode = prime * hashCode + ((getHealthCheckGracePeriod() == null) ? 0 : getHealthCheckGracePeriod().hashCode()); hashCode = prime * hashCode + ((getPlacementGroup() == null) ? 0 : getPlacementGroup().hashCode()); hashCode = prime * hashCode + ((getVPCZoneIdentifier() == null) ? 0 : getVPCZoneIdentifier().hashCode()); hashCode = prime * hashCode + ((getTerminationPolicies() == null) ? 0 : getTerminationPolicies().hashCode()); hashCode = prime * hashCode + ((getNewInstancesProtectedFromScaleIn() == null) ? 0 : getNewInstancesProtectedFromScaleIn().hashCode()); hashCode = prime * hashCode + ((getServiceLinkedRoleARN() == null) ? 0 : getServiceLinkedRoleARN().hashCode()); return hashCode; }
@Override public void expandRacMembership(int count) { AmazonAutoScaling client = null; try { client = getAutoScalingClient(); DescribeAutoScalingGroupsRequest asgReq = new DescribeAutoScalingGroupsRequest() .withAutoScalingGroupNames(instanceInfo.getAutoScalingGroup()); DescribeAutoScalingGroupsResult res = client.describeAutoScalingGroups(asgReq); AutoScalingGroup asg = res.getAutoScalingGroups().get(0); UpdateAutoScalingGroupRequest ureq = new UpdateAutoScalingGroupRequest(); ureq.setAutoScalingGroupName(asg.getAutoScalingGroupName()); ureq.setMinSize(asg.getMinSize() + 1); ureq.setMaxSize(asg.getMinSize() + 1); ureq.setDesiredCapacity(asg.getMinSize() + 1); client.updateAutoScalingGroup(ureq); } finally { if (client != null) client.shutdown(); } }
public void setMinimalCapacity(int cap) { log.info("Set minimal capacity for group to " + cap); awsAsClient.updateAutoScalingGroup(new UpdateAutoScalingGroupRequest().withAutoScalingGroupName(activeConfiguration.getAutoScalingGroupId()).withMinSize(cap)); }
/** * <p> * The minimum size of the Auto Scaling group. * </p> * * @param minSize * The minimum size of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateAutoScalingGroupRequest withMinSize(Integer minSize) { setMinSize(minSize); return this; }
/** * <p> * One or more Availability Zones for the group. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param availabilityZones <p> * One or more Availability Zones for the group. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public UpdateAutoScalingGroupRequest withAvailabilityZones(String... availabilityZones) { if (getAvailabilityZones() == null) { this.availabilityZones = new java.util.ArrayList<String>(availabilityZones.length); } for (String value : availabilityZones) { this.availabilityZones.add(value); } return this; }
return false; UpdateAutoScalingGroupRequest other = (UpdateAutoScalingGroupRequest) obj; if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == null) return false; if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == false) return false; if (other.getLaunchConfigurationName() == null ^ this.getLaunchConfigurationName() == null) return false; if (other.getLaunchConfigurationName() != null && other.getLaunchConfigurationName().equals(this.getLaunchConfigurationName()) == false) return false; if (other.getLaunchTemplate() == null ^ this.getLaunchTemplate() == null) return false; if (other.getLaunchTemplate() != null && other.getLaunchTemplate().equals(this.getLaunchTemplate()) == false) return false; if (other.getMixedInstancesPolicy() == null ^ this.getMixedInstancesPolicy() == null) return false; if (other.getMixedInstancesPolicy() != null && other.getMixedInstancesPolicy().equals(this.getMixedInstancesPolicy()) == false) return false; if (other.getMinSize() == null ^ this.getMinSize() == null) return false; if (other.getMinSize() != null && other.getMinSize().equals(this.getMinSize()) == false) return false; if (other.getMaxSize() == null ^ this.getMaxSize() == null) return false; if (other.getMaxSize() != null && other.getMaxSize().equals(this.getMaxSize()) == false) return false; if (other.getDesiredCapacity() == null ^ this.getDesiredCapacity() == null) return false; if (other.getDesiredCapacity() != null && other.getDesiredCapacity().equals(this.getDesiredCapacity()) == false)
@Override public void expandRacMembership(int count) { AmazonAutoScaling client = null; try { client = getAutoScalingClient(); DescribeAutoScalingGroupsRequest asgReq = new DescribeAutoScalingGroupsRequest() .withAutoScalingGroupNames(envVariables.getRack()); DescribeAutoScalingGroupsResult res = client.describeAutoScalingGroups(asgReq); AutoScalingGroup asg = res.getAutoScalingGroups().get(0); UpdateAutoScalingGroupRequest ureq = new UpdateAutoScalingGroupRequest(); ureq.setAutoScalingGroupName(asg.getAutoScalingGroupName()); ureq.setMinSize(asg.getMinSize() + 1); ureq.setMaxSize(asg.getMinSize() + 1); ureq.setDesiredCapacity(asg.getMinSize() + 1); client.updateAutoScalingGroup(ureq); } finally { if (client != null) client.shutdown(); } }
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAutoScalingGroupName() != null) sb.append("AutoScalingGroupName: ").append(getAutoScalingGroupName()).append(","); if (getLaunchConfigurationName() != null) sb.append("LaunchConfigurationName: ").append(getLaunchConfigurationName()).append(","); if (getLaunchTemplate() != null) sb.append("LaunchTemplate: ").append(getLaunchTemplate()).append(","); if (getMixedInstancesPolicy() != null) sb.append("MixedInstancesPolicy: ").append(getMixedInstancesPolicy()).append(","); if (getMinSize() != null) sb.append("MinSize: ").append(getMinSize()).append(","); if (getMaxSize() != null) sb.append("MaxSize: ").append(getMaxSize()).append(","); if (getDesiredCapacity() != null) sb.append("DesiredCapacity: ").append(getDesiredCapacity()).append(","); if (getDefaultCooldown() != null) sb.append("DefaultCooldown: ").append(getDefaultCooldown()).append(","); if (getAvailabilityZones() != null) sb.append("AvailabilityZones: ").append(getAvailabilityZones()).append(","); if (getHealthCheckType() != null) sb.append("HealthCheckType: ").append(getHealthCheckType()).append(","); if (getHealthCheckGracePeriod() != null) sb.append("HealthCheckGracePeriod: ").append(getHealthCheckGracePeriod()).append(","); if (getPlacementGroup() != null) sb.append("PlacementGroup: ").append(getPlacementGroup()).append(","); if (getVPCZoneIdentifier() != null) sb.append("VPCZoneIdentifier: ").append(getVPCZoneIdentifier()).append(","); if (getTerminationPolicies() != null)
@Override public void expandRacMembership(int count) { AmazonAutoScaling client = null; try { client = getAutoScalingClient(); DescribeAutoScalingGroupsRequest asgReq = new DescribeAutoScalingGroupsRequest().withAutoScalingGroupNames(config.getASGName()); DescribeAutoScalingGroupsResult res = client.describeAutoScalingGroups(asgReq); AutoScalingGroup asg = res.getAutoScalingGroups().get(0); UpdateAutoScalingGroupRequest ureq = new UpdateAutoScalingGroupRequest(); ureq.setAutoScalingGroupName(asg.getAutoScalingGroupName()); ureq.setMinSize(asg.getMinSize() + 1); ureq.setMaxSize(asg.getMinSize() + 1); ureq.setDesiredCapacity(asg.getMinSize() + 1); client.updateAutoScalingGroup(ureq); } finally { if (client != null) client.shutdown(); } }
if (updateAutoScalingGroupRequest.getAutoScalingGroupName() != null) { request.addParameter("AutoScalingGroupName", StringUtils.fromString(updateAutoScalingGroupRequest.getAutoScalingGroupName())); if (updateAutoScalingGroupRequest.getLaunchConfigurationName() != null) { request.addParameter("LaunchConfigurationName", StringUtils.fromString(updateAutoScalingGroupRequest.getLaunchConfigurationName())); LaunchTemplateSpecification launchTemplate = updateAutoScalingGroupRequest.getLaunchTemplate(); if (launchTemplate != null) { MixedInstancesPolicy mixedInstancesPolicy = updateAutoScalingGroupRequest.getMixedInstancesPolicy(); if (mixedInstancesPolicy != null) { if (updateAutoScalingGroupRequest.getMinSize() != null) { request.addParameter("MinSize", StringUtils.fromInteger(updateAutoScalingGroupRequest.getMinSize())); if (updateAutoScalingGroupRequest.getMaxSize() != null) { request.addParameter("MaxSize", StringUtils.fromInteger(updateAutoScalingGroupRequest.getMaxSize())); if (updateAutoScalingGroupRequest.getDesiredCapacity() != null) { request.addParameter("DesiredCapacity", StringUtils.fromInteger(updateAutoScalingGroupRequest.getDesiredCapacity())); if (updateAutoScalingGroupRequest.getDefaultCooldown() != null) { request.addParameter("DefaultCooldown", StringUtils.fromInteger(updateAutoScalingGroupRequest.getDefaultCooldown())); if (!updateAutoScalingGroupRequest.getAvailabilityZones().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) updateAutoScalingGroupRequest.getAvailabilityZones()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<String> availabilityZonesList = (com.amazonaws.internal.SdkInternalList<String>) updateAutoScalingGroupRequest .getAvailabilityZones(); int availabilityZonesListIndex = 1;
+ ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode()); hashCode = prime + ((getLaunchConfigurationName() == null) ? 0 : getLaunchConfigurationName() .hashCode()); hashCode = prime * hashCode + ((getLaunchTemplate() == null) ? 0 : getLaunchTemplate().hashCode()); hashCode = prime * hashCode + ((getMixedInstancesPolicy() == null) ? 0 : getMixedInstancesPolicy().hashCode()); hashCode = prime * hashCode + ((getMinSize() == null) ? 0 : getMinSize().hashCode()); hashCode = prime * hashCode + ((getMaxSize() == null) ? 0 : getMaxSize().hashCode()); hashCode = prime * hashCode + ((getDesiredCapacity() == null) ? 0 : getDesiredCapacity().hashCode()); hashCode = prime * hashCode + ((getDefaultCooldown() == null) ? 0 : getDefaultCooldown().hashCode()); hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode()); hashCode = prime * hashCode + ((getHealthCheckType() == null) ? 0 : getHealthCheckType().hashCode()); hashCode = prime + ((getHealthCheckGracePeriod() == null) ? 0 : getHealthCheckGracePeriod() .hashCode()); hashCode = prime * hashCode + ((getPlacementGroup() == null) ? 0 : getPlacementGroup().hashCode()); hashCode = prime * hashCode + ((getVPCZoneIdentifier() == null) ? 0 : getVPCZoneIdentifier().hashCode()); hashCode = prime * hashCode + ((getTerminationPolicies() == null) ? 0 : getTerminationPolicies().hashCode());
StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAutoScalingGroupName() != null) sb.append("AutoScalingGroupName: " + getAutoScalingGroupName() + ","); if (getLaunchConfigurationName() != null) sb.append("LaunchConfigurationName: " + getLaunchConfigurationName() + ","); if (getLaunchTemplate() != null) sb.append("LaunchTemplate: " + getLaunchTemplate() + ","); if (getMixedInstancesPolicy() != null) sb.append("MixedInstancesPolicy: " + getMixedInstancesPolicy() + ","); if (getMinSize() != null) sb.append("MinSize: " + getMinSize() + ","); if (getMaxSize() != null) sb.append("MaxSize: " + getMaxSize() + ","); if (getDesiredCapacity() != null) sb.append("DesiredCapacity: " + getDesiredCapacity() + ","); if (getDefaultCooldown() != null) sb.append("DefaultCooldown: " + getDefaultCooldown() + ","); if (getAvailabilityZones() != null) sb.append("AvailabilityZones: " + getAvailabilityZones() + ","); if (getHealthCheckType() != null) sb.append("HealthCheckType: " + getHealthCheckType() + ","); if (getHealthCheckGracePeriod() != null) sb.append("HealthCheckGracePeriod: " + getHealthCheckGracePeriod() + ","); if (getPlacementGroup() != null) sb.append("PlacementGroup: " + getPlacementGroup() + ","); if (getVPCZoneIdentifier() != null) sb.append("VPCZoneIdentifier: " + getVPCZoneIdentifier() + ","); if (getTerminationPolicies() != null)
if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == null) return false; if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == false) return false; if (other.getLaunchConfigurationName() == null ^ this.getLaunchConfigurationName() == null) return false; if (other.getLaunchConfigurationName() != null && other.getLaunchConfigurationName().equals(this.getLaunchConfigurationName()) == false) return false; if (other.getLaunchTemplate() == null ^ this.getLaunchTemplate() == null) return false; if (other.getLaunchTemplate() != null && other.getLaunchTemplate().equals(this.getLaunchTemplate()) == false) return false; if (other.getMixedInstancesPolicy() == null ^ this.getMixedInstancesPolicy() == null) return false; if (other.getMixedInstancesPolicy() != null && other.getMixedInstancesPolicy().equals(this.getMixedInstancesPolicy()) == false) return false; if (other.getMinSize() == null ^ this.getMinSize() == null) return false; if (other.getMinSize() != null && other.getMinSize().equals(this.getMinSize()) == false) return false; if (other.getMaxSize() == null ^ this.getMaxSize() == null) return false; if (other.getMaxSize() != null && other.getMaxSize().equals(this.getMaxSize()) == false) return false; if (other.getDesiredCapacity() == null ^ this.getDesiredCapacity() == null)
if (updateAutoScalingGroupRequest.getAutoScalingGroupName() != null) { prefix = "AutoScalingGroupName"; String autoScalingGroupName = updateAutoScalingGroupRequest.getAutoScalingGroupName(); request.addParameter(prefix, StringUtils.fromString(autoScalingGroupName)); if (updateAutoScalingGroupRequest.getLaunchConfigurationName() != null) { prefix = "LaunchConfigurationName"; String launchConfigurationName = updateAutoScalingGroupRequest .getLaunchConfigurationName(); request.addParameter(prefix, StringUtils.fromString(launchConfigurationName)); if (updateAutoScalingGroupRequest.getLaunchTemplate() != null) { prefix = "LaunchTemplate"; LaunchTemplateSpecification launchTemplate = updateAutoScalingGroupRequest .getLaunchTemplate(); LaunchTemplateSpecificationStaxMarshaller.getInstance().marshall(launchTemplate, request, prefix + "."); if (updateAutoScalingGroupRequest.getMixedInstancesPolicy() != null) { prefix = "MixedInstancesPolicy"; MixedInstancesPolicy mixedInstancesPolicy = updateAutoScalingGroupRequest .getMixedInstancesPolicy(); MixedInstancesPolicyStaxMarshaller.getInstance().marshall(mixedInstancesPolicy, request, prefix + "."); if (updateAutoScalingGroupRequest.getMinSize() != null) { prefix = "MinSize"; Integer minSize = updateAutoScalingGroupRequest.getMinSize(); request.addParameter(prefix, StringUtils.fromInteger(minSize));