platypush/platypush/entities/managers/cloud.py
Fabio Manganiello 7bbae55e44
platypush.entities._managers -> platypush.entities.managers.
It's better for entity managers to be stored in their own public
package, instead of cluttering too much the namespace of their parent
package.
2023-03-26 03:46:06 +02:00

41 lines
988 B
Python

from abc import ABC, abstractmethod
from typing import Union
from uuid import UUID
from . import EntityManager
InstanceId = Union[str, int, UUID]
class CloudInstanceEntityManager(EntityManager, ABC):
"""
Base class for integrations that support cloud instances (like Linode or
AWS).
"""
@abstractmethod
def reboot(self, instance: InstanceId, **_):
"""
Reboot an instance.
:param instance: ID or name of the instance to be rebooted.
"""
raise NotImplementedError()
@abstractmethod
def boot(self, instance: InstanceId, **_):
"""
Boot an instance.
:param instance: ID or name of the instance to be rebooted.
"""
raise NotImplementedError()
@abstractmethod
def shutdown(self, instance: InstanceId, **_):
"""
Shutdown an instance.
:param instance: ID or name of the instance to be rebooted.
"""
raise NotImplementedError()