import os import time import threading import SocketServer import BaseHTTPServer import urlparse HTTP_PORT = 8000 # Boilerplate ASP setup code # Connect to ASP *MUST BE DONE FIRST* import amfpy amfpy.initializeAmf() # Import Python ASP class layers import clusterinfo import aspApp import aspAmf import upgrade import appdeploy # Hook into the various services ci = clusterinfo.ci # The clusterinfo.ci objects reflect the entire state of the cluster amf = aspAmf.Session( ) # The aspAmf.Session class lets you modify the cluster state appDb = aspApp.AppDb(os.getenv("ASP_DIR", "/tmp") + "/apps") # application database umgr = upgrade.UpgradeMgr() # Upgrade manager
please see the file apiexample.py for details. """ # Catch people who are not reading this... note = "This example is not meant to be run directly, but rather for you to\ncut-and-paste each line into a python buffer. It will not work if run directly\nsince it contains some model and directory specific items." print "\n**********\n", note, "\n**********\n" raise Exception(note) # Ok, the example starts now: ## @verbatim # If within the WEB shell, do NOT cut and paste this LINE (it is already done) # Paste it in ONLY if using python directly. import amfpy; amfpy.initializeAmf() # Standard Python modules import os import time # ARD Python API example code, including deployment and upgrade: import upgrade; import clusterinfo; import aspApp; import aspAmf # Hook into the various services ci = clusterinfo.ci # The clusterinfo.ci objects reflect the entire state of the cluster amf = aspAmf.Session() # The aspAmf.Session class lets you modify the cluster state # Example of getting the node names print [x.name for x in ci.nodeList]
def Start(self): """Start yourself (and keep this thread until termination)""" amfpy.initializeAmf()