diff options
-rw-r--r-- | compass-deck/db/api/network.py | 8 | ||||
-rw-r--r-- | compass-deck/db/models.py | 1 | ||||
-rw-r--r-- | compass-tasks-base/db/api/network.py | 8 | ||||
-rw-r--r-- | compass-tasks-base/db/models.py | 1 |
4 files changed, 10 insertions, 8 deletions
diff --git a/compass-deck/db/api/network.py b/compass-deck/db/api/network.py index e2bf7d3..e505344 100644 --- a/compass-deck/db/api/network.py +++ b/compass-deck/db/api/network.py @@ -25,16 +25,16 @@ from compass.db import exception from compass.db import models -SUPPORTED_FIELDS = ['subnet', 'name'] +SUPPORTED_FIELDS = ['subnet', 'name', 'gateway'] RESP_FIELDS = [ - 'id', 'name', 'subnet', 'created_at', 'updated_at' + 'id', 'name', 'subnet', 'gateway', 'created_at', 'updated_at' ] ADDED_FIELDS = ['subnet'] -OPTIONAL_ADDED_FIELDS = ['name'] +OPTIONAL_ADDED_FIELDS = ['name', 'gateway'] IGNORE_FIELDS = [ 'id', 'created_at', 'updated_at' ] -UPDATED_FIELDS = ['subnet', 'name'] +UPDATED_FIELDS = ['subnet', 'name', 'gateway'] def _check_subnet(subnet): diff --git a/compass-deck/db/models.py b/compass-deck/db/models.py index 5f8fb52..929f4dc 100644 --- a/compass-deck/db/models.py +++ b/compass-deck/db/models.py @@ -1864,6 +1864,7 @@ class Subnet(BASE, TimestampMixin, HelperMixin): id = Column(Integer, primary_key=True) name = Column(String(80), unique=True, nullable=True) subnet = Column(String(80), unique=True, nullable=False) + gateway = Column(String(80), unique=True, nullable=True) host_networks = relationship( HostNetwork, diff --git a/compass-tasks-base/db/api/network.py b/compass-tasks-base/db/api/network.py index e2bf7d3..e505344 100644 --- a/compass-tasks-base/db/api/network.py +++ b/compass-tasks-base/db/api/network.py @@ -25,16 +25,16 @@ from compass.db import exception from compass.db import models -SUPPORTED_FIELDS = ['subnet', 'name'] +SUPPORTED_FIELDS = ['subnet', 'name', 'gateway'] RESP_FIELDS = [ - 'id', 'name', 'subnet', 'created_at', 'updated_at' + 'id', 'name', 'subnet', 'gateway', 'created_at', 'updated_at' ] ADDED_FIELDS = ['subnet'] -OPTIONAL_ADDED_FIELDS = ['name'] +OPTIONAL_ADDED_FIELDS = ['name', 'gateway'] IGNORE_FIELDS = [ 'id', 'created_at', 'updated_at' ] -UPDATED_FIELDS = ['subnet', 'name'] +UPDATED_FIELDS = ['subnet', 'name', 'gateway'] def _check_subnet(subnet): diff --git a/compass-tasks-base/db/models.py b/compass-tasks-base/db/models.py index 5f8fb52..929f4dc 100644 --- a/compass-tasks-base/db/models.py +++ b/compass-tasks-base/db/models.py @@ -1864,6 +1864,7 @@ class Subnet(BASE, TimestampMixin, HelperMixin): id = Column(Integer, primary_key=True) name = Column(String(80), unique=True, nullable=True) subnet = Column(String(80), unique=True, nullable=False) + gateway = Column(String(80), unique=True, nullable=True) host_networks = relationship( HostNetwork, |