incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1363182 - in /incubator/tashi/trunk/src/tashi: client/tashi-client.py clustermanager/clustermanagerservice.py rpycservices/rpycservices.py
Date Thu, 19 Jul 2012 00:03:52 GMT
Author: stroucki
Date: Thu Jul 19 00:03:52 2012
New Revision: 1363182

URL: http://svn.apache.org/viewvc?rev=1363182&view=rev
Log:
Do the trivial addition of setHostNotes for now. "Real Soon Now", this type of function will
be put into an administration tool.

Modified:
    incubator/tashi/trunk/src/tashi/client/tashi-client.py
    incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
    incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py

Modified: incubator/tashi/trunk/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/client/tashi-client.py?rev=1363182&r1=1363181&r2=1363182&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/trunk/src/tashi/client/tashi-client.py Thu Jul 19 00:03:52 2012
@@ -288,6 +288,7 @@ argLists = {
 'copyImage': [('src', str, lambda: requiredArg('src'),True), ('dst', str, lambda: requiredArg('dst'),
True)],
 'getHosts': [],
 'setHostState': [('host', checkHid, lambda: requiredArg('host'), True), ('state', str, lambda:
requiredArg('state'), True)],
+'setHostNotes': [('host', checkHid, lambda: requiredArg('host'), True), ('notes', str, lambda:
requiredArg('notes'), True)],
 'getUsers': [],
 'getNetworks': [],
 'getInstances': [],
@@ -315,6 +316,7 @@ convertArgs = {
 'getSlots' : '[cores, memory]',
 'copyImage' : '[src, dst]',
 'setHostState' : '[host, state]',
+'setHostNotes' : '[host, notes]',
 }
 
 # Descriptions
@@ -333,6 +335,7 @@ description = {
 'getSlots': 'Get a count of how many VMs could be started in the cluster',
 'getHosts': 'Gets a list of hosts running Node Managers',
 'setHostState': 'Set the state of a host, eg. Normal or Drained',
+'setHostNotes': 'Provide an annotation to a host',
 'getUsers': 'Gets a list of users',
 'getNetworks': 'Gets a list of available networks for VMs to be placed on',
 'getInstances': 'Gets a list of all VMs in the cluster',
@@ -360,6 +363,7 @@ examples = {
 'getSlots': ['--cores 1 --memory 128'],
 'getHosts': [''],
 'setHostState': ['--host vmhost1 --state Drained'],
+'setHostNotes': ['--host vmhost1 --notes "Memory error"'],
 'getUsers': [''],
 'getNetworks': [''],
 'getInstances': [''],

Modified: incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py?rev=1363182&r1=1363181&r2=1363182&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py (original)
+++ incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py Thu Jul 19 00:03:52
2012
@@ -585,6 +585,17 @@ class ClusterManagerService(object):
 		return "Host state set to %s." % hostStates[hostState]
 
 	# extern
+	def setHostNotes(self, hostId, notes):
+		hostNotes = notes
+		host = self.data.acquireHost(hostId)
+		try:
+			host.notes = hostNotes
+		finally:
+			self.data.releaseHost(host)
+
+		return Host notes set to "%s".' % hostNotes
+
+	# extern
 	def getNetworks(self):
 		networks = self.data.getNetworks()
 		for network in networks:

Modified: incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py?rev=1363182&r1=1363181&r2=1363182&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py (original)
+++ incubator/tashi/trunk/src/tashi/rpycservices/rpycservices.py Thu Jul 19 00:03:52 2012
@@ -19,7 +19,7 @@ import rpyc
 from tashi.rpycservices.rpyctypes import Instance, Host, User
 import cPickle
 
-clusterManagerRPCs = ['createVm', 'shutdownVm', 'destroyVm', 'suspendVm', 'resumeVm', 'migrateVm',
'pauseVm', 'unpauseVm', 'getHosts', 'getNetworks', 'getUsers', 'getInstances', 'vmmSpecificCall',
'registerNodeManager', 'vmUpdate', 'activateVm', 'registerHost', 'getImages', 'copyImage',
'setHostState']
+clusterManagerRPCs = ['createVm', 'shutdownVm', 'destroyVm', 'suspendVm', 'resumeVm', 'migrateVm',
'pauseVm', 'unpauseVm', 'getHosts', 'getNetworks', 'getUsers', 'getInstances', 'vmmSpecificCall',
'registerNodeManager', 'vmUpdate', 'activateVm', 'registerHost', 'getImages', 'copyImage',
'setHostState', 'setHostNotes']
 nodeManagerRPCs = ['instantiateVm', 'shutdownVm', 'destroyVm', 'suspendVm', 'resumeVm', 'prepReceiveVm',
'prepSourceVm', 'migrateVm', 'receiveVm', 'pauseVm', 'unpauseVm', 'getVmInfo', 'listVms',
'vmmSpecificCall', 'getHostInfo', 'liveCheck']
 accountingRPCs = ['record']
 



Mime
View raw message