RecommendInstanceTypes
This class encapsulates and extends the ROS resource type DATASOURCE::ECS::RecommendInstanceTypes
, which is used to query the recommended instance types of Elastic Compute Service (ECS) instances.
Initializers
import com.aliyun.ros.cdk.ecs.datasource.RecommendInstanceTypes;
RecommendInstanceTypes.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
// .cores(java.lang.Number)
// .cores(IResolvable)
// .instanceChargeType(java.lang.String)
// .instanceChargeType(IResolvable)
// .instanceFamilyLevel(java.lang.String)
// .instanceFamilyLevel(IResolvable)
// .instanceType(java.lang.String)
// .instanceType(IResolvable)
// .instanceTypeFamilies(IResolvable)
// .instanceTypeFamilies(java.util.List<java.lang.String)
// .instanceTypeFamilies(IResolvable>)
// .ioOptimized(java.lang.String)
// .ioOptimized(IResolvable)
// .maxPrice(java.lang.Number)
// .maxPrice(IResolvable)
// .memory(java.lang.Number)
// .memory(IResolvable)
// .priorityStrategy(java.lang.String)
// .priorityStrategy(IResolvable)
// .refreshOptions(java.lang.String)
// .refreshOptions(IResolvable)
// .scene(java.lang.String)
// .scene(IResolvable)
// .spotStrategy(java.lang.String)
// .spotStrategy(IResolvable)
// .systemDiskCategory(java.lang.String)
// .systemDiskCategory(IResolvable)
// .zoneId(java.lang.String)
// .zoneId(IResolvable)
// .zoneMatchMode(java.lang.String)
// .zoneMatchMode(IResolvable)
.build();
Name | Type | Description |
---|---|---|
scope |
com.aliyun.ros.cdk.core.Construct |
No description. |
id |
java.lang.String |
No description. |
enableResourcePropertyConstraint |
java.lang.Boolean |
No description. |
cores |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property cores: The number of vCPUs of the instance. |
instanceChargeType |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property instanceChargeType: The billing method of the instances of the instance type. |
instanceFamilyLevel |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property instanceFamilyLevel: The level of the instance family. |
instanceType |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property instanceType: The specified instance type. |
instanceTypeFamilies |
com.aliyun.ros.cdk.core.IResolvable OR java.util.List |
Property instanceTypeFamilies: The list of instance family to be filtered out. |
ioOptimized |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property ioOptimized: Specifies whether to match I\/O optimized instances. |
maxPrice |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property maxPrice: The maximum hourly price for pay-as-you-go instances or preemptible instances. |
memory |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
Property memory: The memory size of the instance. |
priorityStrategy |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property priorityStrategy: The policy for recommending instance types. |
refreshOptions |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property refreshOptions: The refresh strategy for the datasource resource when the stack is updated. |
scene |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property scene: Specifies the scenario in which the instance type is recommended. |
spotStrategy |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property spotStrategy: The bidding policy of preemptible instances. |
systemDiskCategory |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property systemDiskCategory: The category of the system disk. |
zoneId |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property zoneId: The zone ID of the alternative instance types. |
zoneMatchMode |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
Property zoneMatchMode: Specifies which alternative instance types are recommended. |
scope
Required
- Type: com.aliyun.ros.cdk.core.Construct
id
Required
- Type: java.lang.String
enableResourcePropertyConstraint
Optional
- Type: java.lang.Boolean
cores
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property cores: The number of vCPUs of the instance.
Note If the Cores and Memory parameters are both specified, all instance types that offer the vCPUs and memory size specified by the parameters are matched.
instanceChargeType
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property instanceChargeType: The billing method of the instances of the instance type.
Valid values: PrePaid: subscription PostPaid: pay-as-you-go Default value: PostPaid.
instanceFamilyLevel
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property instanceFamilyLevel: The level of the instance family.
Valid values: EntryLevel, EnterpriseLevel, CreditEntryLevel.
instanceType
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property instanceType: The specified instance type.
For more information, see Instance families or call ECS DescribeInstanceTypes operation to query the most recent instance type list. Note If the InstanceType parameter is specified, none of the Cores and Memory parameters can be specified.
instanceTypeFamilies
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
Property instanceTypeFamilies: The list of instance family to be filtered out.
You can also call ECS DescribeInstanceTypeFamilies operation to query the list of instance families.
ioOptimized
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property ioOptimized: Specifies whether to match I\/O optimized instances.
The IoOptimized parameter cannot be specified when the instance is not I/O optimized. Valid values: optimized: matches I/O optimized instances. none: matches non-I/O optimized instances. Default value: optimized. If you query alternative instance types for retired instance types, this parameter is set to none by default. Default value: none.
maxPrice
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property maxPrice: The maximum hourly price for pay-as-you-go instances or preemptible instances.
Note If this parameter is specified, the SpotStrategy parameter must be set to SpotWithPriceLimit.
memory
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property memory: The memory size of the instance.
Unit: GiB. Note If the Cores and Memory parameters are both specified, all instance types that offer the vCPUs and memory size specified by the parameters are matched.
priorityStrategy
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property priorityStrategy: The policy for recommending instance types.
Valid values: InventoryFirst: Instance types are recommended in descending order based on resource availability. PriceFirst: Instance types are recommended in ascending order based on hourly price per vCPU. NewProductFirst: The latest instance types are recommended first. Default value: InventoryFirst.
refreshOptions
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property refreshOptions: The refresh strategy for the datasource resource when the stack is updated.
Valid values:
- Never: Never refresh the datasource resource when the stack is updated.
- Always: Always refresh the datasource resource when the stack is updated. Default is Never.
scene
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property scene: Specifies the scenario in which the instance type is recommended.
Valid values: UPGRADE: instance type upgrade or downgrade CREATE: instance creation Default value: CREATE.
spotStrategy
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property spotStrategy: The bidding policy of preemptible instances.
Valid values: NoSpot: applies to regular pay-as-you-go instances. SpotWithPriceLimit: applies to preemptible instances that have user-defined maximum hourly prices. SpotAsPriceGo: applies to preemptible instances that are of the market price at the time of purchase. Note If the SpotStrategy parameter is specified, the InstanceChargeType parameter must be set to PostPaid. Default value: NoSpot.
systemDiskCategory
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property systemDiskCategory: The category of the system disk.
Valid values: cloud_efficiency: ultra disk cloud_ssd: standard SSD cloud_essd: enhanced SSD (ESSD) cloud: basic disk For non-I/O optimized instances, the default value is cloud. For I/O optimized instances, the default value is cloud_efficiency.
zoneId
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property zoneId: The zone ID of the alternative instance types.
You can call ECS DescribeZones operation to query the most recent zone list.When you specify this parameter, we recommend that you set ZoneMatchMode to the default value Include. This value indicates that instance types in the zone specified by ZoneId are preferentially recommended, and instance types in other zones in the same region are also listed.
zoneMatchMode
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property zoneMatchMode: Specifies which alternative instance types are recommended.
Valid values: Strict: recommends only alternative instance types in the zone specified by ZoneId. Include: recommends all instance types in all the zones in the same region as the specified instance type. When ZoneId is specified, the default value of this parameter is Strict. This value indicates that only alternative instance types in the zone specified by ZoneId are recommended.
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
addCondition |
No description. |
addCount |
No description. |
addDependency |
No description. |
addResourceDesc |
No description. |
applyRemovalPolicy |
No description. |
getAtt |
No description. |
setMetadata |
No description. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
synthesize
public void synthesize(ISynthesisSession session)
Allows this construct to emit artifacts into the cloud assembly during synthesis.
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
- Type: com.aliyun.ros.cdk.core.ISynthesisSession
The synthesis session.
addCondition
public void addCondition(RosCondition condition)
- Type: com.aliyun.ros.cdk.core.RosCondition
addCount
public void addCount(java.lang.Number OR IResolvable count)
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
addDependency
public void addDependency(Resource resource)
- Type: com.aliyun.ros.cdk.core.Resource
addResourceDesc
public void addResourceDesc(java.lang.String desc)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
getAtt
public IResolvable getAtt(java.lang.String name)
- Type: java.lang.String
setMetadata
public void setMetadata(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- Type: java.lang.Object
Static Functions
Name | Description |
---|---|
isConstruct |
Return whether the given object is a Construct. |
isConstruct
import com.aliyun.ros.cdk.ecs.datasource.RecommendInstanceTypes;
RecommendInstanceTypes.isConstruct(java.lang.Object x)
Return whether the given object is a Construct.
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
node |
com.aliyun.ros.cdk.core.ConstructNode |
The construct tree node associated with this construct. |
ref |
java.lang.String |
No description. |
stack |
com.aliyun.ros.cdk.core.Stack |
The stack in which this resource is defined. |
resource |
com.aliyun.ros.cdk.core.RosResource |
No description. |
attrInstanceTypeIds |
com.aliyun.ros.cdk.core.IResolvable |
Attribute InstanceTypeIds: The list of instance type ids. |
attrInstanceTypes |
com.aliyun.ros.cdk.core.IResolvable |
Attribute InstanceTypes: The list of instance types, including information such as cores and memory. |
node
Required
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
ref
Required
public java.lang.String getRef();
- Type: java.lang.String
stack
Required
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this resource is defined.
resource
Optional
public RosResource getResource();
- Type: com.aliyun.ros.cdk.core.RosResource
attrInstanceTypeIds
Required
public IResolvable getAttrInstanceTypeIds();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute InstanceTypeIds: The list of instance type ids.
Note that instance type ids are not unique.
attrInstanceTypes
Required
public IResolvable getAttrInstanceTypes();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute InstanceTypes: The list of instance types, including information such as cores and memory.