Welcome to db2rest’s documentation!

README:

This is the README file here.

db2rest

A HTTP REST API for relational databases

copyright:
  1. 2013 by Functional Genomic Center Zurich, Nicola Palumbo.
license:

MIT, see LICENSE for more details.

db2rest.app

This modules provide the main class of the application

class db2rest.app.DB2Rest(db_engine, host, port, log, ldap)[source]
dispatch_request(request)[source]
wsgi_app(environ, start_response)[source]
db2rest.app.create_app(config_file)[source]

Create the app and the db engine given the configuration file

db2rest.app.initialize_ldap(string_connection, query)[source]

Initialize the connection with the LDAP server provided the connection string

db2rest.app.create_logger(level)[source]

Create the logger for the application given the level

db2rest.app.start()[source]

Start the app

db2rest.app.create_map(db_engine)[source]

Create a map between the database schema and the application - Each table in the database will be first level of the hiearachy - Each row will be the second level

db2rest.db

This module provide the interfaces with the dababase.

It uses SQLAlchemy to connect and introspect a RDBMS

class db2rest.db.DBAdapter(db_engine)[source]

Responsible to adapt the database.

add_row(table_name, values)[source]

Add a row to a table #: table_name #: values

delete_row(table_name, row_id)[source]

Deletea row from a table #: table_name #: values

get_headers(table_name)[source]
get_row(table_name, row_id)[source]

Returns a list with a row found.

get_rows(table_name)[source]
get_tables()[source]
update_row(table_name, row_id, values)[source]

Update the given row_id in the given table.

db2rest.rest

class db2rest.rest.RestAPI(db_adapter)[source]
delete(request, params)[source]
get(request, params)[source]
post(request, params)[source]
put(request, params)[source]
class db2rest.rest.Row(db_adapter, req, params)[source]
delete()[source]
name = 'Row'
template_name = 'Table'
update()[source]
valid_methods = ['get', 'put', 'delete']
class db2rest.rest.Table(db_adapter, req, params)[source]
create_html()[source]

Extract the values from the html request and create the resource.

create_json()[source]

Extracts the values from the json request and create the resource.

get_html()[source]
get_json()[source]
name = 'Table'
template_name = 'Table'
valid_methods = ['get', 'post']
class db2rest.rest.Tables(db_adapter, req, params)[source]
create()[source]
get()[source]
name = 'Tables'
template_name = 'Tables'
valid_methods = ['get']
class db2rest.rest.View(db_adapter, req, params)[source]

db2rest.exceptions

exception db2rest.exceptions.HTTPExceptionMixin(description=None, response=None)[source]
body_message[source]
get_body(environ=None)[source]
get_response(environ)[source]
exception db2rest.exceptions.MethodNotAllowed(description, valid_methods, method)[source]
body_message[source]
exception db2rest.exceptions.NotFound(description=None, response=None)[source]
body_message[source]
exception db2rest.exceptions.Unauthorized(description=None, response=None)[source]
body_message[source]
get_headers(enviro)[source]

Indices and tables

Table Of Contents

This Page