def get(self, workflow_id, run_id, *args, **kwargs): """ """ try: response = self.connection.describe_workflow_execution( self.domain.name, run_id, workflow_id ) except SWFResponseError as e: if e.error_code == "UnknownResourceFault": raise DoesNotExistError(e.body["message"]) raise ResponseError(e.body["message"]) execution_info = response[self._infos] execution_config = response["executionConfiguration"] return self.to_WorkflowExecution( self.domain, execution_info, task_list=get_subkey(execution_config, ["taskList", "name"]), child_policy=execution_config.get("childPolicy"), execution_timeout=execution_config.get("executionStartToCloseTimeout"), decision_tasks_timeout=execution_config.get("taskStartToCloseTimeout"), latest_activity_task_timestamp=response.get("latestActivityTaskTimestamp"), latest_execution_context=response.get("latestExecutionContext"), open_counts=response["openCounts"], )
def get(self, workflow_id, run_id, *args, **kwargs): """ """ try: response = self.connection.describe_workflow_execution( self.domain.name, run_id, workflow_id) except SWFResponseError as e: if e.error_code == 'UnknownResourceFault': raise DoesNotExistError(e.body['message']) raise ResponseError(e.body['message']) execution_info = response[self._infos] execution_config = response['executionConfiguration'] return self.to_WorkflowExecution( self.domain, execution_info, task_list=get_subkey(execution_config, ['taskList', 'name']), child_policy=execution_config.get('childPolicy'), execution_timeout=execution_config.get('executionStartToCloseTimeout'), decision_tasks_timeout=execution_config.get('taskStartToCloseTimeout'), latest_activity_task_timestamp=response.get('latestActivityTaskTimestamp'), latest_execution_context=response.get('latestExecutionContext'), open_counts=response['openCounts'], )
def to_WorkflowExecution(self, domain, execution_info, **kwargs): workflow_type = WorkflowType( self.domain, execution_info['workflowType']['name'], execution_info['workflowType']['version'] ) return WorkflowExecution( domain, get_subkey(execution_info, ['execution', 'workflowId']), # workflow_id run_id=get_subkey(execution_info, ['execution', 'runId']), workflow_type=workflow_type, status=execution_info.get('executionStatus'), close_status=execution_info.get('closeStatus'), tag_list=execution_info.get('tagList'), **kwargs )
def to_WorkflowExecution(self, domain, execution_info, **kwargs): workflow_type = WorkflowType(self.domain, execution_info['workflowType']['name'], execution_info['workflowType']['version']) return WorkflowExecution( domain, get_subkey(execution_info, ['execution', 'workflowId']), # workflow_id run_id=get_subkey(execution_info, ['execution', 'runId']), workflow_type=workflow_type, status=execution_info.get('executionStatus'), close_status=execution_info.get('closeStatus'), tag_list=execution_info.get('tagList'), start_timestamp=execution_info.get('startTimestamp'), close_timestamp=execution_info.get('closeTimestamp'), cancel_requested=execution_info.get('cancelRequested'), parent=execution_info.get('parent'), **kwargs)
def to_WorkflowExecution(self, domain, execution_info, **kwargs): workflow_type = WorkflowType( self.domain, execution_info["workflowType"]["name"], execution_info["workflowType"]["version"], ) return WorkflowExecution( domain, get_subkey(execution_info, ["execution", "workflowId"]), # workflow_id run_id=get_subkey(execution_info, ["execution", "runId"]), workflow_type=workflow_type, status=execution_info.get("executionStatus"), close_status=execution_info.get("closeStatus"), tag_list=execution_info.get("tagList"), start_timestamp=execution_info.get("startTimestamp"), close_timestamp=execution_info.get("closeTimestamp"), cancel_requested=execution_info.get("cancelRequested"), parent=execution_info.get("parent"), **kwargs )
def to_WorkflowExecution(self, domain, execution_info, **kwargs): workflow_type = WorkflowType( self.domain, execution_info['workflowType']['name'], execution_info['workflowType']['version'] ) return WorkflowExecution( domain, get_subkey(execution_info, ['execution', 'workflowId']), # workflow_id run_id=get_subkey(execution_info, ['execution', 'runId']), workflow_type=workflow_type, status=execution_info.get('executionStatus'), close_status=execution_info.get('closeStatus'), tag_list=execution_info.get('tagList'), start_timestamp=execution_info.get('startTimestamp'), close_timestamp=execution_info.get('closeTimestamp'), cancel_requested=execution_info.get('cancelRequested'), parent=execution_info.get('parent'), **kwargs )
def get(self, workflow_id, run_id, *args, **kwargs): """ """ try: response = self.connection.describe_workflow_execution( self.domain.name, run_id, workflow_id) except SWFResponseError as e: if e.error_code == 'UnknownResourceFault': raise DoesNotExistError(e.body['message']) raise ResponseError(e.body['message']) execution_info = response[self._infos] execution_config = response['executionConfiguration'] return self.to_WorkflowExecution( self.domain, execution_info, task_list=get_subkey(execution_config, ['defaultTaskList', 'name']), child_policy=execution_config.get('childPolicy'), execution_timeout=execution_config.get('executionStartToCloseTimeout'), decision_tasks_timeout=execution_config.get('taskStartToCloseTimeout'), )
def get(self, name, version, *args, **kwargs): """Fetches the Workflow Type with `name` and `version` :param name: name of the workflow type :type name: String :param version: workflow type version :type version: String :returns: matched workflow type instance :rtype: swf.core.model.workflow.WorkflowType A typical Amazon response looks like: .. code-block:: json { "configuration": { "defaultExecutionStartToCloseTimeout": "300", "defaultTaskStartToCloseTimeout": "300", "defaultTaskList": { "name": "None" }, "defaultChildPolicy": "TERMINATE" }, "typeInfo": { "status": "REGISTERED", "creationDate": 1364492094.968, "workflowType": { "version": "1", "name": "testW" } } } """ try: response = self.connection.describe_workflow_type( self.domain.name, name, version ) except SWFResponseError as e: if e.error_code == "UnknownResourceFault": raise DoesNotExistError(e.body["message"]) raise ResponseError(e.body["message"]) wt_info = response[self._infos] wt_config = response["configuration"] task_list = kwargs.get("task_list") if task_list is None: task_list = get_subkey(wt_config, ["defaultTaskList", "name"]) child_policy = kwargs.get("child_policy") if child_policy is None: child_policy = wt_config.get("defaultChildPolicy") decision_task_timeout = kwargs.get("decision_task_timeout") if decision_task_timeout is None: decision_task_timeout = wt_config.get("defaultTaskStartToCloseTimeout") execution_timeout = kwargs.get("execution_timeout") if execution_timeout is None: execution_timeout = wt_config.get("defaultExecutionStartToCloseTimeout") decision_tasks_timeout = kwargs.get("decision_tasks_timeout") if decision_tasks_timeout is None: decision_tasks_timeout = wt_config.get("defaultTaskStartToCloseTimeout") return self.to_WorkflowType( self.domain, wt_info, task_list=task_list, child_policy=child_policy, execution_timeout=execution_timeout, decision_tasks_timeout=decision_tasks_timeout, )
def get(self, name, version, *args, **kwargs): """Fetches the Workflow Type with `name` and `version` :param name: name of the workflow type :type name: String :param version: workflow type version :type version: String :returns: matched workflow type instance :rtype: swf.core.model.workflow.WorkflowType A typical Amazon response looks like: .. code-block:: json { "configuration": { "defaultExecutionStartToCloseTimeout": "300", "defaultTaskStartToCloseTimeout": "300", "defaultTaskList": { "name": "None" }, "defaultChildPolicy": "TERMINATE" }, "typeInfo": { "status": "REGISTERED", "creationDate": 1364492094.968, "workflowType": { "version": "1", "name": "testW" } } } """ try: response = self.connection.describe_workflow_type(self.domain.name, name, version) except SWFResponseError as e: if e.error_code == 'UnknownResourceFault': raise DoesNotExistError(e.body['message']) raise ResponseError(e.body['message']) wt_info = response[self._infos] wt_config = response['configuration'] task_list = kwargs.get('task_list') if task_list is None: task_list = get_subkey(wt_config, ['defaultTaskList', 'name']) child_policy = kwargs.get('child_policy') if child_policy is None: child_policy = wt_config.get('defaultChildPolicy') decision_task_timeout = kwargs.get('decision_task_timeout') if decision_task_timeout is None: decision_task_timeout = wt_config.get( 'defaultTaskStartToCloseTimeout') execution_timeout = kwargs.get('execution_timeout') if execution_timeout is None: execution_timeout = wt_config.get( 'defaultExecutionStartToCloseTimeout') decision_tasks_timeout = kwargs.get('decision_tasks_timeout') if decision_tasks_timeout is None: decision_tasks_timeout = wt_config.get( 'defaultTaskStartToCloseTimeout') return self.to_WorkflowType( self.domain, wt_info, task_list=task_list, child_policy=child_policy, execution_timeout=execution_timeout, decision_tasks_timeout=decision_tasks_timeout, )
def get(self, name, version, *args, **kwargs): """Fetches the activity type with provided ``name`` and ``version`` :param name: activity type name to fetch :type name: String :param version: activity version to fetch :type version: String :returns: Matched activity type instance :rtype: swf.models.activity.ActivityType A typical Amazon response looks like: .. code-block:: json { "configuration": { "defaultTaskHeartbeatTimeout": "string", "defaultTaskList": { "name": "string" }, "defaultTaskScheduleToCloseTimeout": "string", "defaultTaskScheduleToStartTimeout": "string", "defaultTaskStartToCloseTimeout": "string" }, "typeInfo": { "activityType": { "name": "string", "version": "string" }, "creationDate": "number", "deprecationDate": "number", "description": "string", "status": "string" } } """ try: response = self.connection.describe_activity_type( self.domain.name, name, version ) except SWFResponseError as e: if e.error_code == "UnknownResourceFault": raise DoesNotExistError(e.error_message) raise ResponseError(e.error_message) activity_info = response[self._infos] activity_config = response["configuration"] task_list = kwargs.get("task_list") if task_list is None: task_list = get_subkey(activity_config, ["defaultTaskList", "name"]) task_heartbeat_timeout = kwargs.get("task_heartbeat_timeout") if task_heartbeat_timeout is None: task_heartbeat_timeout = activity_config.get("defaultTaskHeartbeatTimeout") task_schedule_to_close_timeout = kwargs.get("task_schedule_to_close_timeout") if task_schedule_to_close_timeout is None: task_schedule_to_close_timeout = activity_config.get( "defaultTaskScheduleToCloseTimeout" ) task_schedule_to_start_timeout = kwargs.get("task_schedule_to_start_timeout") if task_schedule_to_start_timeout is None: task_schedule_to_start_timeout = activity_config.get( "defaultTaskScheduleToStartTimeout" ) task_start_to_close_timeout = kwargs.get("task_start_to_close_timeout") if task_start_to_close_timeout is None: task_start_to_close_timeout = activity_config.get( "defaultTaskStartToCloseTimeout" ) return self.to_ActivityType( self.domain, activity_info, task_list=task_list, task_heartbeat_timeout=task_heartbeat_timeout, task_schedule_to_close_timeout=task_schedule_to_close_timeout, task_schedule_to_start_timeout=task_schedule_to_start_timeout, task_start_to_close_timeout=task_start_to_close_timeout, )
def get(self, name, version, *args, **kwargs): """Fetches the activity type with provided ``name`` and ``version`` :param name: activity type name to fetch :type name: String :param version: activity version to fetch :type version: String :returns: Matched activity type instance :rtype: swf.models.activity.ActivityType A typical Amazon response looks like: .. code-block:: json { "configuration": { "defaultTaskHeartbeatTimeout": "string", "defaultTaskList": { "name": "string" }, "defaultTaskScheduleToCloseTimeout": "string", "defaultTaskScheduleToStartTimeout": "string", "defaultTaskStartToCloseTimeout": "string" }, "typeInfo": { "activityType": { "name": "string", "version": "string" }, "creationDate": "number", "deprecationDate": "number", "description": "string", "status": "string" } } """ try: response = self.connection.describe_activity_type(self.domain.name, name, version) except SWFResponseError as e: if e.error_code == 'UnknownResourceFault': raise DoesNotExistError(e.error_message) raise ResponseError(e.error_message) activity_info = response[self._infos] activity_config = response['configuration'] task_list = kwargs.get('task_list') if task_list is None: task_list = get_subkey(activity_config, ['defaultTaskList', 'name']) task_heartbeat_timeout = kwargs.get('task_heartbeat_timeout') if task_heartbeat_timeout is None: task_heartbeat_timeout = activity_config.get( 'defaultTaskHeartbeatTimeout') task_schedule_to_close_timeout = kwargs.get( 'task_schedule_to_close_timeout') if task_schedule_to_close_timeout is None: task_schedule_to_close_timeout = activity_config.get( 'defaultTaskScheduleToCloseTimeout') task_schedule_to_start_timeout = kwargs.get( 'task_schedule_to_start_timeout') if task_schedule_to_start_timeout is None: task_schedule_to_start_timeout = activity_config.get( 'defaultTaskScheduleToStartTimeout') task_start_to_close_timeout = kwargs.get('task_start_to_close_timeout') if task_start_to_close_timeout is None: task_start_to_close_timeout = activity_config.get( 'defaultTaskStartToCloseTimeout') return self.to_ActivityType( self.domain, activity_info, task_list=task_list, task_heartbeat_timeout=task_heartbeat_timeout, task_schedule_to_close_timeout=task_schedule_to_close_timeout, task_schedule_to_start_timeout=task_schedule_to_start_timeout, task_start_to_close_timeout=task_start_to_close_timeout, )