Skip to content

ScheduledTask

This class encapsulates and extends the ROS resource type ALIYUN::ESS::ScheduledTask, which is used to create a scheduled task by specifying properties.

Initializers

import com.aliyun.ros.cdk.ess.ScheduledTask;
ScheduledTask.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .launchTime(java.lang.String)
    .launchTime(IResolvable)
//  .description(java.lang.String)
//  .description(IResolvable)
//  .desiredCapacity(java.lang.Number)
//  .desiredCapacity(IResolvable)
//  .launchExpirationTime(java.lang.Number)
//  .launchExpirationTime(IResolvable)
//  .maxValue(java.lang.Number)
//  .maxValue(IResolvable)
//  .minValue(java.lang.Number)
//  .minValue(IResolvable)
//  .recurrenceEndTime(java.lang.String)
//  .recurrenceEndTime(IResolvable)
//  .recurrenceType(java.lang.String)
//  .recurrenceType(IResolvable)
//  .recurrenceValue(java.lang.String)
//  .recurrenceValue(IResolvable)
//  .scalingGroupId(java.lang.String)
//  .scalingGroupId(IResolvable)
//  .scheduledAction(java.lang.String)
//  .scheduledAction(IResolvable)
//  .scheduledTaskName(java.lang.String)
//  .scheduledTaskName(IResolvable)
//  .taskEnabled(java.lang.Boolean)
//  .taskEnabled(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.
launchTime java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property launchTime: Time point at which the scheduled task is triggered.
description java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property description: Description of the scheduled task, which is 2-200 characters (English or Chinese) long.
desiredCapacity java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property desiredCapacity: The ID of the scaling group whose number of instances must be modified when the scheduled task is triggered.
launchExpirationTime java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property launchExpirationTime: Time period within which the failed scheduled task is retried.
maxValue java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property maxValue: The expected number of instances in the scaling group if you specify the ScalingGroupId parameter.
minValue java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property minValue: The maximum number of instances in the scaling group if you specify the ScalingGroupId parameter.
recurrenceEndTime java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property recurrenceEndTime: End time of the scheduled task to be repeated.
recurrenceType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property recurrenceType: Type of the scheduled task to be repeated.
recurrenceValue java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property recurrenceValue: Value of the scheduled task to be repeated.
scalingGroupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property scalingGroupId: The globally unique ID of the scheduled task.
scheduledAction java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property scheduledAction: Operations performed when the scheduled task is triggered.
scheduledTaskName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property scheduledTaskName: Display name of the scheduled task, which must be 2-40 characters (English or Chinese) long.
taskEnabled java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property taskEnabled: Whether to enable the scheduled task.

scopeRequired

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

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

launchTimeRequired

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

Property launchTime: Time point at which the scheduled task is triggered.

The date format follows the ISO8601 standard and uses UTC time. It is in the format of YYYY-MM-DDThh:mmZ. If RecurrenceType is specified, the time point specified by this attribute is the default time point at which the circle is executed. If RecurrenceType is not specified, the task is executed once on the designated date and time. A time point 90 days after creation or modification cannot be entered.


descriptionOptional

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

Property description: Description of the scheduled task, which is 2-200 characters (English or Chinese) long.


desiredCapacityOptional

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

Property desiredCapacity: The ID of the scaling group whose number of instances must be modified when the scheduled task is triggered.

If you specify the ScalingGroupId parameter for a scheduled task, you must specify the minimum, maximum, or expected numbers of instances for a scaling group in the scheduled task. That is, you must specify at least one of the MinValue, MaxValue, and DesiredCapacity parameters.


launchExpirationTimeOptional

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

Property launchExpirationTime: Time period within which the failed scheduled task is retried.

The default value is 600s. Value range: [0, 21600]


maxValueOptional

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

Property maxValue: The expected number of instances in the scaling group if you specify the ScalingGroupId parameter.

Note: You must specify the DesiredCapacity parameter when you create a scaling group.


minValueOptional

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

Property minValue: The maximum number of instances in the scaling group if you specify the ScalingGroupId parameter.


recurrenceEndTimeOptional

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

Property recurrenceEndTime: End time of the scheduled task to be repeated.

The date format follows the ISO8601 standard and uses UTC time. It is in the format of YYYY-MM-DDThh:mmZ. A time point 90 days after creation or modification cannot be entered. RecurrenceType, RecurrenceValue and RecurrenceEndTime must be specified.


recurrenceTypeOptional

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

Property recurrenceType: Type of the scheduled task to be repeated.

Optional values:

  • Daily: Recurrence interval by day for a scheduled task.
  • Weekly: Recurrence interval by week for a scheduled task.
  • Monthly: Recurrence interval by month for a scheduled task. RecurrenceType, RecurrenceValue and RecurrenceEndTime must be specified.

recurrenceValueOptional

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

Property recurrenceValue: Value of the scheduled task to be repeated.

  • Daily: Only one value in the range [1,31] can be filled.
  • Weekly: Multiple values can be filled. The values of Sunday to Saturday are 0 to 6 in sequence. Multiple values shall be separated by a comma ",".
  • Monthly: In the format of A-B. The value range of A and B is 1 to 31, and the B value must be greater than the A value. RecurrenceType, RecurrenceValue and RecurrenceEndTime must be specified.

scalingGroupIdOptional

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

Property scalingGroupId: The globally unique ID of the scheduled task.

The globally unique ID is generated by the system. Note: You cannot specify the ScheduledAction and ScalingGroupId parameters at the same time.


scheduledActionOptional

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

Property scheduledAction: Operations performed when the scheduled task is triggered.

Fill in the unique identifier of the scaling rule. Note: You cannot specify the ScheduledAction and ScalingGroupId parameters at the same time.


scheduledTaskNameOptional

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

Property scheduledTaskName: Display name of the scheduled task, which must be 2-40 characters (English or Chinese) long.

It must begin with a number, an upper/lower-case letter or a Chinese character and may contain numbers, "_", "-" or ".". The account name is unique in the same region. If this parameter is not specified, the default value ScheduledScalingTaskId is used.


taskEnabledOptional

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

Property taskEnabled: Whether to enable the scheduled task.

  • When the parameter is set to true, the task is enabled.
  • When the parameter is set to false, the task is disabled. The default value is true.

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.ess.ScheduledTask;
ScheduledTask.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.
attrScheduledTaskId com.aliyun.ros.cdk.core.IResolvable Attribute ScheduledTaskId: ID of the scheduled task, which is generated by the system and globally unique.

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

attrScheduledTaskIdRequired

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

Attribute ScheduledTaskId: ID of the scheduled task, which is generated by the system and globally unique.