-
Notifications
You must be signed in to change notification settings - Fork 7
/
instance_api.py
40 lines (26 loc) · 1.11 KB
/
instance_api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright (c) 2019, Substratum LLC (https://substratum.net) and/or its affiliates. All rights reserved.
from abc import ABCMeta, abstractmethod, abstractproperty
class InstanceApi:
__metaclass__ = ABCMeta
def machine_name(self):
return self._machine_name
def getnode(self): raise NotImplementedError
def setnode(self, value): raise NotImplementedError
node = abstractproperty(getnode, setnode)
def getdns(self): raise NotImplementedError
def setdns(self): raise NotImplementedError
dns = abstractproperty(getdns, setdns)
def gettraffic(self): raise NotImplementedError
def settraffic(self): raise NotImplementedError
traffic = abstractproperty(gettraffic, settraffic)
@abstractmethod
def start_instance(self): raise NotImplementedError
@abstractmethod
def stop_instance(self): raise NotImplementedError
@abstractmethod
def restart_instance(self): raise NotImplementedError
@abstractmethod
def get_external_ip(self): raise NotImplementedError
# TODO add this fn
# @abstractmethod
# def is_running(self): raise NotImplementedError