com.aliyun.sdk.service.ess20220222.models.RemoveInstancesRequest Maven / Gradle / Ivy
Show all versions of alibabacloud-ess20220222 Show documentation
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.ess20220222.models;
import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;
/**
*
* {@link RemoveInstancesRequest} extends {@link RequestModel}
*
* RemoveInstancesRequest
*/
public class RemoveInstancesRequest extends Request {
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ClientToken")
private String clientToken;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("DecreaseDesiredCapacity")
private Boolean decreaseDesiredCapacity;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("IgnoreInvalidInstance")
private Boolean ignoreInvalidInstance;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("InstanceIds")
@com.aliyun.core.annotation.Validation(required = true)
private java.util.List < String > instanceIds;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("OwnerAccount")
private String ownerAccount;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("OwnerId")
private Long ownerId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("RegionId")
private String regionId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("RemovePolicy")
private String removePolicy;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ResourceOwnerAccount")
private String resourceOwnerAccount;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ResourceOwnerId")
private Long resourceOwnerId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ScalingGroupId")
@com.aliyun.core.annotation.Validation(required = true)
private String scalingGroupId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("StopInstanceTimeout")
private Integer stopInstanceTimeout;
private RemoveInstancesRequest(Builder builder) {
super(builder);
this.clientToken = builder.clientToken;
this.decreaseDesiredCapacity = builder.decreaseDesiredCapacity;
this.ignoreInvalidInstance = builder.ignoreInvalidInstance;
this.instanceIds = builder.instanceIds;
this.ownerAccount = builder.ownerAccount;
this.ownerId = builder.ownerId;
this.regionId = builder.regionId;
this.removePolicy = builder.removePolicy;
this.resourceOwnerAccount = builder.resourceOwnerAccount;
this.resourceOwnerId = builder.resourceOwnerId;
this.scalingGroupId = builder.scalingGroupId;
this.stopInstanceTimeout = builder.stopInstanceTimeout;
}
public static Builder builder() {
return new Builder();
}
public static RemoveInstancesRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return clientToken
*/
public String getClientToken() {
return this.clientToken;
}
/**
* @return decreaseDesiredCapacity
*/
public Boolean getDecreaseDesiredCapacity() {
return this.decreaseDesiredCapacity;
}
/**
* @return ignoreInvalidInstance
*/
public Boolean getIgnoreInvalidInstance() {
return this.ignoreInvalidInstance;
}
/**
* @return instanceIds
*/
public java.util.List < String > getInstanceIds() {
return this.instanceIds;
}
/**
* @return ownerAccount
*/
public String getOwnerAccount() {
return this.ownerAccount;
}
/**
* @return ownerId
*/
public Long getOwnerId() {
return this.ownerId;
}
/**
* @return regionId
*/
public String getRegionId() {
return this.regionId;
}
/**
* @return removePolicy
*/
public String getRemovePolicy() {
return this.removePolicy;
}
/**
* @return resourceOwnerAccount
*/
public String getResourceOwnerAccount() {
return this.resourceOwnerAccount;
}
/**
* @return resourceOwnerId
*/
public Long getResourceOwnerId() {
return this.resourceOwnerId;
}
/**
* @return scalingGroupId
*/
public String getScalingGroupId() {
return this.scalingGroupId;
}
/**
* @return stopInstanceTimeout
*/
public Integer getStopInstanceTimeout() {
return this.stopInstanceTimeout;
}
public static final class Builder extends Request.Builder {
private String clientToken;
private Boolean decreaseDesiredCapacity;
private Boolean ignoreInvalidInstance;
private java.util.List < String > instanceIds;
private String ownerAccount;
private Long ownerId;
private String regionId;
private String removePolicy;
private String resourceOwnerAccount;
private Long resourceOwnerId;
private String scalingGroupId;
private Integer stopInstanceTimeout;
private Builder() {
super();
}
private Builder(RemoveInstancesRequest request) {
super(request);
this.clientToken = request.clientToken;
this.decreaseDesiredCapacity = request.decreaseDesiredCapacity;
this.ignoreInvalidInstance = request.ignoreInvalidInstance;
this.instanceIds = request.instanceIds;
this.ownerAccount = request.ownerAccount;
this.ownerId = request.ownerId;
this.regionId = request.regionId;
this.removePolicy = request.removePolicy;
this.resourceOwnerAccount = request.resourceOwnerAccount;
this.resourceOwnerId = request.resourceOwnerId;
this.scalingGroupId = request.scalingGroupId;
this.stopInstanceTimeout = request.stopInstanceTimeout;
}
/**
* The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.
*
* example:
* 123e4567-e89b-12d3-a456-42665544****
*/
public Builder clientToken(String clientToken) {
this.putQueryParameter("ClientToken", clientToken);
this.clientToken = clientToken;
return this;
}
/**
* Specifies whether to adjust the expected number of ECS instances in the scaling group. Valid values:
*
* - true: After ECS instances are removed from the scaling group, the expected number of ECS instances in the scaling group decreases.
* - false: After ECS instances are removed from the scaling group, the expected number of ECS instances in the scaling group remains unchanged.
*
* Default value: true.
*
* example:
* true
*/
public Builder decreaseDesiredCapacity(Boolean decreaseDesiredCapacity) {
this.putQueryParameter("DecreaseDesiredCapacity", decreaseDesiredCapacity);
this.decreaseDesiredCapacity = decreaseDesiredCapacity;
return this;
}
/**
* Specifies whether to ignore invalid instances when you remove a batch of instances from the scaling group. Valid values:
*
* - true: ignores invalid instances. If invalid instances exist and valid instances are deleted, the corresponding scaling activity enters the Warning state. You can check the scaling activity details to view the invalid instances that are ignored.
* - false: does not ignore invalid instances. If invalid instances exist in the batch of instances that you want to remove from the scaling group, an error is reported.
*
* Default value: false.
*
* example:
* false
*/
public Builder ignoreInvalidInstance(Boolean ignoreInvalidInstance) {
this.putQueryParameter("IgnoreInvalidInstance", ignoreInvalidInstance);
this.ignoreInvalidInstance = ignoreInvalidInstance;
return this;
}
/**
* The IDs of the ECS instances that you want to remove from the scaling group.
* This parameter is required.
*/
public Builder instanceIds(java.util.List < String > instanceIds) {
this.putQueryParameter("InstanceIds", instanceIds);
this.instanceIds = instanceIds;
return this;
}
/**
* OwnerAccount.
*/
public Builder ownerAccount(String ownerAccount) {
this.putQueryParameter("OwnerAccount", ownerAccount);
this.ownerAccount = ownerAccount;
return this;
}
/**
* OwnerId.
*/
public Builder ownerId(Long ownerId) {
this.putQueryParameter("OwnerId", ownerId);
this.ownerId = ownerId;
return this;
}
/**
* The region ID of the scaling group.
*
* example:
* cn-qingdao
*/
public Builder regionId(String regionId) {
this.putQueryParameter("RegionId", regionId);
this.regionId = regionId;
return this;
}
/**
* The action subsequent to the removal of the Elastic Compute Service (ECS) instances. Valid values:
*
* recycle: The ECS instances enter the Economical Mode.
* **
* Note This setting is applicable only if you set ScalingPolicy
to recycle
.
*
* release: The ECS instances are released.
*
*
* ScalingPolicy of the CreateScalingGroup operation specifies the reclaim mode of the scaling group while RemovePolicy of the RemoveInstances operation specifies the subsequent action when an ECS instance is removed from the scaling group. Examples:
*
* - If you set ScalingPolicy and RemovePolicy to recycle, the ECS instances enter the Economical Mode when they are removed.
* - If you set ScalingPolicy to recycle and RemovePolicy to release, the ECS instances are released when they are removed.
* - If you set ScalingPolicy to release and RemovePolicy to recycle, the ECS instances are released when they are removed.
* - If you set ScalingPolicy and RemovePolicy to release, the ECS instances are released when they are removed.
*
* Default value: release.
*
* example:
* release
*/
public Builder removePolicy(String removePolicy) {
this.putQueryParameter("RemovePolicy", removePolicy);
this.removePolicy = removePolicy;
return this;
}
/**
* ResourceOwnerAccount.
*/
public Builder resourceOwnerAccount(String resourceOwnerAccount) {
this.putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount);
this.resourceOwnerAccount = resourceOwnerAccount;
return this;
}
/**
* ResourceOwnerId.
*/
public Builder resourceOwnerId(Long resourceOwnerId) {
this.putQueryParameter("ResourceOwnerId", resourceOwnerId);
this.resourceOwnerId = resourceOwnerId;
return this;
}
/**
* The ID of the scaling group.
* This parameter is required.
*
* example:
* asg-bp18p2yfxow2dloq****
*/
public Builder scalingGroupId(String scalingGroupId) {
this.putQueryParameter("ScalingGroupId", scalingGroupId);
this.scalingGroupId = scalingGroupId;
return this;
}
/**
* The period of time that is required by the Elastic Compute Service (ECS) instance to enter the Stopped state during the scale-in process. Unit: seconds. Valid values: 30 to 240.
*
*
*
* By default, this parameter inherits the value of StopInstanceTimeout specified in the CreateScalingGroup or ModifyScalingGroup operation. You can also specify a different value for this parameter in the RemoveInstances operation.
*
* This parameter takes effect only if you set RemovePolicy to release.
If you specify this parameter, the system proceeds with the scale-in process only after the period of time specified by StopInstanceTimeout ends. In this case, the scale-in operation continues regardless of whether the ECS instance enters the Stopped state or not.
If you do not specify this parameter, the system proceeds with the scale-in process only after the ECS instance enters the Stopped state. If the ECS instance fails to enter the Stopped state, the scale-in process rolls back, and the scale-in operation is considered as failed.
*
*
*
* example:
* 60
*/
public Builder stopInstanceTimeout(Integer stopInstanceTimeout) {
this.putQueryParameter("StopInstanceTimeout", stopInstanceTimeout);
this.stopInstanceTimeout = stopInstanceTimeout;
return this;
}
@Override
public RemoveInstancesRequest build() {
return new RemoveInstancesRequest(this);
}
}
}