AutoSnapshotPolicy
- Implements: IAutoSnapshotPolicy
This class encapsulates and extends the ROS resource type ALIYUN::ECS::AutoSnapshotPolicy.
Initializers
import com.aliyun.ros.cdk.ecs.AutoSnapshotPolicy;
AutoSnapshotPolicy.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
.repeatWeekdays(IResolvable)
.repeatWeekdays(java.util.List<java.lang.Number)
.repeatWeekdays(IResolvable>)
.retentionDays(java.lang.Number)
.retentionDays(IResolvable)
.timePoints(java.util.List<java.lang.Object>)
.timePoints(IResolvable)
// .autoSnapshotPolicyName(java.lang.String)
// .autoSnapshotPolicyName(IResolvable)
// .copiedSnapshotsRetentionDays(java.lang.Number)
// .copiedSnapshotsRetentionDays(IResolvable)
// .copyEncryptionConfiguration(IResolvable)
// .copyEncryptionConfiguration(CopyEncryptionConfigurationProperty)
// .diskIds(IResolvable)
// .diskIds(java.util.List<java.lang.String)
// .diskIds(IResolvable>)
// .enableCrossRegionCopy(java.lang.Boolean)
// .enableCrossRegionCopy(IResolvable)
// .resourceGroupId(java.lang.String)
// .resourceGroupId(IResolvable)
// .tags(java.util.List<TagsProperty>)
// .targetCopyRegions(IResolvable)
// .targetCopyRegions(java.util.List<java.lang.String)
// .targetCopyRegions(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. |
repeatWeekdays | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property repeatWeekdays: The automatic snapshot repetition dates. |
retentionDays | java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable | Property retentionDays: The snapshot retention time, and the unit of measurement is day. |
timePoints | java.util.List | Property timePoints: The automatic snapshot creation schedule, and the unit of measurement is hour. |
autoSnapshotPolicyName | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property autoSnapshotPolicyName: The name of the automatic snapshot policy. |
copiedSnapshotsRetentionDays | java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable | Property copiedSnapshotsRetentionDays: The retention period of the snapshot copy in the destination region. |
copyEncryptionConfiguration | com.aliyun.ros.cdk.core.IResolvable OR CopyEncryptionConfigurationProperty | Property copyEncryptionConfiguration: The encryption configuration for copied snapshots. |
diskIds | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property diskIds: The disk ID. |
enableCrossRegionCopy | java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable | Property enableCrossRegionCopy: Whether to enable cross-region copying of snapshots. |
resourceGroupId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Property resourceGroupId: Resource group id. |
tags | java.util.List<TagsProperty> | Property tags: Tags to attach to instance. |
targetCopyRegions | com.aliyun.ros.cdk.core.IResolvable OR java.util.List | Property targetCopyRegions: The target region of the snapshot is replicated across geographies. |
scopeRequired
- Type: com.aliyun.ros.cdk.core.Construct
idRequired
- Type: java.lang.String
enableResourcePropertyConstraintOptional
- Type: java.lang.Boolean
repeatWeekdaysRequired
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
Property repeatWeekdays: The automatic snapshot repetition dates.
The unit of measurement is day and the repeating cycle is a week. Value range: [1, 7], which represents days starting from Monday to Sunday, for example 1 indicates Monday. When you want to schedule multiple automatic snapshot tasks for a disk in a week, you can set the RepeatWeekdays to an array. A maximum of seven time points can be selected. The format is a list of [1, 2, ..., 7] and the time points are separated by commas (,).
retentionDaysRequired
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property retentionDays: The snapshot retention time, and the unit of measurement is day.
Optional values: -1: The automatic snapshots are retained permanently. [1, 65536]: The number of days retained. Default value: -1.
timePointsRequired
- Type: java.util.List
OR com.aliyun.ros.cdk.core.IResolvable
Property timePoints: The automatic snapshot creation schedule, and the unit of measurement is hour.
Value range: [0, 23], which represents from 00:00 to 24:00, for example 1 indicates 01:00. When you want to schedule multiple automatic snapshot tasks for a disk in a day, you can set the TimePoints to an array. A maximum of 24 time points can be selected. The format is a list of [0, 1, ..., 23] and the time points are separated by commas (,).
autoSnapshotPolicyNameOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property autoSnapshotPolicyName: The name of the automatic snapshot policy.
It can consist of [2, 128] English or Chinese characters. Must begin with an uppercase or lowercase letter or a Chinese character. Can contain numbers, periods (.), colons (:), underscores (_), and hyphens (-). Cannot start with http:// or https://. Default value: null.
copiedSnapshotsRetentionDaysOptional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Property copiedSnapshotsRetentionDays: The retention period of the snapshot copy in the destination region.
Unit: days. Valid values:
- -1: The snapshot copy is retained until it is deleted.
- 1 to 65535: The snapshot copy is retained for the specified number of days. After the retention period of the snapshot copy expires, the snapshot copy is automatically deleted. Default value: -1.
copyEncryptionConfigurationOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR CopyEncryptionConfigurationProperty
Property copyEncryptionConfiguration: The encryption configuration for copied snapshots.
diskIdsOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
Property diskIds: The disk ID.
When you want to apply the automatic snapshot policy to multiple disks, you can set the DiskIds to an array. The format is list of ["d-xxxxxxxxx", "d-yyyyyyyyy", ..., "d-zzzzzzzzz"] and the IDs are separated by commas (,).
enableCrossRegionCopyOptional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property enableCrossRegionCopy: Whether to enable cross-region copying of snapshots.
resourceGroupIdOptional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property resourceGroupId: Resource group id.
tagsOptional
- Type: java.util.List<TagsProperty>
Property tags: Tags to attach to instance.
Max support 20 tags to add during create instance. Each tag with two properties Key and Value, and Key is required.
targetCopyRegionsOptional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List
Property targetCopyRegions: The target region of the snapshot is replicated across geographies.
Setting a target region is currently supported.
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. |
fetchCondition | No description. |
fetchDependency | No description. |
fetchResourceDesc | 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
fetchCondition
public RosCondition fetchCondition()
fetchDependency
public java.util.List<java.lang.String> fetchDependency()
fetchResourceDesc
public java.lang.String fetchResourceDesc()
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.AutoSnapshotPolicy;
AutoSnapshotPolicy.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. |
env | com.aliyun.ros.cdk.core.IResourceEnvironment | The environment this resource belongs to. |
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. |
attrArn | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute Arn: The Alibaba Cloud Resource Name (ARN). |
attrAutoSnapshotPolicyId | java.lang.String OR com.aliyun.ros.cdk.core.IResolvable | Attribute AutoSnapshotPolicyId: The automatic snapshot policy ID. |
props | AutoSnapshotPolicyProps | No description. |
nodeRequired
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
envRequired
public IResourceEnvironment getEnv();
- Type: com.aliyun.ros.cdk.core.IResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
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
attrArnRequired
public java.lang.Object getAttrArn();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute Arn: The Alibaba Cloud Resource Name (ARN).
attrAutoSnapshotPolicyIdRequired
public java.lang.Object getAttrAutoSnapshotPolicyId();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Attribute AutoSnapshotPolicyId: The automatic snapshot policy ID.
propsRequired
public AutoSnapshotPolicyProps getProps();
- Type: AutoSnapshotPolicyProps