Example #1
0
def run_rapi():
    api_log.info('Starting up RCCN API manager')
    app = RESTResource(
        (SubscriberRESTService(), ResellerRESTService(), CreditRESTService(),
         StatisticsRESTService(), SMSRESTService(), ChatRESTService(),
         ConfigurationRESTService()))
    app.run(8085)
Example #2
0
def run_app_multicore():
    #start the ZeroMQ client
    pool = Pool(processes=4)
    
    #start the server
    app = RESTResource((TestService(),))
    app.run(8090)
Example #3
0
def run_app_multicore():
    #start the ZeroMQ client
    pool = Pool(processes=4)

    #start the server
    app = RESTResource((TestService(), ))
    app.run(8090)
Example #4
0
def run_filter_app():
    app = RESTResource(services=(FilterService(), ),
                       filters=(
                           Change404to503Filter(),
                           AddCustomHeaderFilter(),
                           WrapAroundFilter(),
                       ))
    app.run(8083)
Example #5
0
def makeService(self):

    #application = service.Application("Nested Services Demo")
    multiservice = service.MultiService()
    admin_interface_resource = resource.Resource()
    admin_interface_resource.putChild('',
                                      AdminWebInterfaceService(multiservice))
    admin_interface_service = internet.TCPServer(
        8001, webserver.Site(admin_interface_resource))
    admin_interface_service.setName("Administration Interface")
    admin_interface_service.setServiceParent(multiservice)

    client_control_service = ClientControlService(multiservice)
    client_control_service.setName('Client Control')
    client_control_service.setServiceParent(multiservice)

    #web_interface_resource = resource.Resource()
    web_interface_resource = File(static_files_dir)
    api_resource = RESTResource((Api(client_control_service), ))
    web_interface_resource.putChild('api', api_resource)
    web_interface_service = internet.TCPServer(
        8000, webserver.Site(web_interface_resource))
    web_interface_service.setName("Web Interface")
    web_interface_service.setServiceParent(multiservice)

    for node in nodes:
        client = WebClientService()
        log.msg(node['name'])
        client.setName(node['name'])
        client.nagios_uri = node['nagios_uri']
        client.cgi_uri = node['cgi_uri']
        if 'user' in node:
            client.user = node['user']
            client.password = node['password']
        client.setServiceParent(client_control_service)

    # Debugging manhole server
    namespace = {"Naggregator": client_control_service}
    manhole_service = internet.TCPServer(
        2223, get_manhole_factory(namespace, admin='aaa'))
    manhole_service.setServiceParent(multiservice)

    return multiservice
Example #6
0
def run_app_arguments():
    app = RESTResource((ArgumentApp(),))
    app.run(8082)
Example #7
0
def run_rapi():
    api_log.info('Starting up RCCN API manager')
    app = RESTResource((SubscriberRESTService(), ResellerRESTService(), CreditRESTService(), StatisticsRESTService(), SMSRESTService(), ChatRESTService(), ConfigurationRESTService()))
    app.run(8085)
Example #8
0
def run_rest_app():
    app = RESTResource((CustomerRESTService(), CustomerAddressRESTService()))
    app.run(8085)
Example #9
0
 def __init__(self, root, services=(), filters=None, **kwargs):
     self.root = root
     filters = filters or (ServerFilter(),)
     RESTResource.__init__(self, services=services, filters=filters, **kwargs)
Example #10
0
def run_filter_app():
    app = RESTResource(services=(FilterService(),),filters=(Change404to503Filter(),AddCustomHeaderFilter(),WrapAroundFilter(),))
    app.run(8083)
Example #11
0
def run_app_home():
    app = RESTResource((HomeApp(), ))
    app.run()
Example #12
0
def run_app_multi():
    app = RESTResource((HomeApp(),Module1(),Module2()))
    app.run(8081)
Example #13
0
def run_rest_app():
    app = RESTResource((CustomerRESTService(),CustomerAddressRESTService()))
    app.run(8085)
Example #14
0
def run_app_arguments():
    app = RESTResource((ArgumentApp(), ))
    app.run(8082)
Example #15
0
def run_app_home():
    app = RESTResource((HomeApp(),))
    app.run()