def printHelp(self): self.printUsage() print "" print "Used to stop a member server." print MBeanArgs.printHelp(self) print "Example: jython stopServer.py --serverName=member1 --serverHost=localhost --serverUsrdir=/wlp/usr --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2 --options=[\"--clean --include=someValue\"]"
def printHelp(self): self.printUsage() print "" print "Used to list the names of the clusters known to the collective controller." print MBeanArgs.printHelp(self) print "Example: jython listClusterNames.py --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2"
def printOptionalHelp(self): MBeanArgs.printOptionalHelp(self) print print LOCAL_DIR + " The name of a directory on the local machine where the server.xml" print self.printHelpPad( LOCAL_DIR ) + "can be stored. If this parameter is not supplied, the current" print self.printHelpPad(LOCAL_DIR) + "directory will be used."
def printRequiredHelp(self): print SERVER_NAME + "= The name of the server to install (or uninstall) the application to" print print SERVER_HOST + "= The host name where the collective member is installed" print print SERVER_USRDIR + "= The usr directory where the collective member is installed" print MBeanArgs.printRequiredHelp(self)
def __init__(self): valueParams = [ INSTALL, UNINSTALL, SERVER_NAME, SERVER_HOST, SERVER_USRDIR ] valueParams += arguments.MBEAN_VALUE_PARMS optionalParams = [APP_DIR] MBeanArgs.__init__(self, 0, arguments.STANDARD_KEYWORD_PARMS, valueParams, optionalParams)
def printHelp(self): self.printUsage() print "" print "Used to list the members in the cluster specified by the clusterName" print "parameter." print MBeanArgs.printHelp(self) print "Example: jython listClusterMembers.py clusterName --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2"
def printHelp(self): self.printUsage() print "" print "Generate plugin for all the started members of the cluster" print "parameter." print MBeanArgs.printHelp(self) print "Example: jython genClusterPlugin.py clusterName --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2"
def printRequiredHelp(self): print SERVER_NAME + "= The name of the member server to stop" print print SERVER_HOST + "= The host name where the collective member is installed" print print SERVER_USRDIR + "= The usr directory where the collective member is installed" print MBeanArgs.printRequiredHelp(self)
def printHelp(self): self.printUsage() print "" print "Used to deploy a set of member servers from a zip file." print "The script will push the zip to the specified installHost, extract the" print "member servers and start them." print MBeanArgs.printHelp(self) print print "Example: jython deployMembers.py --zipFile=/home/user/wlp.zip --installDir=/opt/ --installHost=targetHostName --rpcUser=Administrator --rpcUserPassword=secret --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=controllerHostName --port=9443 --user=admin --password=secret2"
def printOptionalHelp(self): MBeanArgs.printOptionalHelp(self) print print APP_DIR + " The server app directory to install to or uninstall from." print self.printHelpPad( APP_DIR ) + "By default, this will install into ${server.config.dir}/apps" print self.printHelpPad( APP_DIR ) + "The path can be absolute or relative. Relative paths are" print self.printHelpPad( APP_DIR) + "relative to the ${server.config.dir}."
def printRequiredHelp(self): MBeanArgs.printRequiredHelp(self) print print ZIP_FILE + "= The fully qualified zip file path to upload to target machine" print print INSTALL_DIR + "= The path where member will be installed on target machine" print print INSTALL_HOST + "= The host name of the target machine" print print RPC_USER + "= The rpc user of the target machine" print print RPC_USER_PASSWORD + "= The rpc user password of the target machine"
def printRequiredHelp(self): print SERVER_NAME + "= The name of the server which is installed on the host and" print self.printHelpPad( SERVER_NAME ) + "usrdir described by serverHost and serverUsrdir, and whose" print self.printHelpPad(SERVER_NAME) + "server.xml is to be modified." print print SERVER_HOST + "= The host name where the collectiveMember is installed." print print SERVER_USRDIR + "= The usr directory where the collectiveMember is installed." print MBeanArgs.printRequiredHelp(self)
def printOptionalHelp(self): MBeanArgs.printOptionalHelp(self) print print LOCAL_DIR + " The name of a directory on the local machine where the server.xml" print self.printHelpPad( LOCAL_DIR ) + "files can be stored. If this parameter is not supplied, the" print self.printHelpPad( LOCAL_DIR ) + "current directory will be used. A subdirectory will be" print self.printHelpPad( LOCAL_DIR ) + "created for each cluster member, and the server.xml will be" print self.printHelpPad(LOCAL_DIR) + "stored inside it."
def validate(self): if MBeanArgs.validate(self): missingArg = None if (INSTALL not in self and UNINSTALL not in self): print print "Please specify whether to install or uninstall an application" self.printUsage() return False elif (SERVER_NAME not in self): missingArg = SERVER_NAME elif (SERVER_HOST not in self): missingArg = SERVER_HOST elif (SERVER_USRDIR not in self): missingArg = SERVER_USRDIR if (missingArg != None): print "The following required argument is missing: " + missingArg self.printUsage() return False else: # Make sure the positional parameter was specified correctly. positionalParm = self.getPositional(0) return (missingArg == None) else: return False
def validate(self): if MBeanArgs.validate(self): if (ZIP_FILE not in self): print print "The following required argument is missing: " + ZIP_FILE self.printUsage() return False elif (INSTALL_DIR not in self): print print "The following required argument is missing: " + INSTALL_DIR self.printUsage() return False elif (INSTALL_HOST not in self): print print "The following required argument is missing: " + INSTALL_HOST self.printUsage() return False elif (RPC_USER not in self): print print "The following required argument is missing: " + RPC_USER self.printUsage() return False elif (RPC_USER_PASSWORD not in self): print print "The following required argument is missing: " + RPC_USER_PASSWORD self.printUsage() return False else : return True else: return False
def validate(self): # First validate the MBean arguments if MBeanArgs.validate(self): # Then validate update server config arguments missingArg = None if (SERVER_NAME not in self): missingArg = SERVER_NAME elif (SERVER_HOST not in self): missingArg = SERVER_HOST elif (SERVER_USRDIR not in self): missingArg = SERVER_USRDIR if (missingArg != None): print "The following required argument is missing: " + missingArg self.printUsage() else: # Make sure the positional parameter was specified correctly. positionalParm = self.getPositional(0) if ((positionalParm != "get") and (positionalParm != "put")): print "The operation must be \"get\" or \"put\" " self.printUsage() missingArg = True return (missingArg == None) else: return False
def getUsage(self): usageString = SERVER_NAME + "=serverName " + \ SERVER_HOST + "=host " + \ SERVER_USRDIR + "=usrdir " + \ MBeanArgs.getUsage(self) + \ "[" + OPTIONS + "=\"options list\"]" return usageString
def getUsage(self): usageString = SERVER_NAME + "=serverName " + \ SERVER_HOST + "=host " + \ SERVER_USRDIR + "=usrdir " + \ MBeanArgs.getUsage(self) + \ "[" + LOCAL_DIR + "=directory]" return usageString
def printHelp(self): self.printUsage() print "" print "Used to transfer an application to a static cluster manged by a collective" print "controller. The collective controller is also referred to as the" print "\"routing server\" in some messages." print print "This action will push the application file to all cluster members" print "Ensure that the remote application members directories are" print "configured to be writable by the filetransfer operations." print " <remoteFileAccess>" print " <writeDir>${server.config.dir}</writeDir>" print " </remoteFileAccess>" print MBeanArgs.printHelp(self) print print "Example: jython transferAppToCluster.py /home/user/apps/myApplication.war -clusterName=cluster1 --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2 "
def getUsage(self): usageString = MBeanArgs.getUsage(self) + \ ZIP_FILE + "=path/to/zipFile " + \ INSTALL_DIR + "=path/to/install/on/target/machine " + \ INSTALL_HOST + "=targetMachineHostName " + \ RPC_USER + "=rpcUserOfTargetMachine " + \ RPC_USER_PASSWORD + "=rpcUserPasswordOfTargetMachine " return usageString
def printHelp(self): self.printUsage() print "" print "Used to transfer an application to a member server manged by a collective" print "controller. The collective controller is also referred to as the" print "\"routing server\" in some messages." print print "This action will push the application file to the member server" print "Ensure that the remote application directory is " print "configured to be writable by the filetransfer operations. e.g." print " <remoteFileAccess>" print " <writeDir>${server.config.dir}/</writeDir>" print " </remoteFileAccess>" print MBeanArgs.printHelp(self) print print "Example: jython transferAppToServer.py path/to/app --serverName=member1 --serverHost=localhost --serverUsrdir=/wlp/usr --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2"
def printHelp(self): self.printUsage() print "" print "Used to transfer a server.xml to a static cluster managed by a collective" print "controller. The collective controller is also referred to as the" print "\"routing server\" in some messages." print print "This action will push the server.xml file to all cluster members" print "Ensure that the remote members directories are" print "configured to be writable by the filetransfer operations." print " <remoteFileAccess>" print " <writeDir>${server.config.dir}</writeDir>" print " </remoteFileAccess>" print MBeanArgs.printHelp(self) print print "Example: jython transferConfigToCluster.py path/to/server.xml --clusterName=cluster1 --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2 "
def printHelp(self): self.printUsage() print "" print "Used to modify the configuration (server.xml) for a server manged by the" print "collective controller. The collective controller is also referred to as the " print "\"routing server\" in some messages. The operation can be \"get\" or \"put\":" print print "get - Obtain the server.xml and store it into the directory specified" print self.printHelpPad("get -") + "by " + LOCAL_DIR print print "put - Update the server.xml on the server with the copy obtained from" print self.printHelpPad( "put -") + "the directory specified by " + LOCAL_DIR print "This action will push the server.xml file to the server" print "Ensure that the remote server directory is" print "configured to be writable by the filetransfer operations. e.g." print " <remoteFileAccess>" print " <writeDir>${server.config.dir}/</writeDir>" print " </remoteFileAccess>" print MBeanArgs.printHelp(self) print print "Example: jython updateServerConfig.py get --serverName=server1 --serverHost=localhost --serverUsrdir=/wlp/usr --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2 --localDir=/tmp/liberty/config/defaultServer"
def printHelp(self): self.printUsage() print "" print "Used to install or uninstall an application in a member server." print "This action will push the file to member server, and modify" print "the server.xml of member server to include the application" print "configuration. Ensure that the remote application directory is" print "configured to be writable by the filetransfer operations." print " <remoteFileAccess>" print " <writeDir>${server.config.dir}</writeDir>" print " </remoteFileAccess>" print print "Actions:" print print INSTALL + " The path in the local file system to the application" print self.printHelpPad(INSTALL) + "to be installed within the server" print print UNINSTALL + " The name of the application to uninstall from the server" print MBeanArgs.printHelp(self) print print "Install example: jython manageAppOnServer.py --install=/home/user/apps/myApplication.war --serverName=member1 --serverHost=localhost --serverUsrdir=/wlp/usr --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2" print print "Uninstall example: jython manageAppOnServer.py --uninstall=myApplication.war --serverName=member1 --serverHost=localhost --serverUsrdir=/wlp/usr --truststore=/wlp/usr/servers/<servername>/resources/security/trust.jks --truststorePassword=secret --host=localhost --port=9443 --user=Administrator --password=secret2"
def validate(self): if MBeanArgs.validate(self): if (INSTALL not in self and UNINSTALL not in self): print print "Please specify whether to install or uninstall an application" self.printUsage() return False elif (CLUSTER_NAME not in self): print print "The following required argument is missing: " + CLUSTER_NAME self.printUsage() return False else: return True else: return False
def validate(self): # First validate the MBean arguments if MBeanArgs.validate(self): # Then validate update server config arguments missingArg = None if (CLUSTER_NAME not in self): missingArg = CLUSTER_NAME if (missingArg != None): print "The following required argument is missing: " + missingArg self.printUsage() else: # Make sure the positional parameter was specified correctly. positionalParm = self.getPositional(0) return (missingArg == None) else: return False
def validate(self): # First validate the MBean arguments if MBeanArgs.validate(self): # Then validate update server config arguments missingArg = None if (CLUSTER_NAME not in self): missingArg = CLUSTER_NAME if (missingArg != None): print "The following required argument is missing: " + missingArg self.printUsage() else : # Make sure the positional parameter was specified correctly. positionalParm = self.getPositional(0) return (missingArg == None) else: return False
def __init__(self): # Make the list of value arguments that we accept valueParms = [CLUSTER_NAME] valueParms += arguments.MBEAN_VALUE_PARMS MBeanArgs.__init__(self, 1, arguments.STANDARD_KEYWORD_PARMS, valueParms)
def __init__(self): valueParams = [SERVER_NAME, SERVER_HOST, SERVER_USRDIR] valueParams += arguments.MBEAN_VALUE_PARMS optional_parms = [OPTIONS] MBeanArgs.__init__(self, 0, arguments.STANDARD_KEYWORD_PARMS, valueParams, optional_parms)
def printOptionalHelp(self): MBeanArgs.printOptionalHelp(self)
def getUsage(self): usageString = MBeanArgs.getUsage(self) + \ CLUSTER_NAME + "=clusterName " return usageString
def printRequiredHelp(self): print CLUSTER_NAME + "= The name of the cluster to transfer the application to" print MBeanArgs.printRequiredHelp(self)
def printRequiredHelp(self): print CLUSTER_NAME + "= The name of the cluster to transfer the server.xml to" print MBeanArgs.printRequiredHelp(self)