Skip to content

Job

This class encapsulates and extends the ROS resource type ALIYUN::SchedulerX::Job.

Initializers

import com.aliyun.ros.cdk.schedulerx.Job;
Job.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .executeMode(java.lang.String)
    .executeMode(IResolvable)
    .groupId(java.lang.String)
    .groupId(IResolvable)
    .jobType(java.lang.String)
    .jobType(IResolvable)
    .name(java.lang.String)
    .name(IResolvable)
    .namespace(java.lang.String)
    .namespace(IResolvable)
    .timeType(java.lang.Number)
    .timeType(IResolvable)
//  .attemptInterval(java.lang.Number)
//  .attemptInterval(IResolvable)
//  .calendar(java.lang.String)
//  .calendar(IResolvable)
//  .className(java.lang.String)
//  .className(IResolvable)
//  .consumerSize(java.lang.Number)
//  .consumerSize(IResolvable)
//  .contactInfo(IResolvable)
//  .contactInfo(java.util.List<IResolvable)
//  .contactInfo(ContactInfoProperty>)
//  .content(java.lang.String)
//  .content(IResolvable)
//  .dataOffset(java.lang.Number)
//  .dataOffset(IResolvable)
//  .description(java.lang.String)
//  .description(IResolvable)
//  .dispatcherSize(java.lang.Number)
//  .dispatcherSize(IResolvable)
//  .failEnable(java.lang.Boolean)
//  .failEnable(IResolvable)
//  .failTimes(java.lang.Number)
//  .failTimes(IResolvable)
//  .maxAttempt(java.lang.Number)
//  .maxAttempt(IResolvable)
//  .maxConcurrency(java.lang.Number)
//  .maxConcurrency(IResolvable)
//  .missWorkerEnable(java.lang.Boolean)
//  .missWorkerEnable(IResolvable)
//  .namespaceSource(java.lang.String)
//  .namespaceSource(IResolvable)
//  .pageSize(java.lang.Number)
//  .pageSize(IResolvable)
//  .parameters(java.lang.String)
//  .parameters(IResolvable)
//  .priority(java.lang.Number)
//  .priority(IResolvable)
//  .queueSize(java.lang.Number)
//  .queueSize(IResolvable)
//  .sendChannel(java.lang.String)
//  .sendChannel(IResolvable)
//  .successNoticeEnable(java.lang.Boolean)
//  .successNoticeEnable(IResolvable)
//  .taskAttemptInterval(java.lang.Number)
//  .taskAttemptInterval(IResolvable)
//  .taskMaxAttempt(java.lang.Number)
//  .taskMaxAttempt(IResolvable)
//  .timeExpression(java.lang.String)
//  .timeExpression(IResolvable)
//  .timeout(java.lang.Number)
//  .timeout(IResolvable)
//  .timeoutEnable(java.lang.Boolean)
//  .timeoutEnable(IResolvable)
//  .timeoutKillEnable(java.lang.Boolean)
//  .timeoutKillEnable(IResolvable)
//  .timezone(java.lang.String)
//  .timezone(IResolvable)
//  .xAttrs(IResolvable)
//  .xAttrs(java.util.Map<java.lang.String, java.lang.Object>)
    .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.
executeMode java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property executeMode: The execute mode of the job.
groupId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property groupId: The group ID of the job.
jobType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property jobType: The type of the job.
name java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property name: The name of the job.
namespace java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property namespace: The namespace of the job.
timeType java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property timeType: The time type of the job.
attemptInterval java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property attemptInterval: The retry interval for a failed job, in seconds.
calendar java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property calendar: For a cron job, you can specify a custom calendar.
className java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property className: The fully qualified class name of the job interface.
consumerSize java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property consumerSize: [Advanced] For parallel and grid jobs, this specifies the number of consumer threads per machine for processing subtasks.
contactInfo com.aliyun.ros.cdk.core.IResolvable OR java.util.ListContactInfoProperty> Property contactInfo: The contact information for the job.
content java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property content: - For a python, shell, or k8s job, this parameter specifies the script content.
dataOffset java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property dataOffset: The time offset in seconds for a cron job.
description java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property description: The description of the job.
dispatcherSize java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property dispatcherSize: [Advanced] For parallel and grid jobs, this specifies the number of threads for dispatching subtasks.
failEnable java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property failEnable: Specifies whether to enable alerts for failed jobs.
failTimes java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property failTimes: The number of consecutive failures that triggers an alert.
maxAttempt java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property maxAttempt: The maximum number of retries for a failed job.
maxConcurrency java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property maxConcurrency: The maximum number of concurrent job instances.
missWorkerEnable java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property missWorkerEnable: Specifies whether to send an alert when no worker is available to run the job.
namespaceSource java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property namespaceSource: This parameter is required only for specific third-party integrations.
pageSize java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property pageSize: [Advanced] For parallel and grid jobs, this specifies the number of subtasks retrieved per pull.
parameters java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property parameters: The parameters of the job.
priority java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property priority: The job priority.
queueSize java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property queueSize: [Advanced] For parallel and grid jobs, this specifies the maximum number of subtasks the queue can hold.
sendChannel java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property sendChannel: The channel for sending alerts.
successNoticeEnable java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property successNoticeEnable: Whether success notice is enabled for the job.
taskAttemptInterval java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property taskAttemptInterval: [Advanced] For parallel and grid jobs, this specifies the retry interval in seconds for a failed subtask.
taskMaxAttempt java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property taskMaxAttempt: [Advanced] For parallel and grid jobs, this specifies the maximum number of retries for a failed subtask.
timeExpression java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property timeExpression: The time expression, which depends on the value of TimeType.
timeout java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable Property timeout: The timeout threshold in seconds.
timeoutEnable java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property timeoutEnable: Specifies whether to enable timeout alerts.
timeoutKillEnable java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property timeoutKillEnable: Specifies whether to terminate the job upon timeout.
timezone java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property timezone: The timezone of the job.
xAttrs com.aliyun.ros.cdk.core.IResolvable OR java.util.Map Property xAttrs: This parameter is required for k8s jobs.
For job tasks: {"resource":"job"}
For shell tasks: {"image":"busybox","resource":"shell"}

