luigi.server module

Simple REST server that takes commands in a JSON payload Interface to the Scheduler class. See Using the Central Scheduler for more info.

class luigi.server.RPCHandler(application, request, **kwargs)[source]

Bases: tornado.web.RequestHandler

Handle remote scheduling calls using rpc.RemoteSchedulerResponder.

initialize(scheduler)[source]

Hook for subclass initialization. Called for each request.

A dictionary passed as the third argument of a url spec will be supplied as keyword arguments to initialize().

Example:

class ProfileHandler(RequestHandler):
    def initialize(self, database):
        self.database = database

    def get(self, username):
        ...

app = Application([
    (r'/user/(.*)', ProfileHandler, dict(database=database)),
    ])
get(method)[source]
post(method)
class luigi.server.BaseTaskHistoryHandler(application, request, **kwargs)[source]

Bases: tornado.web.RequestHandler

initialize(scheduler)[source]

Hook for subclass initialization. Called for each request.

A dictionary passed as the third argument of a url spec will be supplied as keyword arguments to initialize().

Example:

class ProfileHandler(RequestHandler):
    def initialize(self, database):
        self.database = database

    def get(self, username):
        ...

app = Application([
    (r'/user/(.*)', ProfileHandler, dict(database=database)),
    ])
get_template_path()[source]

Override to customize template path for each handler.

By default, we use the template_path application setting. Return None to load templates relative to the calling file.

class luigi.server.AllRunHandler(application, request, **kwargs)[source]

Bases: luigi.server.BaseTaskHistoryHandler

get()[source]
class luigi.server.SelectedRunHandler(application, request, **kwargs)[source]

Bases: luigi.server.BaseTaskHistoryHandler

get(name)[source]
luigi.server.from_utc(utcTime, fmt=None)[source]

convert UTC time string to time.struct_time: change datetime.datetime to time, return time.struct_time type

class luigi.server.RecentRunHandler(application, request, **kwargs)[source]

Bases: luigi.server.BaseTaskHistoryHandler

get()[source]
class luigi.server.ByNameHandler(application, request, **kwargs)[source]

Bases: luigi.server.BaseTaskHistoryHandler

get(name)[source]
class luigi.server.ByIdHandler(application, request, **kwargs)[source]

Bases: luigi.server.BaseTaskHistoryHandler

get(id)[source]
class luigi.server.ByParamsHandler(application, request, **kwargs)[source]

Bases: luigi.server.BaseTaskHistoryHandler

get(name)[source]
class luigi.server.RootPathHandler(application, request, **kwargs)[source]

Bases: luigi.server.BaseTaskHistoryHandler

get()[source]
luigi.server.app(scheduler)[source]
luigi.server.run(api_port=8082, address=None, unix_socket=None, scheduler=None)[source]

Runs one instance of the API server.

luigi.server.stop()[source]