noc.core.service.api

Module Contents

noc.core.service.api.Redirect
class noc.core.service.api.APIRequestHandler

Bases: tornado.web.RequestHandler

HTTP JSON-RPC request handler

SUPPORTED_METHODS = ['POST']
CALLING_SERVICE_HEADER = X-NOC-Calling-Service
initialize(self, service, api_class)
post(self, *args, **kwargs)
api_error(self, msg, id=None, code=None)
class noc.core.service.api.API(service, request, handler)

Bases: object

Service API declares a set of functions accessible via HTTP JSON-RPC.

API methods are denoted by @api decorator

Service registers SRV records <name> for non-pooled <name>-<pool> for pooled

name
classmethod get_methods(cls)

Returns a list of available API methods

redirect(self, location, method, params)
noc.core.service.api.api(method)
API method decorator
noc.core.service.api.executor(name)
Denote API methods as been executed on threadpool executor

@executor(“script”) @api def script(….)

class noc.core.service.api.lock(name)

Bases: object

Decorator to lock api method call with named lock

__call__(self, method)
exception noc.core.service.api.APIError

Bases: noc.core.error.NOCError