.

scopeRequired

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

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

executeModeRequired

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

Property executeMode: The execute mode of the job.


groupIdRequired

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

Property groupId: The group ID of the job.


jobTypeRequired

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

Property jobType: The type of the job.


nameRequired

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

Property name: The name of the job.


namespaceRequired

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

Property namespace: The namespace of the job.


timeTypeRequired

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

Property timeType: The time type of the job.

cron:1 fixed_rate:3 second_delay:4 one_time :5 api:100 none:-1


attemptIntervalOptional

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

Property attemptInterval: The retry interval for a failed job, in seconds.

Defaults to 30.


calendarOptional

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

Property calendar: For a cron job, you can specify a custom calendar.


classNameOptional

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

Property className: The fully qualified class name of the job interface.

Required for java jobs.


consumerSizeOptional

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

Property consumerSize: [Advanced] For parallel and grid jobs, this specifies the number of consumer threads per machine for processing subtasks.

Defaults to 5.


contactInfoOptional

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

Property contactInfo: The contact information for the job.

This parameter is deprecated.


contentOptional

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

Property content: - For a python, shell, or k8s job, this parameter specifies the script content.

  • For a go job, the content must be in the following format: {"jobName":"HelloWorld"}

dataOffsetOptional

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

Property dataOffset: The time offset in seconds for a cron job.


descriptionOptional

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

Property description: The description of the job.


dispatcherSizeOptional

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

Property dispatcherSize: [Advanced] For parallel and grid jobs, this specifies the number of threads for dispatching subtasks.

Defaults to 5.


failEnableOptional

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

Property failEnable: Specifies whether to enable alerts for failed jobs.

Valid values:

  • true: Enables failure alerts.
  • false: Disables failure alerts.

failTimesOptional

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

Property failTimes: The number of consecutive failures that triggers an alert.


maxAttemptOptional

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

Property maxAttempt: The maximum number of retries for a failed job.

Defaults to 0.


maxConcurrencyOptional

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

Property maxConcurrency: The maximum number of concurrent job instances.

Defaults to 1. If an existing job instance is still running, a new one will not be triggered, even if its scheduled time has passed.


missWorkerEnableOptional

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

Property missWorkerEnable: Specifies whether to send an alert when no worker is available to run the job.

  • true: Enables the alert.
  • false: Disables the alert.

namespaceSourceOptional

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

Property namespaceSource: This parameter is required only for specific third-party integrations.


pageSizeOptional

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

Property pageSize: [Advanced] For parallel and grid jobs, this specifies the number of subtasks retrieved per pull.

Defaults to 100.


parametersOptional

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

Property parameters: The parameters of the job.


priorityOptional

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

Property priority: The job priority.

Valid values:

  • 1: Low
  • 5: Medium
  • 10: High
  • 15: Very High

queueSizeOptional

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

Property queueSize: [Advanced] For parallel and grid jobs, this specifies the maximum number of subtasks the queue can hold.

Defaults to 10000.


sendChannelOptional

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

Property sendChannel: The channel for sending alerts.

  • For the default channel of the application group, use default.
  • For a specific channel for the job, use sms, mail, phone, or webhook.

successNoticeEnableOptional

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

Property successNoticeEnable: Whether success notice is enabled for the job.


taskAttemptIntervalOptional

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

Property taskAttemptInterval: [Advanced] For parallel and grid jobs, this specifies the retry interval in seconds for a failed subtask.

Defaults to 0.


taskMaxAttemptOptional

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

Property taskMaxAttempt: [Advanced] For parallel and grid jobs, this specifies the maximum number of retries for a failed subtask.

Defaults to 0.


timeExpressionOptional

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

Property timeExpression: The time expression, which depends on the value of TimeType.

  • cron: A standard cron expression.
  • api: No time expression is required.
  • fixed_rate: A fixed interval in seconds. For example, a value of 30 triggers the job every 30 seconds.
  • second_delay: A fixed delay in seconds before the job is executed. Valid values: 1 to 60.
  • one_time: A specific time in yyyy-MM-dd HH:mm:ss format or a Unix timestamp in milliseconds. Example: "2022-10-10 10:10:00".

timeoutOptional

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

Property timeout: The timeout threshold in seconds.

Defaults to 7200.


timeoutEnableOptional

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

Property timeoutEnable: Specifies whether to enable timeout alerts.

Valid values:

  • true: Enables timeout alerts.
  • false: Disables timeout alerts.

timeoutKillEnableOptional

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

Property timeoutKillEnable: Specifies whether to terminate the job upon timeout.

Valid values:

  • true: Terminates the job if it times out.
  • false: The job is not terminated if it times out.

timezoneOptional

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

Property timezone: The timezone of the job.


xAttrsOptional

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

Property xAttrs: This parameter is required for k8s jobs.
For job tasks: {"resource":"job"}
For shell tasks: {"image":"busybox","resource":"shell"}

.


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.

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

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)

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.schedulerx.Job;
Job.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.
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.
attrJobId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute JobId: The ID of the job.
props JobProps 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

attrJobIdRequired

public java.lang.Object getAttrJobId();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute JobId: The ID of the job.


propsRequired

public JobProps getProps();