pc.get_engine
pc.get_engine(name=None, engine_id=None, activate=True)
Get and return the specified engine object.
Parameters:
name: Optional[str], default None
Name of the engine to be selected.
engine_id: Optional[int], default None
ID of the engine to be selected.
activate: Optional[bool], default True
Should the engine be activated upon selection.
- If engine is already active this will throw an error.
Returns:
Examples:
Get the already created medium cpu engine by name.
engine = pc.get_engine('medium_cpu_engine', activate=True)
Get the already created medium cpu engine by engine ID.
pc.list_engines()
# > [Engine(id=2, name=medium_cpu_engine, status=Suspended, type=kubernetes, template_id=3, auto_suspend_seconds=1800, auto_resume=True),
# Engine(id=1, name=default_engine, status=Active, type=kubernetes, template_id=1, auto_suspend_seconds=3600, auto_resume=True)]
engine = pc.get_engine(engine_id=2)