com.aliyun.sdk.service.ecs20140526.models.CreateCapacityReservationRequest 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 CreateCapacityReservationRequest} extends {@link RequestModel}
*
* CreateCapacityReservationRequest
*/
public class CreateCapacityReservationRequest extends Request {
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("PrivatePoolOptions")
private PrivatePoolOptions privatePoolOptions;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ClientToken")
private String clientToken;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Description")
private String description;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("EndTime")
private String endTime;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("EndTimeType")
private String endTimeType;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("InstanceAmount")
@com.aliyun.core.annotation.Validation(required = true, minimum = 1)
private Integer instanceAmount;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("InstanceType")
@com.aliyun.core.annotation.Validation(required = true)
private String instanceType;
@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("Platform")
private String platform;
@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("ResourceGroupId")
private String resourceGroupId;
@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("StartTime")
private String startTime;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Tag")
private java.util.List < Tag> tag;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ZoneId")
@com.aliyun.core.annotation.Validation(required = true)
private java.util.List < String > zoneId;
private CreateCapacityReservationRequest(Builder builder) {
super(builder);
this.privatePoolOptions = builder.privatePoolOptions;
this.clientToken = builder.clientToken;
this.description = builder.description;
this.endTime = builder.endTime;
this.endTimeType = builder.endTimeType;
this.instanceAmount = builder.instanceAmount;
this.instanceType = builder.instanceType;
this.ownerAccount = builder.ownerAccount;
this.ownerId = builder.ownerId;
this.platform = builder.platform;
this.regionId = builder.regionId;
this.resourceGroupId = builder.resourceGroupId;
this.resourceOwnerAccount = builder.resourceOwnerAccount;
this.resourceOwnerId = builder.resourceOwnerId;
this.startTime = builder.startTime;
this.tag = builder.tag;
this.zoneId = builder.zoneId;
}
public static Builder builder() {
return new Builder();
}
public static CreateCapacityReservationRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return privatePoolOptions
*/
public PrivatePoolOptions getPrivatePoolOptions() {
return this.privatePoolOptions;
}
/**
* @return clientToken
*/
public String getClientToken() {
return this.clientToken;
}
/**
* @return description
*/
public String getDescription() {
return this.description;
}
/**
* @return endTime
*/
public String getEndTime() {
return this.endTime;
}
/**
* @return endTimeType
*/
public String getEndTimeType() {
return this.endTimeType;
}
/**
* @return instanceAmount
*/
public Integer getInstanceAmount() {
return this.instanceAmount;
}
/**
* @return instanceType
*/
public String getInstanceType() {
return this.instanceType;
}
/**
* @return ownerAccount
*/
public String getOwnerAccount() {
return this.ownerAccount;
}
/**
* @return ownerId
*/
public Long getOwnerId() {
return this.ownerId;
}
/**
* @return platform
*/
public String getPlatform() {
return this.platform;
}
/**
* @return regionId
*/
public String getRegionId() {
return this.regionId;
}
/**
* @return resourceGroupId
*/
public String getResourceGroupId() {
return this.resourceGroupId;
}
/**
* @return resourceOwnerAccount
*/
public String getResourceOwnerAccount() {
return this.resourceOwnerAccount;
}
/**
* @return resourceOwnerId
*/
public Long getResourceOwnerId() {
return this.resourceOwnerId;
}
/**
* @return startTime
*/
public String getStartTime() {
return this.startTime;
}
/**
* @return tag
*/
public java.util.List < Tag> getTag() {
return this.tag;
}
/**
* @return zoneId
*/
public java.util.List < String > getZoneId() {
return this.zoneId;
}
public static final class Builder extends Request.Builder {
private PrivatePoolOptions privatePoolOptions;
private String clientToken;
private String description;
private String endTime;
private String endTimeType;
private Integer instanceAmount;
private String instanceType;
private String ownerAccount;
private Long ownerId;
private String platform;
private String regionId;
private String resourceGroupId;
private String resourceOwnerAccount;
private Long resourceOwnerId;
private String startTime;
private java.util.List < Tag> tag;
private java.util.List < String > zoneId;
private Builder() {
super();
}
private Builder(CreateCapacityReservationRequest request) {
super(request);
this.privatePoolOptions = request.privatePoolOptions;
this.clientToken = request.clientToken;
this.description = request.description;
this.endTime = request.endTime;
this.endTimeType = request.endTimeType;
this.instanceAmount = request.instanceAmount;
this.instanceType = request.instanceType;
this.ownerAccount = request.ownerAccount;
this.ownerId = request.ownerId;
this.platform = request.platform;
this.regionId = request.regionId;
this.resourceGroupId = request.resourceGroupId;
this.resourceOwnerAccount = request.resourceOwnerAccount;
this.resourceOwnerId = request.resourceOwnerId;
this.startTime = request.startTime;
this.tag = request.tag;
this.zoneId = request.zoneId;
}
/**
* PrivatePoolOptions.
*/
public Builder privatePoolOptions(PrivatePoolOptions privatePoolOptions) {
this.putQueryParameter("PrivatePoolOptions", privatePoolOptions);
this.privatePoolOptions = privatePoolOptions;
return this;
}
/**
* The client token that is used to ensure the idempotency 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:
* 0c593ea1-3bea-11e9-b96b-88e9fe637760
*/
public Builder clientToken(String clientToken) {
this.putQueryParameter("ClientToken", clientToken);
this.clientToken = clientToken;
return this;
}
/**
* The description of the capacity reservation. The description must be 2 to 256 characters in length and cannot start with http://
or https://
.
* This parameter is empty by default.
*
* example:
* This is description.
*/
public Builder description(String description) {
this.putQueryParameter("Description", description);
this.description = description;
return this;
}
/**
* The time when the capacity reservation expires. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ
format. The time must be in UTC. For more information, see ISO 8601.
*
* example:
* 2021-10-30T06:32:00Z
*/
public Builder endTime(String endTime) {
this.putQueryParameter("EndTime", endTime);
this.endTime = endTime;
return this;
}
/**
* The release mode of the capacity reservation. Valid values:
*
* - Limited: The capacity reservation is automatically released at a specified time. If you specify this parameter, you must specify the
EndTime
parameter.
* - Unlimited: The capacity reservation is manually released. The capacity reservation can be released anytime.
*
*
* example:
* Unlimited
*/
public Builder endTimeType(String endTimeType) {
this.putQueryParameter("EndTimeType", endTimeType);
this.endTimeType = endTimeType;
return this;
}
/**
* The total number of instances for which the capacity of an instance type is reserved.
* This parameter is required.
*
* example:
* 2
*/
public Builder instanceAmount(Integer instanceAmount) {
this.putQueryParameter("InstanceAmount", instanceAmount);
this.instanceAmount = instanceAmount;
return this;
}
/**
* The instance type. You can create a capacity reservation to reserve the capacity of only one instance type. You can call the DescribeInstanceTypes operation to query the instance types provided by ECS.
* This parameter is required.
*
* example:
* ecs.g6.xlarge
*/
public Builder instanceType(String instanceType) {
this.putQueryParameter("InstanceType", instanceType);
this.instanceType = instanceType;
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 operating system of the image used by the instance. This parameter corresponds to the Platform
parameter of regional reserved instances. If the operating system of a capacity reservation matches the operating system of a regional reserved instance, you can apply the regional reserved instance to offset fees of the unused capacity of the capacity reservation. Valid values:
*
* - Windows: Windows Server operating system
* - Linux: Linux and UNIX-like operating system
*
* Default value: Linux.
*
* This parameter is unavailable.
*
*
* example:
* Linux
*/
public Builder platform(String platform) {
this.putQueryParameter("Platform", platform);
this.platform = platform;
return this;
}
/**
* The ID of the region in which to create the capacity reservation. 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;
}
/**
* The ID of the resource group to which you want to assign the capacity reservation.
*
* example:
* rg-bp67acfmxazb4p****
*/
public Builder resourceGroupId(String resourceGroupId) {
this.putQueryParameter("ResourceGroupId", resourceGroupId);
this.resourceGroupId = resourceGroupId;
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 mode in which the capacity reservation takes effect. You can call the CreateCapacityReservation operation to create only immediate capacity reservations.
*
* If you do not specify this parameter, the capacity reservation immediately takes effect.
*
*
* example:
* 2021-10-30T05:32:00Z
*/
public Builder startTime(String startTime) {
this.putQueryParameter("StartTime", startTime);
this.startTime = startTime;
return this;
}
/**
* The tags to add to the capacity reservation.
*/
public Builder tag(java.util.List < Tag> tag) {
this.putQueryParameter("Tag", tag);
this.tag = tag;
return this;
}
/**
* The ID of the zone in which you want to create the capacity reservation. A capacity reservation can reserve resources within only one zone.
* This parameter is required.
*
* example:
* cn-hangzhou-h
*/
public Builder zoneId(java.util.List < String > zoneId) {
this.putQueryParameter("ZoneId", zoneId);
this.zoneId = zoneId;
return this;
}
@Override
public CreateCapacityReservationRequest build() {
return new CreateCapacityReservationRequest(this);
}
}
/**
*
* {@link CreateCapacityReservationRequest} extends {@link TeaModel}
*
* CreateCapacityReservationRequest
*/
public static class PrivatePoolOptions extends TeaModel {
@com.aliyun.core.annotation.NameInMap("MatchCriteria")
private String matchCriteria;
@com.aliyun.core.annotation.NameInMap("Name")
private String name;
private PrivatePoolOptions(Builder builder) {
this.matchCriteria = builder.matchCriteria;
this.name = builder.name;
}
public static Builder builder() {
return new Builder();
}
public static PrivatePoolOptions create() {
return builder().build();
}
/**
* @return matchCriteria
*/
public String getMatchCriteria() {
return this.matchCriteria;
}
/**
* @return name
*/
public String getName() {
return this.name;
}
public static final class Builder {
private String matchCriteria;
private String name;
/**
* The type of the private pool to generate after the capacity reservation takes effect. Valid values:
*
* - Open: open private pool
* - Target: targeted private pool
*
* Default value: Open.
*
* example:
* Open
*/
public Builder matchCriteria(String matchCriteria) {
this.matchCriteria = matchCriteria;
return this;
}
/**
* The capacity reservation name. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http://
or https://
. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
*
* example:
* crpTestName
*/
public Builder name(String name) {
this.name = name;
return this;
}
public PrivatePoolOptions build() {
return new PrivatePoolOptions(this);
}
}
}
/**
*
* {@link CreateCapacityReservationRequest} extends {@link TeaModel}
*
* CreateCapacityReservationRequest
*/
public static class Tag extends TeaModel {
@com.aliyun.core.annotation.NameInMap("Key")
private String key;
@com.aliyun.core.annotation.NameInMap("Value")
private String value;
private Tag(Builder builder) {
this.key = builder.key;
this.value = builder.value;
}
public static Builder builder() {
return new Builder();
}
public static Tag create() {
return builder().build();
}
/**
* @return key
*/
public String getKey() {
return this.key;
}
/**
* @return value
*/
public String getValue() {
return this.value;
}
public static final class Builder {
private String key;
private String value;
/**
* The key of tag N to add to the capacity reservation. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http://
or https://
. The tag key cannot start with acs:
or aliyun
.
*
* example:
* TestKey
*/
public Builder key(String key) {
this.key = key;
return this;
}
/**
* The value of tag N to add to the capacity reservation. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain http://
or https://
. The tag value cannot start with acs:
.
*
* example:
* TestValue
*/
public Builder value(String value) {
this.value = value;
return this;
}
public Tag build() {
return new Tag(this);
}
}
}
}