Skip to content

RosJob

This class is a base encapsulation around the ROS resource type ALIYUN::PAIDLC::Job, which is used to create a Machine Learning Platform for AI (PAI) job to run in a cluster.

Initializers

import ros_cdk_paidlc
ros_cdk_paidlc.RosJob(
  scope: Construct,
  id: str,
  display_name: typing.Union[str, IResolvable],
  job_specs: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, JobSpecsProperty]]],
  job_type: typing.Union[str, IResolvable],
  user_command: typing.Union[str, IResolvable],
  workspace_id: typing.Union[str, IResolvable],
  code_source: typing.Union[IResolvable, CodeSourceProperty] = None,
  data_sources: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, DataSourcesProperty]]] = None,
  envs: typing.Union[str, IResolvable] = None,
  job_max_running_time_minutes: typing.Union[typing.Union[int, float], IResolvable] = None,
  options: typing.Union[str, IResolvable] = None,
  priority: typing.Union[typing.Union[int, float], IResolvable] = None,
  resource_id: typing.Union[str, IResolvable] = None,
  settings: typing.Union[IResolvable, typing.Mapping[typing.Any]] = None,
  success_policy: typing.Union[str, IResolvable] = None,
  thirdparty_lib_dir: typing.Union[str, IResolvable] = None,
  thirdparty_libs: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  user_vpc: typing.Union[IResolvable, UserVpcProperty] = None,
  enable_resource_property_constraint: bool
)
Name Type Description
scope ros_cdk_core.Construct - scope in which this resource is defined.
id str - scoped id of the resource.
display_name typing.Union[str, ros_cdk_core.IResolvable] No description.
job_specs typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, JobSpecsProperty]]] No description.
job_type typing.Union[str, ros_cdk_core.IResolvable] No description.
user_command typing.Union[str, ros_cdk_core.IResolvable] No description.
workspace_id typing.Union[str, ros_cdk_core.IResolvable] No description.
code_source typing.Union[ros_cdk_core.IResolvable, CodeSourceProperty] No description.
data_sources typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, DataSourcesProperty]]] No description.
envs typing.Union[str, ros_cdk_core.IResolvable] No description.
job_max_running_time_minutes typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] No description.
options typing.Union[str, ros_cdk_core.IResolvable] No description.
priority typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] No description.
resource_id typing.Union[str, ros_cdk_core.IResolvable] No description.
settings typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] No description.
success_policy typing.Union[str, ros_cdk_core.IResolvable] No description.
thirdparty_lib_dir typing.Union[str, ros_cdk_core.IResolvable] No description.
thirdparty_libs typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] No description.
user_vpc typing.Union[ros_cdk_core.IResolvable, UserVpcProperty] No description.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

scope in which this resource is defined.


idRequired

  • Type: str

scoped id of the resource.


display_nameRequired

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

job_specsRequired

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

job_typeRequired

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

user_commandRequired

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

workspace_idRequired

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

code_sourceOptional


data_sourcesOptional

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

envsOptional

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

job_max_running_time_minutesOptional

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

optionsOptional

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

priorityOptional

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

resource_idOptional

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

settingsOptional

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

success_policyOptional

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

thirdparty_lib_dirOptional

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

thirdparty_libsOptional

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

user_vpcOptional


enable_resource_property_constraintRequired

  • 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.
override_logical_id Overrides the auto-generated logical ID with a specific ID.
add_condition No description.
add_count No description.
add_deletion_override Syntactic sugar for addOverride(path, undefined).
add_depends_on Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
add_desc No description.
add_meta_data No description.
add_override Adds an override to the synthesized ROS resource.
add_property_deletion_override Adds an override that deletes the value of a property from the resource definition.
add_property_override Adds an override to a resource property.
add_ros_dependency No description.
apply_removal_policy Sets the deletion policy of the resource based on the removal policy specified.
get_att Returns a token for an runtime attribute of this resource.

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.


override_logical_id

def override_logical_id(
  new_logical_id: str
) -> None

Overrides the auto-generated logical ID with a specific ID.

new_logical_idRequired

  • Type: str

The new logical ID to use for this stack element.


add_condition

def add_condition(
  con: RosCondition
) -> None

conRequired

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

def add_deletion_override(
  path: str
) -> None

Syntactic sugar for addOverride(path, undefined).

pathRequired

  • Type: str

The path of the value to delete.


add_depends_on

def add_depends_on(
  target: RosResource
) -> None

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

targetRequired

  • Type: ros_cdk_core.RosResource

add_desc

def add_desc(
  desc: str
) -> None

descRequired

  • Type: str

add_meta_data

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

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

add_override

def add_override(
  path: str,
  value: typing.Any
) -> None

Adds an override to the synthesized ROS resource.

