[API] Support new GALERA protocol in the API
When a Galera load balancer is requested, we validate the node definitions in the API rather than rely on the worker for validation. Make sure that number of primary nodes is one, no more and no less. When using POST to add nodes, we check that a primary node is not being added. We assume a primary is already defined since the LB cannot exist without a primary. DELETE is checked to make sure that the primary node is not being removed. Set the default port for GALERA protocol to 3306. Change-Id: I8cf1489e1cae6c790bc05c5573dee959f93d20c9
This commit is contained in:
@@ -117,7 +117,7 @@ class Node(DeclarativeBase):
|
||||
__tablename__ = 'nodes'
|
||||
#column definitions
|
||||
address = Column(u'address', VARCHAR(length=128), nullable=False)
|
||||
enabled = Column(u'enabled', Integer(), nullable=False)
|
||||
enabled = Column(u'enabled', INTEGER(), nullable=False)
|
||||
id = Column(u'id', BIGINT(), primary_key=True, nullable=False)
|
||||
lbid = Column(
|
||||
u'lbid', BIGINT(), ForeignKey('loadbalancers.id'), nullable=False
|
||||
@@ -125,6 +125,7 @@ class Node(DeclarativeBase):
|
||||
port = Column(u'port', INTEGER(), nullable=False)
|
||||
status = Column(u'status', VARCHAR(length=128), nullable=False)
|
||||
weight = Column(u'weight', INTEGER(), nullable=False)
|
||||
backup = Column(u'backup', INTEGER(), nullable=False, default=0)
|
||||
|
||||
|
||||
class HealthMonitor(DeclarativeBase):
|
||||
|
Reference in New Issue
Block a user