flexget.api.core.tasks module#
- class flexget.api.core.tasks.EntryDecoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]#
Bases:
JSONEncoder- default(o)[source]#
Implement this method in a subclass such that it returns a serializable object for
o, or calls the base implementation (to raise aTypeError).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return super().default(o)
- class flexget.api.core.tasks.ExecuteLog(maxsize=0)[source]#
Bases:
QueueSupport task log streaming by acting like a file object.
- class flexget.api.core.tasks.ObjectsContainer[source]#
Bases:
object- inject_input = {'properties': {'accept': {'description': 'Accept this entry immediately upon injection (disregard task filters)', 'type': 'boolean'}, 'fields': {'description': 'A array of objects that can contain any other value for the entry', 'type': 'object'}, 'force': {'description': 'Prevent any plugins from rejecting this entry', 'type': 'boolean'}, 'title': {'description': 'Title of the entry. If not supplied it will be attempted to retrieve it from URL headers', 'type': 'string'}, 'url': {'description': 'URL of the entry', 'format': 'url', 'type': 'string'}}, 'required': ['url'], 'type': 'object'}#
- params_return_schema = {'items': {'type': 'object'}, 'type': 'array'}#
- task_execution_input = {'properties': {'entry_dump': {'default': True, 'description': 'Include dump of entries including fields', 'type': 'boolean'}, 'inject': {'description': 'A List of entry objects', 'items': {'properties': {'accept': {'description': 'Accept this entry immediately upon injection (disregard task filters)', 'type': 'boolean'}, 'fields': {'description': 'A array of objects that can contain any other value for the entry', 'type': 'object'}, 'force': {'description': 'Prevent any plugins from rejecting this entry', 'type': 'boolean'}, 'title': {'description': 'Title of the entry. If not supplied it will be attempted to retrieve it from URL headers', 'type': 'string'}, 'url': {'description': 'URL of the entry', 'format': 'url', 'type': 'string'}}, 'required': ['url'], 'type': 'object'}, 'type': 'array'}, 'loglevel': {'description': 'Specify log level', 'enum': ['critical', 'error', 'warning', 'info', 'verbose', 'debug', 'trace'], 'type': 'string'}, 'progress': {'default': True, 'description': 'Include task progress updates', 'type': 'boolean'}, 'summary': {'default': True, 'description': 'Include task summary', 'type': 'boolean'}, 'tasks': {'items': {'type': 'string'}, 'minItems': 1, 'type': 'array', 'uniqueItems': True}}, 'required': ['tasks'], 'type': 'object'}#
- task_execution_results_schema = {'properties': {'task': {'properties': {'id': {'type': 'integer'}, 'name': {'type': 'string'}, 'stream': {'items': {'entry_dump': {'items': {'type': 'object'}, 'type': 'array'}, 'log': {'type': 'string'}, 'progress': {'properties': {'percent': {'type': 'float'}, 'phase': {'enum': ['prepare', 'start', 'input', 'metainfo', 'filter', 'download', 'modify', 'output', 'learn', 'exit'], 'type': 'string'}, 'plugin': {'type': 'string'}, 'status': {'enum': ['pending', 'running', 'complete'], 'type': 'string'}}, 'type': 'object'}, 'summary': {'properties': {'abort_reason': {'type': 'string'}, 'aborted': {'type': 'boolean'}, 'accepted': {'type': 'integer'}, 'failed': {'type': 'integer'}, 'rejected': {'type': 'integer'}, 'undecided': {'type': 'integer'}}, 'type': 'object'}}, 'type': 'array'}}, 'type': 'object'}}, 'type': 'object'}#
- task_input_object = {'additionalProperties': False, 'properties': {'config': {'$ref': '/schema/plugins'}, 'name': {'type': 'string'}}, 'required': ['name', 'config'], 'type': 'object'}#
- task_queue_schema = {'items': {'properties': {'current_phase': {'type': ['string', 'null']}, 'current_plugin': {'type': ['string', 'null']}, 'id': {'type': 'integer'}, 'name': {'type': 'string'}}, 'type': 'object'}, 'type': 'array'}#
- task_return_object = {'additionalProperties': False, 'properties': {'config': {'type': 'object'}, 'name': {'type': 'string'}}, 'required': ['name', 'config'], 'type': 'object'}#
- tasks_list_object = {'oneOf': [{'items': {'$ref': '#/definitions/tasks.task'}, 'type': 'array'}, {'items': {'type': 'string'}, 'type': 'array'}]}#
- class flexget.api.core.tasks.TaskAPI(api, *args, **kwargs)[source]#
Bases:
APIResource- Parameters:
api (RestxAPI)
- delete(task, session=None)[source]#
Delete a task.
- Parameters:
session (Session)
- Return type:
Response
- get(task, session=None)[source]#
Get task config.
- Parameters:
session (Session)
- Return type:
Response
- mediatypes()#
- put(task, session=None)[source]#
Update tasks config.
- Parameters:
session (Session)
- Return type:
Response
- endpoint = 'tasks_task_api'#
- methods: ClassVar[Collection[str] | None] = {'DELETE', 'GET', 'PUT'}#
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]) asrouteandadd_url_ruleby default.
- class flexget.api.core.tasks.TaskExecutionAPI(api, *args, **kwargs)[source]#
Bases:
APIResource- Parameters:
api (RestxAPI)
- mediatypes()#
- post(session=None)[source]#
Execute task and stream results.
- Parameters:
session (Session)
- Return type:
Response
- endpoint = 'inject_task_execution_api'#
- methods: ClassVar[Collection[str] | None] = {'POST'}#
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]) asrouteandadd_url_ruleby default.
- class flexget.api.core.tasks.TaskExecutionParams(api, *args, **kwargs)[source]#
Bases:
APIResource- Parameters:
api (RestxAPI)
- get(session=None)[source]#
Execute payload parameters.
- Parameters:
session (Session)
- Return type:
Response
- mediatypes()#
- endpoint = 'inject_task_execution_params'#
- methods: ClassVar[Collection[str] | None] = {'GET'}#
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]) asrouteandadd_url_ruleby default.
- class flexget.api.core.tasks.TaskQueueAPI(api, *args, **kwargs)[source]#
Bases:
APIResource- Parameters:
api (RestxAPI)
- get(session=None)[source]#
List task(s) in queue for execution.
- Parameters:
session (Session)
- Return type:
Response
- mediatypes()#
- endpoint = 'tasks_task_queue_api'#
- methods: ClassVar[Collection[str] | None] = {'GET'}#
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]) asrouteandadd_url_ruleby default.
- class flexget.api.core.tasks.TasksAPI(api, *args, **kwargs)[source]#
Bases:
APIResource- Parameters:
api (RestxAPI)
- mediatypes()#
- endpoint = 'tasks_tasks_api'#
- methods: ClassVar[Collection[str] | None] = {'GET', 'POST'}#
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]) asrouteandadd_url_ruleby default.