Commit 08f0fe9d by Adam Torok

Subnet & SubnetManager interface added

parent c601a95b
import json
class Subnet:
def __init__(self,
id,
network_id,
name,
cidr,
ip_version,
gateway_ip,
is_dhcp_enabled,
created_at
) -> None:
super().__init__()
self.id = id
self.network_id = network_id
self.name = name
self.cidr = cidr
self.ip_version = ip_version
self.gateway_ip = gateway_ip
self.is_dhcp_enabled = is_dhcp_enabled
self.created_at = created_at
def __str__(self) -> str:
return self.toJSON()
def toJSON(self):
return json.dumps(self.__dict__)
from interface.network.Subnet import Subnet
class SubnetManager:
def __init__(self) -> None:
super().__init__()
def create(self, network_id, ip_version, cidr) -> Subnet:
raise NotImplementedError
def get(self, id) -> Subnet:
raise NotImplementedError
def delete(self, id) -> bool:
raise NotImplementedError
def list(self) -> []:
raise NotImplementedError
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment