summaryrefslogtreecommitdiff
path: root/trove/common/notification.py
diff options
context:
space:
mode:
authorAli Adil <aadil@tesora.com>2016-07-18 21:23:48 +0000
committerAli Asgar Adil <aadil@tesora.com>2016-09-13 10:00:04 -0400
commitcee1f8e6c7e89558191b244395e50a7657a0f240 (patch)
tree243d51d6cb090dc4fd5f253342cb74b88bae3cb7 /trove/common/notification.py
parent1ef945d6fa8012486b625a98d3baab8db2b4ca12 (diff)
downloadtrove-cee1f8e6c7e89558191b244395e50a7657a0f240.tar.gz
Add command to delete BUILD instances and clusters
Sometimes an instance/cluster can be stuck in BUILD state forever. Attempting to delete the instance in this state is currently not allowed. Add force-delete and reset-status command. Reset-status will reset the status of an instance to ERROR and cluster to NONE. The reset-status command can only be used if the instance/cluster is in BUILD or ERROR state. Resetting the status of an instance in ERROR state can be useful as an instance might go ACTIVE after the specified timeout. Once the status has been reset it is possible for an instance to go ACTIVE if it receives a hearbeat from the guestagent. Force-delete will combine functionality of reset-status and delete. Change-Id: I83f6cdcdd884e51d002295b0d1f07341990e512c Depends-On: I957b4be5030e493e0eb8c6b6855d41b942b2823c Partial-Bug: #1579141
Diffstat (limited to 'trove/common/notification.py')
-rw-r--r--trove/common/notification.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/trove/common/notification.py b/trove/common/notification.py
index 5bf23ab3..be7c96bf 100644
--- a/trove/common/notification.py
+++ b/trove/common/notification.py
@@ -506,6 +506,16 @@ class DBaaSInstanceDelete(DBaaSAPINotification):
return ['instance_id']
+class DBaaSInstanceResetStatus(DBaaSAPINotification):
+
+ def event_type(self):
+ return 'instance_reset_status'
+
+ @abc.abstractmethod
+ def required_start_traits(self):
+ return ['instance_id']
+
+
class DBaaSInstanceDetach(DBaaSAPINotification):
@abc.abstractmethod
@@ -565,6 +575,17 @@ class DBaaSClusterDelete(DBaaSAPINotification):
return ['cluster_id']
+class DBaaSClusterResetStatus(DBaaSAPINotification):
+
+ @abc.abstractmethod
+ def event_type(self):
+ return 'cluster_reset_status'
+
+ @abc.abstractmethod
+ def required_start_traits(self):
+ return ['cluster_id']
+
+
class DBaaSClusterAddShard(DBaaSAPINotification):
@abc.abstractmethod