EVECelery.tasks.ESI.Routes.get_route_origin_destination#

A task definition module with associated response models returned by the task.

This module was automatically generated from Jinja templates with the codegen tool included in the root of this repo. You should not directly modify this module but instead modify the template ‘codegen/Templates/ESI_Task.py’.

Module Contents#

Classes#

get_route_origin_destination

Get route

class EVECelery.tasks.ESI.Routes.get_route_origin_destination.get_route_origin_destination#

Bases: EVECelery.tasks.BaseTasks.TaskESI.TaskESI

Get route

request_method() str#

Returns the type of request made to ESI

This method will return the request method (get, post, etc.) made to ESI.

Returns:

Request method passed to requests.request()

Return type:

str

route(destination: int, origin: int, **kwargs) str#

ESI route with input request parameters

Parameters:
  • destination (int) – destination solar system ID

  • origin (int) – origin solar system ID

Returns:

ESI route with request path parameters if any

Return type:

str

cache_ttl_default() int#

TTL for when cache is unspecified.

Returns:

The number of seconds to cache a response

Return type:

int

get_sync(destination: int, origin: int, avoid: list[int] | None = None, connections: list[list[int]] | None = None, datasource: str = 'tranquility', flag: str = 'shortest', kwargs_apply_async: dict | None = None, kwargs_get: dict | None = None) EVECelery.tasks.ESI.Routes.Models.get_route_origin_destination_200.Response200_get_route_origin_destination#

Get route

Get the systems between origin and destination

— Alternate route: /dev/route/{origin}/{destination}/

Alternate route: /legacy/route/{origin}/{destination}/

Alternate route: /v1/route/{origin}/{destination}/

— This route is cached for up to 86400 seconds

NOTE: This function calls the task and blocks until the result is available. This function is a wrapper around Celery’s task.apply_async() and AsyncResult.get() methods. Instead of a dictionary, this function returns a pydantic model to more easily see what returned data responses look like, what is optionally returned, etc.

If you would instead like to return an async result, use Celery’s apply_async() method on this task.

Parameters:
  • destination (int) – destination solar system ID

  • origin (int) – origin solar system ID

  • avoid (list[int] | None) – avoid solar system ID(s)

  • connections (list[list[int]] | None) – connected solar system pairs

  • datasource (str) – The server name you would like data from – [‘tranquility’]

  • flag (str) – route security preference – [‘shortest’, ‘secure’, ‘insecure’]

  • kwargs_apply_async (Optional[dict]) –

    Dictionary of keyword arguments passed to task.apply_async()

  • kwargs_get (Optional[dict]) –

    Dictionary of keyword arguments passed to AsyncResult.get()

Returns:

The response from ESI as a pydantic object. The response model will follow the structure of Response200_get_route_origin_destination.

Return type:

Union[EVECelery.tasks.ESI.Routes.Models.get_route_origin_destination_200.Response200_get_route_origin_destination]

run(destination: int, origin: int, avoid: list[int] | None = None, connections: list[list[int]] | None = None, datasource: str = 'tranquility', flag: str = 'shortest', **kwargs) dict#

The task body that runs on the EVECelery worker

This is the task body that runs on the EVECelery worker.

IMPORTANT NOTE: You should not directly call this function from your client code as it will run within the context of your client and won’t be sent to the message broker to run on a worker node. To correctly call this task body, see Celery’s documentation on methods for calling tasks.

See also this task’s get_sync() which is a wrapper function around Celery’s apply_async().get() call.

Get route

Get the systems between origin and destination

— Alternate route: /dev/route/{origin}/{destination}/

Alternate route: /legacy/route/{origin}/{destination}/

Alternate route: /v1/route/{origin}/{destination}/

— This route is cached for up to 86400 seconds

Parameters:
  • destination (int) – destination solar system ID

  • origin (int) – origin solar system ID

  • avoid (list[int] | None) – avoid solar system ID(s)

  • connections (list[list[int]] | None) – connected solar system pairs

  • datasource (str) – The server name you would like data from – [‘tranquility’]

  • flag (str) – route security preference – [‘shortest’, ‘secure’, ‘insecure’]

Returns:

The response from ESI as a JSON dictionary. The response dictionary will follow the structure of Response200_get_route_origin_destination.

Return type:

dict