diff --git a/releasenotes/notes/enable-cluster-mariabdb-cassandra-11f3f7f6badfc211.yaml b/releasenotes/notes/enable-cluster-mariabdb-cassandra-11f3f7f6badfc211.yaml
new file mode 100644
index 0000000..1718e60
--- /dev/null
+++ b/releasenotes/notes/enable-cluster-mariabdb-cassandra-11f3f7f6badfc211.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Enable cluster support for MariaDB and Cassandra.
diff --git a/trove_dashboard/content/database_clusters/tabs.py b/trove_dashboard/content/database_clusters/tabs.py
index d83cb59..725a1a7 100644
--- a/trove_dashboard/content/database_clusters/tabs.py
+++ b/trove_dashboard/content/database_clusters/tabs.py
@@ -22,6 +22,7 @@ from horizon import tabs
from trove_dashboard import api
from trove_dashboard.content.database_clusters import tables
+from trove_dashboard.content.databases import db_capability
class OverviewTab(tabs.Tab):
@@ -34,7 +35,7 @@ class OverviewTab(tabs.Tab):
def get_template_name(self, request):
cluster = self.tab_group.kwargs['cluster']
template_file = ('project/database_clusters/_detail_overview_%s.html'
- % cluster.datastore['type'])
+ % self._get_template_type(cluster.datastore['type']))
try:
template.loader.get_template(template_file)
return template_file
@@ -43,6 +44,12 @@ class OverviewTab(tabs.Tab):
# Just use the base template file
return ('project/database_clusters/_detail_overview.html')
+ def _get_template_type(self, datastore):
+ if db_capability.is_mysql_compatible(datastore):
+ return 'mysql'
+
+ return datastore
+
class InstancesTab(tabs.TableTab):
table_classes = (tables.InstancesTable,)
diff --git a/trove_dashboard/content/database_clusters/templates/database_clusters/_detail_overview_cassandra.html b/trove_dashboard/content/database_clusters/templates/database_clusters/_detail_overview_cassandra.html
new file mode 100644
index 0000000..91bbf36
--- /dev/null
+++ b/trove_dashboard/content/database_clusters/templates/database_clusters/_detail_overview_cassandra.html
@@ -0,0 +1,19 @@
+{% extends "project/database_clusters/_detail_overview.html" %}
+{% load i18n sizeformat %}
+
+{% block connection_info %}
+
{% trans "Connection Information" %}
+
+
+ {% with cluster.ip.0 as ip %}
+ - {% trans "Host" %}
+ {% if not ip %}
+ - {% trans "Not Assigned" %}
+ {% else %}
+ - {{ ip }}
+ - {% trans "Connection Examples" %}
+ - cqlsh {{ ip }} 9042
+ {% endif %}
+ {% endwith %}
+
+{% endblock %}
diff --git a/trove_dashboard/content/database_clusters/templates/database_clusters/_detail_overview_mysql.html b/trove_dashboard/content/database_clusters/templates/database_clusters/_detail_overview_mysql.html
new file mode 100644
index 0000000..601d724
--- /dev/null
+++ b/trove_dashboard/content/database_clusters/templates/database_clusters/_detail_overview_mysql.html
@@ -0,0 +1,19 @@
+{% extends "project/database_clusters/_detail_overview.html" %}
+{% load i18n sizeformat %}
+
+{% block connection_info %}
+ {% trans "Connection Information" %}
+
+
+ {% with cluster.ip.0 as ip %}
+ - {% trans "Host" %}
+ {% if not ip %}
+ - {% trans "Not Assigned" %}
+ {% else %}
+ - {{ ip }}
+ - {% trans "Connection Examples" %}
+ - mysql {{ ip }} 3306
+ {% endif %}
+ {% endwith %}
+
+{% endblock %}
diff --git a/trove_dashboard/content/databases/db_capability.py b/trove_dashboard/content/databases/db_capability.py
index ad71a83..cf1baf7 100644
--- a/trove_dashboard/content/databases/db_capability.py
+++ b/trove_dashboard/content/databases/db_capability.py
@@ -13,6 +13,7 @@
# under the License.
+CASSANDRA = "cassandra"
MARIA = "maria"
MONGODB = "mongodb"
MYSQL = "mysql"
@@ -21,12 +22,15 @@ PERCONA_CLUSTER = "pxc"
REDIS = "redis"
VERTICA = "vertica"
-_mysql_compatible_datastores = (MYSQL, MARIA, PERCONA)
-_cluster_capable_datastores = (MONGODB, PERCONA_CLUSTER, REDIS, VERTICA)
+_mysql_compatible_datastores = (MYSQL, MARIA, PERCONA, PERCONA_CLUSTER)
+_cluster_capable_datastores = (CASSANDRA, MARIA, MONGODB, PERCONA_CLUSTER,
+ REDIS, VERTICA)
+_cluster_grow_shrink_capable_datastores = (CASSANDRA, MARIA, MONGODB, REDIS)
def can_modify_cluster(datastore):
- return (is_mongodb_datastore(datastore) or is_redis_datastore(datastore))
+ return _is_datastore_in_list(datastore,
+ _cluster_grow_shrink_capable_datastores)
def is_mongodb_datastore(datastore):
@@ -46,17 +50,17 @@ def is_vertica_datastore(datastore):
def is_mysql_compatible(datastore):
- if (datastore is not None):
- for ds in _mysql_compatible_datastores:
- if ds in datastore.lower():
- return True
- return False
+ return _is_datastore_in_list(datastore, _mysql_compatible_datastores)
def is_cluster_capable_datastore(datastore):
+ return _is_datastore_in_list(datastore, _cluster_capable_datastores)
+
+
+def _is_datastore_in_list(datastore, datastores):
if datastore is not None:
datastore_lower = datastore.lower()
- for ds in _cluster_capable_datastores:
+ for ds in datastores:
if ds in datastore_lower:
return True
return False