Beispiel #1
0
class Cluster_Reload_Handler(APIHandler):

    cluster_opers = ClusterOpers()

    @asynchronous
    def post(self):
        '''
        function: reload cluster
        url example: curl --user root:root -d "" "http://localhost:8888/cluster/reload"
        '''
        result = self.cluster_opers.reload()
        self.finish(result)
Beispiel #2
0
class Cluster_Start_Handler(APIHandler):

    cluster_opers = ClusterOpers()

    @asynchronous
    def post(self):
        '''
        function: start cluster
        url example: curl --user root:root -d "" "http://localhost:8888/cluster/start"
        '''

        result = self.cluster_opers.start()
        self.finish(result)
Beispiel #3
0
class Cluster_Config_Handler(APIHandler):

    cluster_opers = ClusterOpers()

    @asynchronous
    def post(self):
        '''
        function: config cluster, currently, only for upstream
        url example: curl --user root:root -d "upstreamName=newupstream&serverPorts=10.200.84.21:3333,10.200.84.22:3333,10.200.84.23:3333" "http://localhost:8888/cluster/config"
        '''
        requestParam = self.get_all_arguments()
        result = self.cluster_opers.config(requestParam)
        self.finish(result)
Beispiel #4
0
class Sync_Handler(APIHandler):

    cluster_opers = ClusterOpers()

    def post(self):
        '''
        function: sync cluster info from zk to local properties file
        url example: curl -d "clusterUUID=***" "http://localhost:8888/cluster/sync"
        '''
        requestParam = self.get_all_arguments()
        self.cluster_opers.syncExistedCluster(requestParam)

        result = {}
        result.setdefault("message", "sync nginx to local successful!")
        self.finish(result)