Skip to content

Job

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

Initializers

import ros_cdk_schedulerx
ros_cdk_schedulerx.Job(
  scope: Construct,
  id: str,
  execute_mode: typing.Union[str, IResolvable],
  group_id: typing.Union[str, IResolvable],
  job_type: typing.Union[str, IResolvable],
  name: typing.Union[str, IResolvable],
  namespace: typing.Union[str, IResolvable],
  time_type: typing.Union[typing.Union[int, float], IResolvable],
  attempt_interval: typing.Union[typing.Union[int, float], IResolvable] = None,
  calendar: typing.Union[str, IResolvable] = None,
  class_name: typing.Union[str, IResolvable] = None,
  consumer_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  contact_info: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ContactInfoProperty]]] = None,
  content: typing.Union[str, IResolvable] = None,
  data_offset: typing.Union[typing.Union[int, float], IResolvable] = None,
  description: typing.Union[str, IResolvable] = None,
  dispatcher_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  fail_enable: typing.Union[bool, IResolvable] = None,
  fail_times: typing.Union[typing.Union[int, float], IResolvable] = None,
  max_attempt: typing.Union[typing.Union[int, float], IResolvable] = None,
  max_concurrency: typing.Union[typing.Union[int, float], IResolvable] = None,
  miss_worker_enable: typing.Union[bool, IResolvable] = None,
  namespace_source: typing.Union[str, IResolvable] = None,
  page_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  parameters: typing.Union[str, IResolvable] = None,
  priority: typing.Union[typing.Union[int, float], IResolvable] = None,
  queue_size: typing.Union[typing.Union[int, float], IResolvable] = None,
  send_channel: typing.Union[str, IResolvable] = None,
  success_notice_enable: typing.Union[bool, IResolvable] = None,
  task_attempt_interval: typing.Union[typing.Union[int, float], IResolvable] = None,
  task_max_attempt: typing.Union[typing.Union[int, float], IResolvable] = None,
  time_expression: typing.Union[str, IResolvable] = None,
  timeout: typing.Union[typing.Union[int, float], IResolvable] = None,
  timeout_enable: typing.Union[bool, IResolvable] = None,
  timeout_kill_enable: typing.Union[bool, IResolvable] = None,
  timezone: typing.Union[str, IResolvable] = None,
  x_attrs: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No description.
execute_mode typing.Union[str, ros_cdk_core.IResolvable] Property executeMode: The execute mode of the job.
group_id typing.Union[str, ros_cdk_core.IResolvable] Property groupId: The group ID of the job.
job_type typing.Union[str, ros_cdk_core.IResolvable] Property jobType: The type of the job.
name typing.Union[str, ros_cdk_core.IResolvable] Property name: The name of the job.
namespace typing.Union[str, ros_cdk_core.IResolvable] Property namespace: The namespace of the job.
time_type typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property timeType: The time type of the job.
attempt_interval typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property attemptInterval: The retry interval for a failed job, in seconds.
calendar typing.Union[str, ros_cdk_core.IResolvable] Property calendar: For a cron job, you can specify a custom calendar.
class_name typing.Union[str, ros_cdk_core.IResolvable] Property className: The fully qualified class name of the job interface.
consumer_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property consumerSize: [Advanced] For parallel and grid jobs, this specifies the number of consumer threads per machine for processing subtasks.
contact_info typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ContactInfoProperty]]] Property contactInfo: The contact information for the job.
content typing.Union[str, ros_cdk_core.IResolvable] Property content: - For a python, shell, or k8s job, this parameter specifies the script content.
data_offset typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property dataOffset: The time offset in seconds for a cron job.
description typing.Union[str, ros_cdk_core.IResolvable] Property description: The description of the job.
dispatcher_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property dispatcherSize: [Advanced] For parallel and grid jobs, this specifies the number of threads for dispatching subtasks.
fail_enable typing.Union[bool, ros_cdk_core.IResolvable] Property failEnable: Specifies whether to enable alerts for failed jobs.
fail_times typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property failTimes: The number of consecutive failures that triggers an alert.
max_attempt typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property maxAttempt: The maximum number of retries for a failed job.
max_concurrency typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property maxConcurrency: The maximum number of concurrent job instances.
miss_worker_enable typing.Union[bool, ros_cdk_core.IResolvable] Property missWorkerEnable: Specifies whether to send an alert when no worker is available to run the job.
namespace_source typing.Union[str, ros_cdk_core.IResolvable] Property namespaceSource: This parameter is required only for specific third-party integrations.
page_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property pageSize: [Advanced] For parallel and grid jobs, this specifies the number of subtasks retrieved per pull.
parameters typing.Union[str, ros_cdk_core.IResolvable] Property parameters: The parameters of the job.
priority typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property priority: The job priority.
queue_size typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property queueSize: [Advanced] For parallel and grid jobs, this specifies the maximum number of subtasks the queue can hold.
send_channel typing.Union[str, ros_cdk_core.IResolvable] Property sendChannel: The channel for sending alerts.
success_notice_enable typing.Union[bool, ros_cdk_core.IResolvable] Property successNoticeEnable: Whether success notice is enabled for the job.
task_attempt_interval typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property taskAttemptInterval: [Advanced] For parallel and grid jobs, this specifies the retry interval in seconds for a failed subtask.
task_max_attempt typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property taskMaxAttempt: [Advanced] For parallel and grid jobs, this specifies the maximum number of retries for a failed subtask.
time_expression typing.Union[str, ros_cdk_core.IResolvable] Property timeExpression: The time expression, which depends on the value of TimeType.
timeout typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] Property timeout: The timeout threshold in seconds.
timeout_enable typing.Union[bool, ros_cdk_core.IResolvable] Property timeoutEnable: Specifies whether to enable timeout alerts.
timeout_kill_enable typing.Union[bool, ros_cdk_core.IResolvable] Property timeoutKillEnable: Specifies whether to terminate the job upon timeout.
timezone typing.Union[str, ros_cdk_core.IResolvable] Property timezone: The timezone of the job.
x_attrs typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] Property xAttrs: This parameter is required for k8s jobs.
For job tasks: {"resource":"job"}
For shell tasks: {"image":"busybox","resource":"shell"}

