summaryrefslogtreecommitdiff
path: root/trove/cluster
diff options
context:
space:
mode:
authorMorgan Jones <morgan@parelastic.com>2016-08-22 14:33:31 -0400
committerMorgan Jones <morgan@parelastic.com>2016-10-03 16:33:16 -0400
commitbea853a4cb82be718f6779a8db81f5750ca39fff (patch)
treef317458eae06348c2985d35fcde2a02b9efed1db /trove/cluster
parent41f3dd6920eb60d438e1542e9994319c08e44461 (diff)
downloadtrove-bea853a4cb82be718f6779a8db81f5750ca39fff.tar.gz
Cluster Upgrade
Implement the framework for cluster upgrade, including the REST API and the Cluster implementation with default BadRequest return. This change does not include datastore implementations. Implements blueprint: bp/cluster-upgrade Depends-On: Iedb08c99bf8eb2a0b0d09e3c1ebd11965fdfff90 Change-Id: Ifde78a0ee80855e7e298b10a9ec2c8e535190205
Diffstat (limited to 'trove/cluster')
-rw-r--r--trove/cluster/models.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/trove/cluster/models.py b/trove/cluster/models.py
index 26a4e8d8..aa40c3d9 100644
--- a/trove/cluster/models.py
+++ b/trove/cluster/models.py
@@ -21,8 +21,9 @@ from trove.cluster.tasks import ClusterTasks
from trove.common import cfg
from trove.common import exception
from trove.common.i18n import _
-from trove.common.notification import (DBaaSClusterGrow, DBaaSClusterShrink,
- DBaaSClusterResetStatus)
+from trove.common.notification import DBaaSClusterGrow, DBaaSClusterShrink
+from trove.common.notification import DBaaSClusterResetStatus
+from trove.common.notification import DBaaSClusterUpgrade
from trove.common.notification import StartNotification
from trove.common import remote
from trove.common import server_group as srv_grp
@@ -310,6 +311,13 @@ class Cluster(object):
with StartNotification(context, cluster_id=self.id):
return self.reset_status()
+ elif action == 'upgrade':
+ context.notification = DBaaSClusterUpgrade(context, request=req)
+ dv_id = param['datastore_version']
+ dv = datastore_models.DatastoreVersion.load(self.datastore, dv_id)
+ with StartNotification(context, cluster_id=self.id,
+ datastore_version=dv.id):
+ return self.upgrade(dv)
else:
raise exception.BadRequest(_("Action %s not supported") % action)
@@ -319,6 +327,9 @@ class Cluster(object):
def shrink(self, instance_ids):
raise exception.BadRequest(_("Action 'shrink' not supported"))
+ def upgrade(self, datastore_version):
+ raise exception.BadRequest(_("Action 'upgrade' not supported"))
+
@staticmethod
def load_instance(context, cluster_id, instance_id):
return inst_models.load_instance_with_info(