Skip to content

Disks

This class encapsulates and extends the ROS resource type DATASOURCE::ECS::Disks, which is used to query the Elastic Block Storage (EBS) devices that you created.

The following EBS devices are supported: cloud disks and local disks.

Initializers

import com.aliyun.ros.cdk.ecs.datasource.Disks;
Disks.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
//  .additionalAttributes(IResolvable)
//  .additionalAttributes(java.util.List<java.lang.String)
//  .additionalAttributes(IResolvable>)
//  .autoSnapshotPolicyId(java.lang.String)
//  .autoSnapshotPolicyId(IResolvable)
//  .category(java.lang.String)
//  .category(IResolvable)
//  .deleteAutoSnapshot(java.lang.String)
//  .deleteAutoSnapshot(IResolvable)
//  .deleteWithInstance(java.lang.Boolean)
//  .deleteWithInstance(IResolvable)
//  .diskChargeType(java.lang.String)
//  .diskChargeType(IResolvable)
//  .diskIds(IResolvable)
//  .diskIds(java.util.List<java.lang.String)
//  .diskIds(IResolvable>)
//  .diskName(java.lang.String)
//  .diskName(IResolvable)
//  .diskType(java.lang.String)
//  .diskType(IResolvable)
//  .enableAutomatedSnapshotPolicy(java.lang.Boolean)
//  .enableAutomatedSnapshotPolicy(IResolvable)
//  .enableAutoSnapshot(java.lang.Boolean)
//  .enableAutoSnapshot(IResolvable)
//  .enableShared(java.lang.String)
//  .enableShared(IResolvable)
//  .encrypted(java.lang.Boolean)
//  .encrypted(IResolvable)
//  .filters(IResolvable)
//  .filters(java.util.List<FiltersProperty)
//  .filters(IResolvable>)
//  .instanceId(java.lang.String)
//  .instanceId(IResolvable)
//  .kmsKeyId(java.lang.String)
//  .kmsKeyId(IResolvable)
//  .multiAttach(java.lang.String)
//  .multiAttach(IResolvable)
//  .portable(java.lang.String)
//  .portable(IResolvable)
//  .refreshOptions(java.lang.String)
//  .refreshOptions(IResolvable)
//  .resourceGroupId(java.lang.String)
//  .resourceGroupId(IResolvable)
//  .snapshotId(java.lang.String)
//  .snapshotId(IResolvable)
//  .status(java.lang.String)
//  .status(IResolvable)
//  .tags(java.util.List<TagsProperty>)
//  .zoneId(java.lang.String)
//  .zoneId(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.
additionalAttributes com.aliyun.ros.cdk.core.IResolvable OR java.util.List Property additionalAttributes: The value of attribute N.
autoSnapshotPolicyId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property autoSnapshotPolicyId: The ID of the automatic snapshot policy that is applied to the cloud disk.
category java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property category: The category of the disk.
deleteAutoSnapshot java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property deleteAutoSnapshot: Specifies whether to delete the automatic snapshots of the cloud disk when the disk is released.
deleteWithInstance java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property deleteWithInstance: Specifies whether to release the cloud disk when its associated instance is released.
diskChargeType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property diskChargeType: The billing method of the disk.
diskIds com.aliyun.ros.cdk.core.IResolvable OR java.util.List Property diskIds: The IDs of disks.
diskName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property diskName: The name of the disk.
diskType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property diskType: The type of the disk.
enableAutomatedSnapshotPolicy java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property enableAutomatedSnapshotPolicy: Specifies whether an automatic snapshot policy is applied to the cloud disk.
enableAutoSnapshot java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property enableAutoSnapshot: Specifies whether the automatic snapshot policy feature is enabled for the cloud disk.
enableShared java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property enableShared: Specifies whether the disk is a Shared Block Storage device.
encrypted java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property encrypted: Specifies whether to query only encrypted cloud disks.
filters com.aliyun.ros.cdk.core.IResolvable OR java.util.List Property filters: Filter value when querying resources.
instanceId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property instanceId: The ID of the instance to which the disk is attached.
kmsKeyId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property kmsKeyId: The ID of the Key Management Service (KMS) key used by the cloud disk.
multiAttach java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property multiAttach: Specifies whether the multi-attach feature is enabled for the disk.
portable java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property portable: Specifies whether the disk is removable.
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.
resourceGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property resourceGroupId: The ID of the resource group to which the disk belongs.
snapshotId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property snapshotId: The ID of the snapshot used to create the cloud disk.
status java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property status: The state of the cloud disk.
tags java.util.List Property tags: Tags of disks.
zoneId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property zoneId: The ID of the zone for which to query resources.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

additionalAttributesOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List

Property additionalAttributes: The value of attribute N.

Set the value to IOPS, which indicates the maximum IOPS of the disk.


autoSnapshotPolicyIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property autoSnapshotPolicyId: The ID of the automatic snapshot policy that is applied to the cloud disk.


categoryOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property category: The category of the disk.

Valid values: all: all disk categories cloud: basic disk cloud_efficiency: ultra disk cloud_ssd: standard SSD ephemeral: retired local disk ephemeral_ssd: local SSD cloud_essd: ESSD local_ssd_pro: I/O-intensive local disk local_hdd_pro: throughput-intensive local disk


deleteAutoSnapshotOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property deleteAutoSnapshot: Specifies whether to delete the automatic snapshots of the cloud disk when the disk is released.

Default value: false.


deleteWithInstanceOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property deleteWithInstance: Specifies whether to release the cloud disk when its associated instance is released.

Valid values: true: The cloud disk is released when its associated instance is released. false: The cloud disk is not released but is retained as a pay-as-you-go data disk when its associated instance is released. Default value: false.


diskChargeTypeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property diskChargeType: The billing method of the disk.

Valid values: PrePaid: subscription PostPaid: pay-as-you-go


diskIdsOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List

Property diskIds: The IDs of disks.

The value is a JSON array that consists of up to 100 disk IDs. Separate the disk IDs with commas (,).


diskNameOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property diskName: The name of the disk.


diskTypeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property diskType: The type of the disk.

Valid values: all: system disk and data disk system: system disk data: data disk Default value: all.


enableAutomatedSnapshotPolicyOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property enableAutomatedSnapshotPolicy: Specifies whether an automatic snapshot policy is applied to the cloud disk.

true: An automatic snapshot policy is applied to the cloud disk. false: No automatic snapshot policy is applied to the cloud disk. Default value: false.


enableAutoSnapshotOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property enableAutoSnapshot: Specifies whether the automatic snapshot policy feature is enabled for the cloud disk.

true: The automatic snapshot policy feature is enabled for the cloud disk. false: The automatic snapshot policy feature is disabled for the cloud disk. Note By default, the automatic snapshot policy feature is enabled for created cloud disks. You need only to apply an automatic snapshot policy to a cloud disk before you can use the automatic snapshot policy.


enableSharedOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property enableShared: Specifies whether the disk is a Shared Block Storage device.


encryptedOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property encrypted: Specifies whether to query only encrypted cloud disks.

Default value: false.


filtersOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List

Property filters: Filter value when querying resources.


instanceIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property instanceId: The ID of the instance to which the disk is attached.


kmsKeyIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property kmsKeyId: The ID of the Key Management Service (KMS) key used by the cloud disk.


multiAttachOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property multiAttach: Specifies whether the multi-attach feature is enabled for the disk.

Valid values: Disabled: The multi-attach feature is disabled. Enabled: The multi-attach feature is enabled. LegacyShared: Shared Block Storage devices are queried. The multi-attach feature is in invitational preview. To use this feature, submit a ticket.


portableOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property portable: Specifies whether the disk is removable.

Valid values: true: The disk is removable.A removable disk can independently exist and can be attached to or detached from an instance within the same zone. false: The disk is not removable. A disk that is not removable cannot independently exist or be attached to or detached from an instance within the same zone. The Portable attribute of the following disks is false, and these disks share the same lifecycle with their associated instances: Local disks Local SSDs Subscription data disks


refreshOptionsOptional

  • 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.

resourceGroupIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property resourceGroupId: The ID of the resource group to which the disk belongs.

If this parameter is specified to query resources,up to 1,000 resources that belong to the specified resource group can be displayed in the response.


snapshotIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property snapshotId: The ID of the snapshot used to create the cloud disk.


statusOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property status: The state of the cloud disk.

For more information, see Disk states. Valid values: In_use Available Attaching Detaching Creating ReIniting All Default value: All.


tagsOptional

  • Type: java.util.List

Property tags: Tags of disks.


zoneIdOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property zoneId: The ID of the zone for which to query resources.


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.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • 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.Disks;
Disks.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • 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.
attrDiskIds com.aliyun.ros.cdk.core.IResolvable Attribute DiskIds: The list of disk IDs.
attrDisks com.aliyun.ros.cdk.core.IResolvable Attribute Disks: The list of disks.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrDiskIdsRequired

public IResolvable getAttrDiskIds();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute DiskIds: The list of disk IDs.


attrDisksRequired

public IResolvable getAttrDisks();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Disks: The list of disks.