register_activity_type
¶
register_activity_type(
domain: DomainName,
name: Name,
version: Version,
*,
config_overrides: Optional[SWFClientConfig] = None,
description: Optional[Description] = None,
default_task_start_to_close_timeout: Optional[DurationInSecondsOptional] = None,
default_task_heartbeat_timeout: Optional[DurationInSecondsOptional] = None,
default_task_list: Optional[TaskList] = None,
default_task_priority: Optional[TaskPriority] = None,
default_task_schedule_to_start_timeout: Optional[DurationInSecondsOptional] = None,
default_task_schedule_to_close_timeout: Optional[DurationInSecondsOptional] = None,
) -> None
Registers a new activity type along with its configuration settings in the specified domain.
A TypeAlreadyExists fault is returned if the type already exists in the domain. You cannot change any configuration settings of the type after its registration, and it must be registered as a new version.
Access Control
You can use IAM policies to control this action's access to Amazon SWF resources as follows:
-
Use a
Resourceelement with the domain name to limit the action to only specified domains. -
Use an
Actionelement to allow or deny permission to call this action. -
Constrain the following parameters by using a
Conditionelement with the appropriate keys.-
defaultTaskList.name: String constraint. The key isswf:defaultTaskList.name. -
name: String constraint. The key isswf:name. -
version: String constraint. The key isswf:version.
-
If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED. For details and example IAM policies, see Using IAM to Manage Access to Amazon SWF Workflows in the Amazon SWF Developer Guide.
Parameters:
-
domain(DomainName) –The name of the domain in which this activity is to be registered.
-
name(Name) –The name of the activity type within the domain.
The specified string must not contain a
:(colon),/(slash),|(vertical bar), or any control characters (\u0000-\u001f|\u007f-\u009f). Also, it must not be the literal stringarn. -
version(Version) –The version of the activity type.
The activity type consists of the name and version, the combination of which must be unique within the domain.
The specified string must not contain a
:(colon),/(slash),|(vertical bar), or any control characters (\u0000-\u001f|\u007f-\u009f). Also, it must not be the literal stringarn. -
description(Optional[Description], default:None) –A textual description of the activity type.
-
default_task_start_to_close_timeout(Optional[DurationInSecondsOptional], default:None) –If set, specifies the default maximum duration that a worker can take to process tasks of this activity type. This default can be overridden when scheduling an activity task using the
ScheduleActivityTaskDecision.The duration is specified in seconds, an integer greater than or equal to
0. You can useNONEto specify unlimited duration. -
default_task_heartbeat_timeout(Optional[DurationInSecondsOptional], default:None) –If set, specifies the default maximum time before which a worker processing a task of this type must report progress by calling RecordActivityTaskHeartbeat. If the timeout is exceeded, the activity task is automatically timed out. This default can be overridden when scheduling an activity task using the
ScheduleActivityTaskDecision. If the activity worker subsequently attempts to record a heartbeat or returns a result, the activity worker receives anUnknownResourcefault. In this case, Amazon SWF no longer considers the activity task to be valid; the activity worker should clean up the activity task.The duration is specified in seconds, an integer greater than or equal to
0. You can useNONEto specify unlimited duration. -
default_task_list(Optional[TaskList], default:None) –If set, specifies the default task list to use for scheduling tasks of this activity type. This default task list is used if a task list isn't provided when a task is scheduled through the
ScheduleActivityTaskDecision. -
default_task_priority(Optional[TaskPriority], default:None) –The default task priority to assign to the activity type. If not assigned, then
0is used. Valid values are integers that range from Java'sInteger.MIN_VALUE(-2147483648) toInteger.MAX_VALUE(2147483647). Higher numbers indicate higher priority.For more information about setting task priority, see Setting Task Priority in the in the Amazon SWF Developer Guide..
-
default_task_schedule_to_start_timeout(Optional[DurationInSecondsOptional], default:None) –If set, specifies the default maximum duration that a task of this activity type can wait before being assigned to a worker. This default can be overridden when scheduling an activity task using the
ScheduleActivityTaskDecision.The duration is specified in seconds, an integer greater than or equal to
0. You can useNONEto specify unlimited duration. -
default_task_schedule_to_close_timeout(Optional[DurationInSecondsOptional], default:None) –If set, specifies the default maximum duration for a task of this activity type. This default can be overridden when scheduling an activity task using the
ScheduleActivityTaskDecision.The duration is specified in seconds, an integer greater than or equal to
0. You can useNONEto specify unlimited duration.
Raises:
-
LimitExceededFault–Returned by any operation if a system imposed limitation has been reached. To address this fault you should either clean up unused resources or increase the limit by contacting AWS.
-
OperationNotPermittedFault–Returned when the caller doesn't have sufficient permissions to invoke the action.
-
TypeAlreadyExistsFault–Returned if the type already exists in the specified domain. You may get this fault if you are registering a type that is either already registered or deprecated, or if you undeprecate a type that is currently registered.
-
UnknownResourceFault–Returned when the named resource cannot be found with in the scope of this operation (region or domain). This could happen if the named resource was never created or is no longer available for this operation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_swf/_services/swf.py
1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 | |