summaryrefslogtreecommitdiffstats
path: root/snaps/domain/network.py
diff options
context:
space:
mode:
Diffstat (limited to 'snaps/domain/network.py')
-rw-r--r--snaps/domain/network.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/snaps/domain/network.py b/snaps/domain/network.py
index 0ba9e99..68889f1 100644
--- a/snaps/domain/network.py
+++ b/snaps/domain/network.py
@@ -14,6 +14,42 @@
# limitations under the License.
+class Network:
+ """
+ SNAPS domain object for interface routers. Should contain attributes that
+ are shared amongst cloud providers
+ """
+ def __init__(self, **kwargs):
+ """
+ Constructor
+ """
+ self.name = kwargs.get('name')
+ self.id = kwargs.get('id')
+ self.type = kwargs.get('provider:network_type')
+
+ def __eq__(self, other):
+ return (self.name == other.name and self.id == other.id and
+ self.type == other.type)
+
+
+class Subnet:
+ """
+ SNAPS domain object for interface routers. Should contain attributes that
+ are shared amongst cloud providers
+ """
+ def __init__(self, **kwargs):
+ """
+ Constructor
+ """
+ self.name = kwargs.get('name')
+ self.id = kwargs.get('id')
+ self.cidr = kwargs.get('cidr')
+
+ def __eq__(self, other):
+ return (self.name == other.name and self.id == other.id and
+ self.cidr == other.cidr)
+
+
class Port:
"""
SNAPS domain object for ports. Should contain attributes that