To add a property override, either use addPropertyOverride or prefix path with "Properties." (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

For example,

addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute'])
addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE')

would add the overrides

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

pathRequired

  • Type: str

The path of the property, you can use dot notation to override values in complex types.

Any intermdediate keys will be created as needed.


valueRequired

  • Type: typing.Any

The value.

Could be primitive or complex.


add_property_deletion_override

def add_property_deletion_override(
  property_path: str
) -> None

Adds an override that deletes the value of a property from the resource definition.

property_pathRequired

  • Type: str

The path to the property.


add_property_override

def add_property_override(
  property_path: str,
  value: typing.Any
) -> None

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

property_pathRequired

  • Type: str

The path of the property.


valueRequired

  • Type: typing.Any

The value.


add_ros_dependency

def add_ros_dependency(
  target: str
) -> None

targetRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy = None,
  apply_to_update_replace_policy: bool = None,
  default_policy: RemovalPolicy = None
) -> None

Sets the deletion policy of the resource based on the removal policy specified.

policyOptional

  • Type: ros_cdk_core.RemovalPolicy

apply_to_update_replace_policyOptional

  • Type: bool

default_policyOptional

  • Type: ros_cdk_core.RemovalPolicy

get_att

def get_att(
  attribute_name: str
) -> Reference

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

attribute_nameRequired

  • Type: str

The name of the attribute.


Static Functions

Name Description
is_construct Return whether the given object is a Construct.
is_ros_element Returns true if a construct is a stack element (i.e. part of the synthesized template).
is_ros_resource Check whether the given construct is a RosResource.

is_construct

import ros_cdk_paidlc
ros_cdk_paidlc.RosJob.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

is_ros_element

import ros_cdk_paidlc
ros_cdk_paidlc.RosJob.is_ros_element(
  x: typing.Any
)

Returns true if a construct is a stack element (i.e. part of the synthesized template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

xRequired

  • Type: typing.Any

is_ros_resource

import ros_cdk_paidlc
ros_cdk_paidlc.RosJob.is_ros_resource(
  construct: IConstruct
)

Check whether the given construct is a RosResource.

constructRequired

  • Type: ros_cdk_core.IConstruct

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
creation_stack typing.List[str] No description.
logical_id str The logical ID for this stack element.
stack ros_cdk_core.Stack The stack in which this element is defined.
ref str Return a string that will be resolved to a RosTemplate { Ref } for this element.
ros_options ros_cdk_core.IRosResourceOptions Options for this resource, such as condition, update policy etc.
ros_resource_type str ROS resource type.
attr_job_id ros_cdk_core.IResolvable No description.
display_name typing.Union[str, ros_cdk_core.IResolvable] No description.
enable_resource_property_constraint bool No description.
job_specs typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, JobSpecsProperty]]] No description.
job_type typing.Union[str, ros_cdk_core.IResolvable] No description.
user_command typing.Union[str, ros_cdk_core.IResolvable] No description.
workspace_id typing.Union[str, ros_cdk_core.IResolvable] No description.
code_source typing.Union[ros_cdk_core.IResolvable, CodeSourceProperty] No description.
data_sources typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[ros_cdk_core.IResolvable, DataSourcesProperty]]] No description.
envs typing.Union[str, ros_cdk_core.IResolvable] No description.
job_max_running_time_minutes typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] No description.
options typing.Union[str, ros_cdk_core.IResolvable] No description.
priority typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable] No description.
resource_id typing.Union[str, ros_cdk_core.IResolvable] No description.
settings typing.Union[ros_cdk_core.IResolvable, typing.Mapping[typing.Any]] No description.
success_policy typing.Union[str, ros_cdk_core.IResolvable] No description.
thirdparty_lib_dir typing.Union[str, ros_cdk_core.IResolvable] No description.
thirdparty_libs typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] No description.
user_vpc typing.Union[ros_cdk_core.IResolvable, UserVpcProperty] No description.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


creation_stackRequired

creation_stack: typing.List[str]
  • Type: typing.List[str]

logical_idRequired

logical_id: str
  • Type: str

The logical ID for this stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).


stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this element is defined.

RosElements must be defined within a stack scope (directly or indirectly).


refRequired

ref: str
  • Type: str

Return a string that will be resolved to a RosTemplate { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).


ros_optionsRequired

ros_options: IRosResourceOptions
  • Type: ros_cdk_core.IRosResourceOptions

Options for this resource, such as condition, update policy etc.


ros_resource_typeRequired

ros_resource_type: str
  • Type: str

ROS resource type.


attr_job_idRequired

attr_job_id: IResolvable
  • Type: ros_cdk_core.IResolvable

display_nameRequired

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

enable_resource_property_constraintRequired

enable_resource_property_constraint: bool
  • Type: bool

job_specsRequired

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

job_typeRequired

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

user_commandRequired

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

workspace_idRequired

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

code_sourceOptional

code_source: typing.Union[IResolvable, CodeSourceProperty]

data_sourcesOptional

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

envsOptional

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

job_max_running_time_minutesOptional

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

optionsOptional

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

priorityOptional

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

resource_idOptional

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

settingsOptional

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

success_policyOptional

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

thirdparty_lib_dirOptional

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

thirdparty_libsOptional

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

user_vpcOptional

user_vpc: typing.Union[IResolvable, UserVpcProperty]

Constants

Name Type Description
ROS_RESOURCE_TYPE_NAME str The resource type name for this resource class.

ROS_RESOURCE_TYPE_NAMERequired

ROS_RESOURCE_TYPE_NAME: str
  • Type: str

The resource type name for this resource class.