.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

execute_modeRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property executeMode: The execute mode of the job.


group_idRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property groupId: The group ID of the job.


job_typeRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property jobType: The type of the job.


nameRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property name: The name of the job.


namespaceRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property namespace: The namespace of the job.


time_typeRequired

  • Type: typing.Union[typing.Union[int, float], 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


attempt_intervalOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

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

Defaults to 30.


calendarOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

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


class_nameOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

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

Required for java jobs.


consumer_sizeOptional

  • Type: typing.Union[typing.Union[int, float], 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.


contact_infoOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, ContactInfoProperty]]]

Property contactInfo: The contact information for the job.

This parameter is deprecated.


contentOptional

  • Type: typing.Union[str, 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"}

data_offsetOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

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


descriptionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property description: The description of the job.


dispatcher_sizeOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

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

Defaults to 5.


fail_enableOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

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

Valid values:

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

fail_timesOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

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


max_attemptOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

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

Defaults to 0.


max_concurrencyOptional

  • Type: typing.Union[typing.Union[int, float], 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.


miss_worker_enableOptional

  • Type: typing.Union[bool, 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.

namespace_sourceOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

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


page_sizeOptional

  • Type: typing.Union[typing.Union[int, float], 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: typing.Union[str, ros_cdk_core.IResolvable]

Property parameters: The parameters of the job.


priorityOptional

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property priority: The job priority.

Valid values:

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

queue_sizeOptional

  • Type: typing.Union[typing.Union[int, float], 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.


send_channelOptional

  • Type: typing.Union[str, 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.

success_notice_enableOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

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


task_attempt_intervalOptional

  • Type: typing.Union[typing.Union[int, float], 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.


task_max_attemptOptional

  • Type: typing.Union[typing.Union[int, float], 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.


time_expressionOptional

  • Type: typing.Union[str, 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: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

Property timeout: The timeout threshold in seconds.

Defaults to 7200.


timeout_enableOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property timeoutEnable: Specifies whether to enable timeout alerts.

Valid values:

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

timeout_kill_enableOptional

  • Type: typing.Union[bool, 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: typing.Union[str, ros_cdk_core.IResolvable]

Property timezone: The timezone of the job.


x_attrsOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]]

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

.


enable_resource_property_constraintOptional

  • Type: bool

Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
fetch_condition No description.
fetch_dependency No description.
fetch_resource_desc No description.
get_att No description.
set_metadata No description.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

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: ros_cdk_core.ISynthesisSession

The synthesis session.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired

  • Type: ros_cdk_core.RosCondition

add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired

  • Type: ros_cdk_core.Resource

add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired

  • Type: ros_cdk_core.RemovalPolicy

fetch_condition

def fetch_condition() -> RosCondition

fetch_dependency

def fetch_dependency() -> typing.List[str]

fetch_resource_desc

def fetch_resource_desc() -> str

get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.

is_construct

import ros_cdk_schedulerx
ros_cdk_schedulerx.Job.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
env ros_cdk_core.IResourceEnvironment The environment this resource belongs to.
ref str No description.
stack ros_cdk_core.Stack The stack in which this resource is defined.
resource ros_cdk_core.RosResource No description.
attr_job_id typing.Union[str, ros_cdk_core.IResolvable] Attribute JobId: The ID of the job.
props JobProps No description.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


envRequired

env: IResourceEnvironment
  • Type: 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

ref: str
  • Type: str

stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource
  • Type: ros_cdk_core.RosResource

attr_job_idRequired

attr_job_id: typing.Union[str, IResolvable]
  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Attribute JobId: The ID of the job.


propsRequired

props: JobProps