httprest Package

httprest Package

auth Module

class opennode.oms.endpoint.httprest.auth.AuthView(context)[source]

Bases: opennode.oms.endpoint.httprest.base.HttpRestView

BASIC_AUTH_DEFAULT = 'false'
realm = 'OMS'
render(request)[source]
class opennode.oms.endpoint.httprest.auth.BasicAuthLogoutView(context)[source]

Bases: opennode.oms.endpoint.httprest.auth.LogoutView

render_GET(request)[source]
class opennode.oms.endpoint.httprest.auth.BasicAuthView(context)[source]

Bases: opennode.oms.endpoint.httprest.auth.AuthView

BASIC_AUTH_DEFAULT = 'true'
class opennode.oms.endpoint.httprest.auth.HttpRestAuthenticationUtility[source]

Bases: grokcore.component.components.GlobalUtility

authenticate(*args, **kwargs)[source]
emit_token(request, token)[source]
generate_token(credentials)[source]
get_basic_auth_credentials(request)[source]
get_principal(token)[source]
get_token(request)[source]
realm = 'OMS'
renew_token(request, token)[source]
token_key = 'change_me'
class opennode.oms.endpoint.httprest.auth.LogoutView(context)[source]

Bases: opennode.oms.endpoint.httprest.base.HttpRestView

realm = 'OMS'
render_GET(request)[source]

base Module

class opennode.oms.endpoint.httprest.base.HttpRestView(context)[source]

Bases: grokcore.component.components.Adapter

filter_attributes(request, data)[source]

Handle the filtering of attributes according to the ‘attrs’ parameter in the request

render_OPTIONS(request)[source]
render_recursive(request, depth)[source]
rw_transaction(request)[source]

grokkers Module

class opennode.oms.endpoint.httprest.grokkers.HttpRestViewSecurityGrokker[source]

Bases: martian.components.ClassGrokker

Specialized security permission directive which protects all render_* methods except render_OPTIONS.

execute(factory, config, permission, **kw)[source]

root Module

exception opennode.oms.endpoint.httprest.root.AbstractRedirect(url, *args, **kwargs)[source]

Bases: opennode.oms.endpoint.httprest.root.HttpStatus

headers[source]
exception opennode.oms.endpoint.httprest.root.BadRequest(body=None, *args, **kwargs)[source]

Bases: opennode.oms.endpoint.httprest.root.HttpStatus

status_code = 400
status_description = 'Bad Request'
exception opennode.oms.endpoint.httprest.root.EmptyResponse[source]

Bases: exceptions.Exception

exception opennode.oms.endpoint.httprest.root.Forbidden(body=None, *args, **kwargs)[source]

Bases: opennode.oms.endpoint.httprest.root.HttpStatus

status_code = 403
status_description = 'Forbidden'
class opennode.oms.endpoint.httprest.root.HttpRestServer(avatar=None)[source]

Bases: twisted.web.resource.Resource

Restful HTTP API interface for OMS.

Exposes a JSON web service to communicate with OMS.

check_auth(request)[source]
find_view(obj, unresolved_path)[source]
getChild(name, request)[source]

We are the handler for anything below this base url, except what explicitly added in oms.tac.

get_interaction(request, token)[source]
handle_request(*args, **kwargs)[source]

Takes a request, maps it to a domain object and a corresponding IHttpRestView, and returns the rendered output of that view.

render(request)[source]
exception opennode.oms.endpoint.httprest.root.HttpStatus(body=None, *args, **kwargs)[source]

Bases: exceptions.Exception

headers = {}
status_code[source]
status_description[source]
exception opennode.oms.endpoint.httprest.root.NotFound(body=None, *args, **kwargs)[source]

Bases: opennode.oms.endpoint.httprest.root.HttpStatus

status_code = 404
status_description = 'Not Found'
exception opennode.oms.endpoint.httprest.root.NotImplemented(body=None, *args, **kwargs)[source]

Bases: opennode.oms.endpoint.httprest.root.HttpStatus

status_code = 501
status_description = 'Not Implemented'
exception opennode.oms.endpoint.httprest.root.SeeCanonical(url, *args, **kwargs)[source]

Bases: opennode.oms.endpoint.httprest.root.AbstractRedirect

status_code = 301
status_description = 'Moved Permanently'
exception opennode.oms.endpoint.httprest.root.SeeOther(url, *args, **kwargs)[source]

Bases: opennode.oms.endpoint.httprest.root.AbstractRedirect

status_code = 303
status_description = 'Moved Temporarily'
exception opennode.oms.endpoint.httprest.root.Unauthorized(body=None, *args, **kwargs)[source]

Bases: opennode.oms.endpoint.httprest.root.HttpStatus

headers = {'Set-Cookie': 'oms_auth_token=;expires=Wed, 01 Jan 2000 00:00:00 GMT', 'WWW-Authenticate': 'Basic realm=OMS'}
status_code = 401
status_description = 'Authorization Required'

view Module

class opennode.oms.endpoint.httprest.view.CommandView(context)[source]

Bases: opennode.oms.endpoint.httprest.view.DefaultView

render_PUT(request)[source]

Converts arguments into command-line counterparts and executes the omsh command.

Parameters passed as ‘arg’ are converted into positional arguments, others are converted into named parameters:

PUT /bin/ls?arg=/some/path&arg=/another/path&-l&–recursive

thus translates to:

/bin/ls /some/path /another/path -l –recursive

Allows blocking (synchronous) and non-blocking operation using the ‘asynchronous’ parameter (any value will trigger it). Synchronous operation requires two threads to function.

write_results(request, pid, cmd)[source]
class opennode.oms.endpoint.httprest.view.ContainerView(context)[source]

Bases: opennode.oms.endpoint.httprest.view.DefaultView

blacklisted(item)[source]
render_GET(request)[source]
render_recursive(request, depth, top_level=False)[source]
class opennode.oms.endpoint.httprest.view.DefaultView(context)[source]

Bases: opennode.oms.endpoint.httprest.base.HttpRestView

put_filter_attributes(request, data)[source]

Offer the possibility to subclasses to massage the received json before default behavior.

render_DELETE(request)[source]
render_GET(request)[source]
render_PUT(request)[source]
class opennode.oms.endpoint.httprest.view.SearchView(context)[source]

Bases: opennode.oms.endpoint.httprest.view.ContainerView

render_GET(request)[source]
class opennode.oms.endpoint.httprest.view.StreamView(context)[source]

Bases: opennode.oms.endpoint.httprest.base.HttpRestView

cached_subscriptions = {}
render(request)[source]
rw_transaction(request)[source]

Table Of Contents

Previous topic

endpoint Package

Next topic

ssh Package

This Page