com.aliyun.sdk.service.ecs20140526.models.StopInstancesRequest Maven / Gradle / Ivy
Show all versions of alibabacloud-ecs20140526 Show documentation
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.ecs20140526.models;
import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;
/**
*
* {@link StopInstancesRequest} extends {@link RequestModel}
*
* StopInstancesRequest
*/
public class StopInstancesRequest extends Request {
@com.aliyun.core.annotation.Host
@com.aliyun.core.annotation.NameInMap("SourceRegionId")
private String sourceRegionId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("BatchOptimization")
private String batchOptimization;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("DryRun")
private Boolean dryRun;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ForceStop")
private Boolean forceStop;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("InstanceId")
@com.aliyun.core.annotation.Validation(required = true)
private java.util.List < String > instanceId;
@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")
@com.aliyun.core.annotation.Validation(required = true)
private String regionId;
@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("StoppedMode")
private String stoppedMode;
private StopInstancesRequest(Builder builder) {
super(builder);
this.sourceRegionId = builder.sourceRegionId;
this.batchOptimization = builder.batchOptimization;
this.dryRun = builder.dryRun;
this.forceStop = builder.forceStop;
this.instanceId = builder.instanceId;
this.ownerAccount = builder.ownerAccount;
this.ownerId = builder.ownerId;
this.regionId = builder.regionId;
this.resourceOwnerAccount = builder.resourceOwnerAccount;
this.resourceOwnerId = builder.resourceOwnerId;
this.stoppedMode = builder.stoppedMode;
}
public static Builder builder() {
return new Builder();
}
public static StopInstancesRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return sourceRegionId
*/
public String getSourceRegionId() {
return this.sourceRegionId;
}
/**
* @return batchOptimization
*/
public String getBatchOptimization() {
return this.batchOptimization;
}
/**
* @return dryRun
*/
public Boolean getDryRun() {
return this.dryRun;
}
/**
* @return forceStop
*/
public Boolean getForceStop() {
return this.forceStop;
}
/**
* @return instanceId
*/
public java.util.List < String > getInstanceId() {
return this.instanceId;
}
/**
* @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 resourceOwnerAccount
*/
public String getResourceOwnerAccount() {
return this.resourceOwnerAccount;
}
/**
* @return resourceOwnerId
*/
public Long getResourceOwnerId() {
return this.resourceOwnerId;
}
/**
* @return stoppedMode
*/
public String getStoppedMode() {
return this.stoppedMode;
}
public static final class Builder extends Request.Builder {
private String sourceRegionId;
private String batchOptimization;
private Boolean dryRun;
private Boolean forceStop;
private java.util.List < String > instanceId;
private String ownerAccount;
private Long ownerId;
private String regionId;
private String resourceOwnerAccount;
private Long resourceOwnerId;
private String stoppedMode;
private Builder() {
super();
}
private Builder(StopInstancesRequest request) {
super(request);
this.sourceRegionId = request.sourceRegionId;
this.batchOptimization = request.batchOptimization;
this.dryRun = request.dryRun;
this.forceStop = request.forceStop;
this.instanceId = request.instanceId;
this.ownerAccount = request.ownerAccount;
this.ownerId = request.ownerId;
this.regionId = request.regionId;
this.resourceOwnerAccount = request.resourceOwnerAccount;
this.resourceOwnerId = request.resourceOwnerId;
this.stoppedMode = request.stoppedMode;
}
/**
* SourceRegionId.
*/
public Builder sourceRegionId(String sourceRegionId) {
this.putHostParameter("SourceRegionId", sourceRegionId);
this.sourceRegionId = sourceRegionId;
return this;
}
/**
* The batch operation mode. Valid values:
*
* - AllTogether: In this mode, if all instances are stopped, a success message is returned. If an instance fails the verification, all instances fail to stop and an error message is returned.
* - SuccessFirst: In this mode, each instance is separately stopped. The response contains the operation results for each instance.
*
* Default value: AllTogether.
*
* example:
* AllTogether
*/
public Builder batchOptimization(String batchOptimization) {
this.putQueryParameter("BatchOptimization", batchOptimization);
this.batchOptimization = batchOptimization;
return this;
}
/**
* Specifies whether to perform only a dry run, without performing the actual request. Valid values:
*
* - true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and instance status. If the request fails the dry run, an error message is returned. If the request passes the dry run,
DRYRUN.SUCCESS
is returned.
*
*
* If you set BatchOptimization
to SuccessFirst
and DryRun
to true, only DRYRUN.SUCCESS
is returned, regardless of whether the request passes the dry run.
*
*
* - false: performs a dry run and performs the actual request. If the request passes the dry run, instances are stopped.
*
* Default value: false.
*
* example:
* false
*/
public Builder dryRun(Boolean dryRun) {
this.putQueryParameter("DryRun", dryRun);
this.dryRun = dryRun;
return this;
}
/**
* Specifies whether to forcefully stop instances. Valid values:
*
* - true. This operation is equivalent to the typical power-off operation. Cache data that is not written to storage devices on instances is lost.
* - false.
*
* Default value: false.
*
* example:
* false
*/
public Builder forceStop(Boolean forceStop) {
this.putQueryParameter("ForceStop", forceStop);
this.forceStop = forceStop;
return this;
}
/**
* The IDs of instances.
* This parameter is required.
*
* example:
* i-bp67acfmxazb4p****
*/
public Builder instanceId(java.util.List < String > instanceId) {
this.putQueryParameter("InstanceId", instanceId);
this.instanceId = instanceId;
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 instance. You can call the DescribeRegions operation to query the most recent region list.
* This parameter is required.
*
* example:
* cn-hangzhou
*/
public Builder regionId(String regionId) {
this.putQueryParameter("RegionId", regionId);
this.regionId = regionId;
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 stop mode of the pay-as-you-go instance. Valid values:
*
* - StopCharging: economical mode. For information about how
StopCharging
takes effect, see the "Prerequisites" section in Economical mode.
* - KeepCharging: standard mode. After the instance is stopped in standard mode, you continue to be charged for it.
*
* Default value: If the prerequisites required for enabling economical mode are met and you have enabled the mode in the ECS console, the default value is StopCharging. For more information, see the "Enable economical mode" section in Economical mode
. Otherwise, the default value is KeepCharging
.
*
* example:
* KeepCharging
*/
public Builder stoppedMode(String stoppedMode) {
this.putQueryParameter("StoppedMode", stoppedMode);
this.stoppedMode = stoppedMode;
return this;
}
@Override
public StopInstancesRequest build() {
return new StopInstancesRequest(this);
}
}
}