Cowbird: Middleware operation service

Cowbird (the brood parasite)

The brood parasite manipulates a host, either of the same or of another species, *to raise its young as if it were its own
The shiny cowbird is an obligate brood parasite, meaning that adults will lay their eggs in the nests of other species and their offspring rely entirely on their hosts for parental care.

Cowbird is a middleware that manages interactions between various birds of the bird-house stack.

It therefore relies on the existence of other services under a common architecture, but applies changes to the resources under those services such that the complete ecosystem can seamlessly operate together (see Components Diagram).

dependencies

Requires Python 3.7+ Dependencies Status

build status

Readthedocs Build Status (master branch)

tests status

Github Actions CI Build Status (master branch) Github Actions CI Build Status (latest tag) Travis-CI CodeCov Coverage Codacy Badge

docker status

Docker Build Status (latest tag) Docker Build Status (latest tag)

releases

Latest Tag Commits since latest release

Documentation

The REST API documentation is auto-generated and served under {COWBIRD_URL}/api/ using Swagger-UI with tag latest.

More ample details about installation, configuration and usage are provided on readthedocs.
These are generated from corresponding information provided in docs.

Configuration and Usage

Multiple configuration options exist for Cowbird application.
Please refer to configuration for details.
See usage for details.

Change History

Addressed features, changes and bug fixes per version tag are available in CHANGES.

Docker Images

Following most recent variants are available:

Cowbird

pavics/cowbird:0.4.0

pavics/cowbird:latest

Notes:

Table of Contents

Usage

In most situation, you will want to run Cowbird as a Web Application in combination with a larger set of bird-house components forming a server instance. A minimal docker-compose.yml example is provided, but Cowbird’s actual configuration will greatly depend on your actual service requirements.

Setup and Validation

To use Cowbird in a project, first you need to install it. To do so, please follow steps in Installation and Configuration procedures.

After this, you should be able to call the CLI CLI Utilities to validate it is installed properly using:

cowbird --help

Web Application

To start the Web Application, you can simply run the following command:

make start

This will first install any missing dependencies in the current environment (see Installation), and will after start a basic Web Application on localhost:7000 with default configurations. Please refer to Configuration if any of the parameters needs adjustment for custom environments.

For running the application, multiple WSGI HTTP Servers can be employed (e.g.: Gunicorn, Waitress, etc.). They usually all support as input an INI configuration file for specific settings. Cowbird also employs such INI file (cowbird.ini) to customize its behaviour. See Configuration for further details, and please refer to the employed WSGI application documentation of your liking for their respective setup requirements.

API

When the application is started, the Swagger API should be available under /api path. This will render the current version API and applicable requests. Please refer to this documentation to discover all provided API paths and events supported by Cowbird on a running instance (that could be older than latest code base). Alternatively, documentation of all versions is available on ReadTheDocs.

CLI

After successful Installation of Cowbird package, multiple helper CLI Utilities become available as CLI applications callable from the shell. These can be quite useful to run typical Cowbird events calls from the terminal without having to form corresponding HTTP requests. Please refer to the relevant page for further details.

Documentation

The documentation is automatically built by ReadTheDocs. It is generated from the documentation source, the parsing of Python docstrings within the code, the code itself, and the Cowbird REST API.

You can also preview the result by building the documentation locally using:

make docs

The resulting location will be printed on the terminal and can be opened in a web browser.

Testing

Tests are executed using a Web Application that gets spawned by a set of default configurations to run HTTP requests against.

Note

To customize execution parameters, you can export variables such as COWBIRD_INI_FILE_PATH for example, and they will be picked up to validate specific results against defined Configuration.

When adding new features or fixing bugs, it is recommended to execute linting checks and tests locally prior to opening a PR, as each PR gets tested and you will waste more time waiting for results to complete then if ran locally.

To validate linting of the code, simply call:

make check

To run all tests locally, simply execute the following command:

make test

Coverage analysis with the same set of tests is also available using:

make coverage

You can also run subsets of tests according to markers and/or specific test function pytest specification using:

make SPEC="<CUSTOM TEST SPECIFICATIONS>" test-custom

Or some of the predefined filters:

make test-api
make test-cli

Finally, the following command can be executed to built and run a smoke test of the resulting Docker image:

make test-docker

Installation

Basic Setup

At the command line:

make install

This will create a conda environment named cowbird, and install all required dependencies of the package in it. You should be ready to employ Cowbird with example Configuration files at this point.

Advanced

To install in another environment, CONDA_ENV_NAME can be provided to make.

Otherwise, following can be used to install with whichever python is detected (up to user to manage references):

make install-pkg

If you want the full setup for development (including dependencies for test execution), use:

make install-dev

Configuration

At startup, Cowbird application will load multiple configuration files to define various behaviours or setup operations. These are defined though the configuration settings presented in below sections.

All generic Cowbird configuration settings can be defined through either the cowbird.ini file or environment variables. Values defined in cowbird.ini are expected to follow the cowbird.[variable_name] format, and corresponding COWBIRD_[VARIABLE_NAME] format is used for environment variables. Both of these alternatives match the constants defined in cowbird/constants.py and can be used interchangeably.

Configuration Files

File: cowbird.ini

This is the base configuration file that defines most of Cowbird’s lower level application configuration (API, CLI). A basic cowbird.example.ini configuration is provided, which should allow any user to run the application locally. It is recommended to create a copy of this file as cowbird.ini to customize settings to your linking (this file is ignored for repository commits).

Furthermore, this file is used by default in each tagged Docker image, and mounted at ${COWBIRD_CONFIG_DIR}/cowbird.ini location. If you want to provide different configuration, the file should be overridden in the Docker image using a volume mount parameter, or by specifying an alternative path through the environment variable COWBIRD_INI_FILE_PATH.

File: config.yml

This is the core configuration file that defines most of Cowbird’s data configuration which it must work with to manage Services components. A basic config.example.yml file is provided, for sample definition of expected schemas per service. Please refer to its comment header for specific format and parameter details.

Settings and Constants

Environment variables can be used to define all following configurations (unless mentioned otherwise with [constant] keyword next to the parameter name). Most values are parsed as plain strings, unless they refer to an activatable setting (e.g.: True or False), or when specified with more specific [<type>] notation.

Configuration variables will be used by Cowbird on startup unless prior definition is found within cowbird.ini. All variables (i.e.: non-[constant] parameters) can also be specified by their cowbird.[variable_name] setting counterpart as described at the start of the Configuration section.

Loading Settings

These settings can be used to specify where to find other settings through custom configuration files.

  • COWBIRD_MODULE_DIR [constant]

    Path to the top level cowbird module (ie: source code).

  • COWBIRD_ROOT [constant]

    Path to the containing directory of Cowbird. This corresponds to the directory where the repository was cloned or where the package was installed.

  • COWBIRD_CONFIG_DIR
    (Default: ${COWBIRD_ROOT}/config)

    Configuration directory where to look for cowbird.ini file.

  • COWBIRD_CONFIG_PATH

    Explicit path where to find a config.yml configuration file to load at Cowbird startup.

    See also

    File: config.yml

  • COWBIRD_INI_FILE_PATH

    Specifies where to find the initialization file to run Cowbird application.

    Warning

    This variable ignores the setting/env-var resolution order since settings cannot be defined without firstly loading the file referenced by its value.

Application Settings

Following configuration parameters are used to define values that are employed by Cowbird after loading the Loading Settings. All cowbird.[variable_name] counterpart definitions are also available as described at the start of the Configuration section.

  • COWBIRD_URL
    (Default: "http://localhost:2001")

    Full hostname URL to use so that Cowbird can resolve his own running instance location.

    Note

    This value is notably useful to indicate the exposed proxy location where Cowbird should be invoked from within a server stack that integrates it.

  • COWBIRD_LOG_LEVEL
    (Default: INFO)

    Logging level of operations. Cowbird will first use the complete logging configuration found in cowbird.ini in order to define logging formatters and handler referencing to the logger_cowbird section. If this configuration fail to retrieve an explicit logging level, this configuration variable is used instead to prepare a basic logger, after checking if a corresponding cowbird.log_level setting was instead specified.

    Warning

    When setting DEBUG level or lower, Cowbird could potentially dump some sensitive information in logs. It is important to avoid this setting for production systems.

  • COWBIRD_LOG_PRINT
    (Default: False)

    Specifies whether Cowbird logging should also enforce printing the details to the console when using CLI Utilities. Otherwise, the configured logging methodology in cowbird.ini is used (which can also define a console handler).

  • COWBIRD_LOG_REQUEST
    (Default: True)

    Specifies whether Cowbird should log incoming request details.

    Note

    This can make Cowbird quite verbose if large quantity of requests are accomplished.

  • COWBIRD_LOG_EXCEPTION
    (Default: True)

    Specifies whether Cowbird should log a raised exception during a process execution.

Components Diagram

Cowbird Components

CLI Utilities

CLI Helpers and Commands

Multiple CLI helpers are provided.

The common functions provided allow invocation and result retrieval similar to the Web API, but from a terminal. The Configuration files must be available in default location, or provided as input to resolve operations.

Please refer to the corresponding usage detail of each helper by calling them with --help argument for more details. More specifically:

# display available helpers
cowbird --help

# display available commands of 'services' helper
cowbird services --help

# display specific arguments and options of 'list' command of 'services' helper
cowbird services list --help

The cowbird CLI should be available on your path directly following Installation of the package. When using an conda environment, you should activate it first to make the CLI available.

Source code of these helpers can be found here.

API Reference

This page contains auto-generated API reference documentation 1.

cowbird

Subpackages
cowbird.api
Subpackages
cowbird.api.home
Submodules
cowbird.api.home.views
Module Contents
Functions

get_homepage(request)

Cowbird API homepage.

get_version(request)

Version of the API.

get_worker_version()

Attributes

LOGGER

cowbird.api.home.views.LOGGER[source]
cowbird.api.home.views.get_homepage(request)[source]

Cowbird API homepage.

cowbird.api.home.views.get_version(request)[source]

Version of the API.

cowbird.api.home.views.get_worker_version()[source]
Package Contents
Functions

get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when

includeme(config)

Attributes

LOGGER

cowbird.api.home.get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None)logging.Logger[source]

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is logging.NOTSET.

cowbird.api.home.LOGGER[source]
cowbird.api.home.includeme(config)[source]
cowbird.api.services
Submodules
cowbird.api.services.views
Module Contents
Functions

get_services_view(request)

List all registered services.

get_service_view(request)

Get service details.

cowbird.api.services.views.get_services_view(request)[source]

List all registered services.

cowbird.api.services.views.get_service_view(request)[source]

Get service details.

Package Contents
Functions

get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when

includeme(config)

cowbird.api.services.get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None)logging.Logger[source]

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is logging.NOTSET.

cowbird.api.services.includeme(config)[source]
cowbird.api.swagger
Submodules
cowbird.api.swagger.views
Module Contents
Functions

api_swagger(request)

Swagger UI route to display the Cowbird REST API schemas.

api_schema(request: pyramid.request.Request) → cowbird.typedefs.JSON

Return JSON Swagger specifications of Cowbird REST API.

cowbird.api.swagger.views.api_swagger(request)[source]

Swagger UI route to display the Cowbird REST API schemas.

cowbird.api.swagger.views.api_schema(request: pyramid.request.Request)cowbird.typedefs.JSON[source]

Return JSON Swagger specifications of Cowbird REST API.

Package Contents
Functions

api_schema(request: pyramid.request.Request) → cowbird.typedefs.JSON

Return JSON Swagger specifications of Cowbird REST API.

api_swagger(request)

Swagger UI route to display the Cowbird REST API schemas.

get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when

includeme(config)

cowbird.api.swagger.api_schema(request: pyramid.request.Request)cowbird.typedefs.JSON[source]

Return JSON Swagger specifications of Cowbird REST API.

cowbird.api.swagger.api_swagger(request)[source]

Swagger UI route to display the Cowbird REST API schemas.

cowbird.api.swagger.get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None)logging.Logger[source]

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is logging.NOTSET.

cowbird.api.swagger.includeme(config)[source]
cowbird.api.webhooks
Submodules
cowbird.api.webhooks.views
Module Contents
Functions

dispatch(svc_fct)

post_user_webhook_view(request)

User webhook used for created or removed user events.

post_permission_webhook_view(request)

Permission webhook used for created or removed permission events.

Attributes

LOGGER

cowbird.api.webhooks.views.LOGGER[source]
cowbird.api.webhooks.views.dispatch(svc_fct)[source]
cowbird.api.webhooks.views.post_user_webhook_view(request)[source]

User webhook used for created or removed user events.

cowbird.api.webhooks.views.post_permission_webhook_view(request)[source]

Permission webhook used for created or removed permission events.

Package Contents
Functions

get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when

includeme(config)

cowbird.api.webhooks.get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None)logging.Logger[source]

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is logging.NOTSET.

cowbird.api.webhooks.includeme(config)[source]
Submodules
cowbird.api.exception
Module Contents
Functions

verify_param(param: Ellipsis, param_compare: Optional[Union[Any, List[Any]]] = None, param_name: Optional[str] = None, param_content: Optional[cowbird.typedefs.JSON] = None, with_param: bool = True, http_error: Type[pyramid.httpexceptions.HTTPError] = HTTPBadRequest, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, msg_on_fail: str = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: str = CONTENT_TYPE_JSON, not_none: bool = False, not_empty: bool = False, not_in: bool = False, not_equal: bool = False, is_true: bool = False, is_false: bool = False, is_none: bool = False, is_empty: bool = False, is_in: bool = False, is_equal: bool = False, is_type: bool = False, matches: bool = False) → None

Evaluate various parameter combinations given the requested verification flags. Given a failing verification,

apply_param_content(content: Ellipsis, param: Any, param_compare: Any, param_name: str, with_param: bool, param_content: Optional[cowbird.typedefs.JSON], needs_compare: bool, needs_iterable: bool, is_type: bool, fail_conditions: cowbird.typedefs.JSON) → cowbird.typedefs.JSON

Formats and applies the failing parameter conditions and results to returned JSON content according to flags.

evaluate_call(call: Ellipsis, fallback: Optional[Callable[[], None]] = None, http_error: Type[pyramid.httpexceptions.HTTPError] = HTTPInternalServerError, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, msg_on_fail: str = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: str = CONTENT_TYPE_JSON) → Any

Evaluates the specified call with a wrapped HTTP exception handling. On failure, tries to call.

valid_http(http_success: Ellipsis = HTTPOk, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, detail: Optional[str] = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: Optional[str] = CONTENT_TYPE_JSON) → Union[pyramid.httpexceptions.HTTPSuccessful, pyramid.httpexceptions.HTTPRedirection]

Returns successful HTTP with standardized information formatted with content type. (see raise_http() for HTTP

raise_http(http_error: Ellipsis = HTTPInternalServerError, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, detail: str = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: str = CONTENT_TYPE_JSON, nothrow: bool = False) → NoReturn

Raises error HTTP with standardized information formatted with content type.

validate_params(http_class: Ellipsis, http_base: Union[Type[pyramid.httpexceptions.HTTPException], Iterable[Type[pyramid.httpexceptions.HTTPException]]], detail: str, content: Optional[cowbird.typedefs.JSON], content_type: str) → Tuple[int, str, cowbird.typedefs.JSON]

Validates parameter types and formats required by valid_http() and raise_http().

format_content_json_str(http_code, detail, content, content_type)

Inserts the code, details, content and type within the body using json format. Includes also any other specified

rewrite_content_type(content: Union[str, cowbird.typedefs.JSON], content_type: str) → Tuple[str, Optional[cowbird.typedefs.JSON]]

Attempts to rewrite the type field inserted by various functions such as:

generate_response_http_format(http_class: Type[pyramid.httpexceptions.HTTPException], http_kwargs: Optional[cowbird.typedefs.ParamsType], content: cowbird.typedefs.JSON, content_type: Optional[str] = CONTENT_TYPE_PLAIN, metadata: Optional[cowbird.typedefs.JSON] = None) → pyramid.httpexceptions.HTTPException

Formats the HTTP response content according to desired content_type using provided HTTP code and content.

Attributes

LOGGER

RAISE_RECURSIVE_SAFEGUARD_MAX

RAISE_RECURSIVE_SAFEGUARD_COUNT

PARAM_REGEX

EMAIL_REGEX

UUID_REGEX

URL_REGEX

INDEX_REGEX

cowbird.api.exception.LOGGER[source]
cowbird.api.exception.RAISE_RECURSIVE_SAFEGUARD_MAX = 5[source]
cowbird.api.exception.RAISE_RECURSIVE_SAFEGUARD_COUNT = 0[source]
cowbird.api.exception.PARAM_REGEX = ^[A-Za-z0-9]+(?:[\s_\-\.][A-Za-z0-9]+)*$[source]
cowbird.api.exception.EMAIL_REGEX[source]
cowbird.api.exception.UUID_REGEX[source]
cowbird.api.exception.URL_REGEX[source]
cowbird.api.exception.INDEX_REGEX = ^[0-9]+$[source]
cowbird.api.exception.verify_param(param: Ellipsis, param_compare: Optional[Union[Any, List[Any]]] = None, param_name: Optional[str] = None, param_content: Optional[cowbird.typedefs.JSON] = None, with_param: bool = True, http_error: Type[pyramid.httpexceptions.HTTPError] = HTTPBadRequest, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, msg_on_fail: str = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: str = CONTENT_TYPE_JSON, not_none: bool = False, not_empty: bool = False, not_in: bool = False, not_equal: bool = False, is_true: bool = False, is_false: bool = False, is_none: bool = False, is_empty: bool = False, is_in: bool = False, is_equal: bool = False, is_type: bool = False, matches: bool = False)None[source]

Evaluate various parameter combinations given the requested verification flags. Given a failing verification, directly raises the specified http_error. Invalid usage exceptions generated by this verification process are treated as HTTPInternalServerError. Exceptions are generated using the standard output method.

Parameters
  • param – parameter value to evaluate

  • param_compare – Other value(s) to test param against. Can be an iterable (single value resolved as iterable unless None). To test for None type, use is_none/not_none flags instead.

  • param_name – name of the tested parameter returned in response if specified for debugging purposes

  • param_content – Additional JSON content to apply to generated error content on raise when with_param is True. Must be JSON serializable. Provided content can override generated error parameter if matching fields.

  • with_param – On raise, adds values of param, param_name and param_compare, as well as additional failing conditions metadata to the JSON response body for each of the corresponding value.

  • http_error – derived exception to raise on test failure (default: HTTPBadRequest)

  • http_kwargs – additional keyword arguments to pass to http_error called in case of HTTP exception

  • msg_on_fail – message details to return in HTTP exception if flag condition failed

  • content – json formatted additional content to provide in case of exception

  • content_type – format in which to return the exception (one of cowbird.common.SUPPORTED_ACCEPT_TYPES)

  • not_none – test that param is not None type

  • not_empty – test that param is not an empty iterable (string, list, set, etc.)

  • not_in – test that param does not exist in param_compare values

  • not_equal – test that param is not equal to param_compare value

  • is_true – test that param is True

  • is_false – test that param is False

  • is_none – test that param is None type

  • is_empty – test param for an empty iterable (string, list, set, etc.)

  • is_in – test that param exists in param_compare values

  • is_equal – test that param equals param_compare value

  • is_type – test that param is of same type as specified by param_compare type

  • matches – test that param matches the regex specified by param_compare value

Raises
  • HTTPError – if tests fail, specified exception is raised (default: HTTPBadRequest)

  • HTTPInternalServerError – for evaluation error

Returns

nothing if all tests passed

cowbird.api.exception.apply_param_content(content: Ellipsis, param: Any, param_compare: Any, param_name: str, with_param: bool, param_content: Optional[cowbird.typedefs.JSON], needs_compare: bool, needs_iterable: bool, is_type: bool, fail_conditions: cowbird.typedefs.JSON)cowbird.typedefs.JSON[source]

Formats and applies the failing parameter conditions and results to returned JSON content according to flags.

See also

verify_param()

cowbird.api.exception.evaluate_call(call: Ellipsis, fallback: Optional[Callable[], None]] = None, http_error: Type[pyramid.httpexceptions.HTTPError] = HTTPInternalServerError, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, msg_on_fail: str = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: str = CONTENT_TYPE_JSON)Any[source]

Evaluates the specified call with a wrapped HTTP exception handling. On failure, tries to call.

fallback if specified, and finally raises the specified http_error.

Any potential error generated by fallback or http_error themselves are treated as HTTPInternalServerError.

Exceptions are generated using the standard output method formatted based on specified content_type.

Example:

normal call:

try:
    res = func(args)
except Exception as exc:
    fb_func()
    raise HTTPExcept(exc.message)

wrapped call:

res = evaluate_call(lambda: func(args), fallback=lambda: fb_func(), http_error=HTTPExcept, **kwargs)
Parameters
  • call – function to call, MUST be specified as lambda: <function_call>

  • fallback – function to call (if any) when call failed, MUST be lambda: <function_call>

  • http_error – alternative exception to raise on call failure

  • http_kwargs – additional keyword arguments to pass to http_error if called in case of HTTP exception

  • msg_on_fail – message details to return in HTTP exception if call failed

  • content – json formatted additional content to provide in case of exception

  • content_type – format in which to return the exception (one of cowbird.common.SUPPORTED_ACCEPT_TYPES)

Raises
  • http_error – on call failure

  • HTTPInternalServerError – on fallback failure

Returns

whichever return value call might have if no exception occurred

cowbird.api.exception.valid_http(http_success: Ellipsis = HTTPOk, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, detail: Optional[str] = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: Optional[str] = CONTENT_TYPE_JSON)Union[pyramid.httpexceptions.HTTPSuccessful, pyramid.httpexceptions.HTTPRedirection][source]

Returns successful HTTP with standardized information formatted with content type. (see raise_http() for HTTP error calls)

Parameters
  • http_success – any derived class from valid HTTP codes (<400) (default: HTTPOk)

  • http_kwargs – additional keyword arguments to pass to http_success when called

  • detail – additional message information (default: empty)

  • content – json formatted content to include

  • content_type – format in which to return the exception (one of cowbird.utils.SUPPORTED_ACCEPT_TYPES)

Returns

formatted successful response with additional details and HTTP code

cowbird.api.exception.raise_http(http_error: Ellipsis = HTTPInternalServerError, http_kwargs: Optional[cowbird.typedefs.ParamsType] = None, detail: str = '', content: Optional[cowbird.typedefs.JSON] = None, content_type: str = CONTENT_TYPE_JSON, nothrow: bool = False)NoReturn[source]

Raises error HTTP with standardized information formatted with content type.

The content contains the corresponding http error code, the provided message as detail and optional specified additional json content (kwarg dict).

See also

valid_http() for HTTP successful calls

Parameters
  • http_error – any derived class from base HTTPError (default: HTTPInternalServerError)

  • http_kwargs – additional keyword arguments to pass to http_error if called in case of HTTP exception

  • detail – additional message information (default: empty)

  • content – json formatted content to include

  • content_type – format in which to return the exception (one of cowbird.utils.SUPPORTED_ACCEPT_TYPES)

  • nothrow – returns the error response instead of raising it automatically, but still handles execution errors

Raises

HTTPError – formatted raised exception with additional details and HTTP code

Returns

HTTPError formatted exception with additional details and HTTP code only if nothrow is True

cowbird.api.exception.validate_params(http_class: Ellipsis, http_base: Union[Type[pyramid.httpexceptions.HTTPException], Iterable[Type[pyramid.httpexceptions.HTTPException]]], detail: str, content: Optional[cowbird.typedefs.JSON], content_type: str)Tuple[int, str, cowbird.typedefs.JSON][source]

Validates parameter types and formats required by valid_http() and raise_http().

Parameters
  • http_class – any derived class from base HTTPException to verify

  • http_base – any derived sub-class(es) from base HTTPException as minimum requirement for http_class (ie: 2xx, 4xx, 5xx codes). Can be a single class of an iterable of possible requirements (any).

  • detail – additional message information (default: empty)

  • content – json formatted content to include

  • content_type – format in which to return the exception (one of cowbird.utils.SUPPORTED_ACCEPT_TYPES)

Raises

HTTPInternalServerError – if any parameter is of invalid expected format

Returns http_code, detail, content

parameters with corrected and validated format if applicable

cowbird.api.exception.format_content_json_str(http_code, detail, content, content_type)[source]

Inserts the code, details, content and type within the body using json format. Includes also any other specified json formatted content in the body. Returns the whole json body as a single string for output.

Raises

HTTPInternalServerError – if parsing of the json content failed

Returns

formatted json content as string with added HTTP code and details

cowbird.api.exception.rewrite_content_type(content: Union[str, cowbird.typedefs.JSON], content_type: str)Tuple[str, Optional[cowbird.typedefs.JSON]][source]

Attempts to rewrite the type field inserted by various functions such as:

By applying the new value provided by content_type.

Returns

Content with rewritten “type” (if possible) and converted to string directly insertable to a response body. Also provides the converted JSON body if applicable (original content was literal JSON or JSON-like string).

cowbird.api.exception.generate_response_http_format(http_class: Type[pyramid.httpexceptions.HTTPException], http_kwargs: Optional[cowbird.typedefs.ParamsType], content: cowbird.typedefs.JSON, content_type: Optional[str] = CONTENT_TYPE_PLAIN, metadata: Optional[cowbird.typedefs.JSON] = None)pyramid.httpexceptions.HTTPException[source]

Formats the HTTP response content according to desired content_type using provided HTTP code and content.

Parameters
  • http_classHTTPException derived class to use for output (code, generic title/explanation, etc.)

  • http_kwargs – additional keyword arguments to pass to http_class when called

  • content – formatted JSON content or literal string content providing additional details for the response

  • content_type – one of cowbird.utils.SUPPORTED_ACCEPT_TYPES (default: cowbird.utils.CONTENT_TYPE_PLAIN)

  • metadata – request metadata to add to the response body. (see: cowbird.api.requests.get_request_info())

Returns

http_class instance with requested information and content type if creation succeeds

Raises

HTTPInternalServerError instance details about requested information and content type if creation fails

cowbird.api.generic
Module Contents
Functions

internal_server_error(request: pyramid.request.Request) → pyramid.httpexceptions.HTTPException

Overrides default HTTP.

not_found_or_method_not_allowed(request: pyramid.request.Request) → pyramid.httpexceptions.HTTPException

Overrides the default HTTPNotFound [404] by appropriate HTTPMethodNotAllowed [405] when applicable.

guess_target_format(request: pyramid.request.Request) → Tuple[str, bool]

Guess the best applicable response Content-Type header according to request Accept header and format

validate_accept_header_tween(handler: Callable[[pyramid.request.Request], pyramid.response.Response], registry: pyramid.registry.Registry) → Callable[[pyramid.request.Request], pyramid.response.Response]

Tween that validates that the specified request Accept header or format query (if any) is a supported one by

apply_response_format_tween(handler: Callable[[pyramid.request.Request], pyramid.httpexceptions.HTTPException], registry: pyramid.registry.Registry) → Callable[[pyramid.request.Request], pyramid.response.Response]

Tween that obtains the request Accept header or format query (if any) to generate the response with the

get_exception_info(response: Union[pyramid.httpexceptions.HTTPException, pyramid.request.Request, pyramid.response.Response], content: Optional[cowbird.typedefs.JSON] = None, exception_details: bool = False) → cowbird.typedefs.JSON

Obtains additional exception content details about the response according to available information.

get_request_info(request: Union[pyramid.request.Request, pyramid.httpexceptions.HTTPException], default_message: Optional[str] = None, exception_details: bool = False) → cowbird.typedefs.JSON

Obtains additional content details about the request according to available information.

Attributes

LOGGER

cowbird.api.generic.LOGGER[source]
cowbird.api.generic.internal_server_error(request: pyramid.request.Request)pyramid.httpexceptions.HTTPException[source]

Overrides default HTTP.

cowbird.api.generic.not_found_or_method_not_allowed(request: pyramid.request.Request)pyramid.httpexceptions.HTTPException[source]

Overrides the default HTTPNotFound [404] by appropriate HTTPMethodNotAllowed [405] when applicable.

Not found response can correspond to underlying process operation not finding a required item, or a completely unknown route (path did not match any existing API definition). Method not allowed is more specific to the case where the path matches an existing API route, but the specific request method (GET, POST, etc.) is not allowed on this path.

Without this fix, both situations return [404] regardless.

cowbird.api.generic.guess_target_format(request: pyramid.request.Request)Tuple[str, bool][source]

Guess the best applicable response Content-Type header according to request Accept header and format query, or defaulting to CONTENT_TYPE_JSON.

Returns

tuple of matched MIME-type and where it was found (True: header, False: query)

cowbird.api.generic.validate_accept_header_tween(handler: Callable[[pyramid.request.Request], pyramid.response.Response], registry: pyramid.registry.Registry)Callable[[pyramid.request.Request], pyramid.response.Response][source]

Tween that validates that the specified request Accept header or format query (if any) is a supported one by the application and for the given context.

Raises

HTTPNotAcceptable – if desired Content-Type is not supported.

cowbird.api.generic.apply_response_format_tween(handler: Callable[[pyramid.request.Request], pyramid.httpexceptions.HTTPException], registry: pyramid.registry.Registry)Callable[[pyramid.request.Request], pyramid.response.Response][source]

Tween that obtains the request Accept header or format query (if any) to generate the response with the desired Content-Type.

The target Content-Type is expected to have been validated by validate_accept_header_tween() beforehand to handle not-acceptable errors.

The tween also ensures that additional request metadata extracted from get_request_info() is applied to the response body if not already provided by a previous operation.

cowbird.api.generic.get_exception_info(response: Union[pyramid.httpexceptions.HTTPException, pyramid.request.Request, pyramid.response.Response], content: Optional[cowbird.typedefs.JSON] = None, exception_details: bool = False)cowbird.typedefs.JSON[source]

Obtains additional exception content details about the response according to available information.

cowbird.api.generic.get_request_info(request: Union[pyramid.request.Request, pyramid.httpexceptions.HTTPException], default_message: Optional[str] = None, exception_details: bool = False)cowbird.typedefs.JSON[source]

Obtains additional content details about the request according to available information.

cowbird.api.requests
Module Contents
Functions

check_value(value: Any, param_name: str, check_type: Any = str, pattern: Optional[Union[str, bool]] = ax.PARAM_REGEX, http_error: Optional[Type[pyramid.httpexceptions.HTTPError]] = None, msg_on_fail: Optional[str] = None) → None

Validates the value against specified type and pattern.

get_request_method_content(request)

get_multiformat_body_raw(request: pyramid.request.Request, key: str, default: Optional[Any] = None) → Any

Obtains the value of key element from the request body according to specified Content-Type header.

get_multiformat_body(request: pyramid.request.Request, key: str, default: Any = None, check_type: Any = str, pattern: Optional[Union[str, bool]] = ax.PARAM_REGEX, http_error: Optional[Type[pyramid.httpexceptions.HTTPError]] = None, msg_on_fail: Optional[str] = None) → str

Obtains and validates the matched value under key element from the request body.

get_path_param(request: pyramid.request.Request, key: str, check_type: Any = str, pattern: Optional[Union[str, bool]] = ax.PARAM_REGEX, http_error: Optional[Type[pyramid.httpexceptions.HTTPError]] = None, msg_on_fail: Optional[str] = None) → str

Obtains the matched value located at the expected position of the specified path variable.

get_query_param(request: pyramid.request.Request, case_insensitive_key: Union[str, Iterable[str]], default: Optional[Any] = None) → Any

Retrieves a query string value by name (case insensitive), or returns the default if not present.

Attributes

LOGGER

cowbird.api.requests.LOGGER[source]
cowbird.api.requests.check_value(value: Any, param_name: str, check_type: Any = str, pattern: Optional[Union[str, bool]] = ax.PARAM_REGEX, http_error: Optional[Type[pyramid.httpexceptions.HTTPError]] = None, msg_on_fail: Optional[str] = None)None[source]

Validates the value against specified type and pattern.

Parameters
  • value – value to validate.

  • check_type – verify that parameter value is of specified type. Set to None to disable check.

  • pattern – regex pattern to validate the input with. If value evaluates to False, skip this kind of validation (default: ax.PARAM_REGEX).

  • param_name – path variable key.

  • http_error – derived exception to raise on check failure (default: HTTPUnprocessableEntity)

  • msg_on_fail – message details to return in HTTP exception if check failed (default: description message of UnprocessableEntityResponseSchema).

Returns

None.

Raises

HTTPError – if the key is not an applicable path variable for this request.

cowbird.api.requests.get_request_method_content(request)[source]
cowbird.api.requests.get_multiformat_body_raw(request: pyramid.request.Request, key: str, default: Optional[Any] = None)Any[source]

Obtains the value of key element from the request body according to specified Content-Type header.

cowbird.api.requests.get_multiformat_body(request: pyramid.request.Request, key: str, default: Any = None, check_type: Any = str, pattern: Optional[Union[str, bool]] = ax.PARAM_REGEX, http_error: Optional[Type[pyramid.httpexceptions.HTTPError]] = None, msg_on_fail: Optional[str] = None)str[source]

Obtains and validates the matched value under key element from the request body.

Parsing of the body is accomplished according to Content-Type header.

Parameters
  • request – request from which to retrieve the key.

  • key – body key variable.

  • default – value to return instead if not found. If this default is None, it will raise.

  • check_type – verify that parameter value is of specified type. Set to None to disable check.

  • pattern – regex pattern to validate the input with. If value evaluates to False, skip this kind of validation (default: cowbird.api.exception.PARAM_REGEX).

  • http_error – derived exception to raise on check failure (default: HTTPUnprocessableEntity)

  • msg_on_fail – message details to return in HTTP exception if check failed (default: description message of UnprocessableEntityResponseSchema).

Returns

matched path variable value.

Raises
  • HTTPBadRequest – if the key could not be retrieved from the request body and has no provided default value.

  • HTTPUnprocessableEntity – if the retrieved value from the key is invalid for this request.

cowbird.api.requests.get_path_param(request: pyramid.request.Request, key: str, check_type: Any = str, pattern: Optional[Union[str, bool]] = ax.PARAM_REGEX, http_error: Optional[Type[pyramid.httpexceptions.HTTPError]] = None, msg_on_fail: Optional[str] = None)str[source]

Obtains the matched value located at the expected position of the specified path variable.

Parameters
  • request – request from which to retrieve the key.

  • key – path variable key.

  • check_type – verify that parameter value is of specified type. Set to None to disable check.

  • pattern – regex pattern to validate the input with. If value evaluates to False, skip this kind of validation (default: ax.PARAM_REGEX).

  • http_error – derived exception to raise on check failure (default: HTTPUnprocessableEntity)

  • msg_on_fail – message details to return in HTTP exception if check failed (default: description message of UnprocessableEntityResponseSchema).

Returns

matched path variable value.

Raises

HTTPError – if the key is not an applicable path variable for this request.

cowbird.api.requests.get_query_param(request: pyramid.request.Request, case_insensitive_key: Union[str, Iterable[str]], default: Optional[Any] = None)Any[source]

Retrieves a query string value by name (case insensitive), or returns the default if not present.

cowbird.api.schemas
Module Contents
Classes

ValidOperations

Valid values as webhook event.

Service_RequestPathSchema

Fundamental building block of schemas.

AcceptType

Fundamental building block of schemas.

ContentType

Fundamental building block of schemas.

RequestHeaderSchemaAPI

Fundamental building block of schemas.

RequestHeaderSchemaUI

Fundamental building block of schemas.

QueryRequestSchemaAPI

Fundamental building block of schemas.

BaseRequestSchemaAPI

Fundamental building block of schemas.

HeaderResponseSchema

Fundamental building block of schemas.

BaseResponseSchemaAPI

Fundamental building block of schemas.

BaseResponseBodySchema

Fundamental building block of schemas.

ErrorVerifyParamConditions

Fundamental building block of schemas.

ErrorVerifyParamBodySchema

Fundamental building block of schemas.

ErrorFallbackBodySchema

Fundamental building block of schemas.

ErrorCallBodySchema

Fundamental building block of schemas.

ErrorResponseBodySchema

Fundamental building block of schemas.

InternalServerErrorResponseBodySchema

Fundamental building block of schemas.

BadRequestResponseSchema

Fundamental building block of schemas.

UnauthorizedResponseBodySchema

Fundamental building block of schemas.

UnauthorizedResponseSchema

Fundamental building block of schemas.

HTTPForbiddenResponseSchema

Fundamental building block of schemas.

NotFoundResponseSchema

Fundamental building block of schemas.

MethodNotAllowedResponseSchema

Fundamental building block of schemas.

NotAcceptableResponseSchema

Fundamental building block of schemas.

UnprocessableEntityResponseSchema

Fundamental building block of schemas.

InternalServerErrorResponseSchema

Fundamental building block of schemas.

PermissionSchema

Fundamental building block of schemas.

PermissionListSchema

Fundamental building block of schemas.

ResourceSchema

Fundamental building block of schemas.

ResourceListSchema

Fundamental building block of schemas.

ServiceSummarySchema

Fundamental building block of schemas.

ServiceListSchema

Fundamental building block of schemas.

ServiceConfigurationSchema

Fundamental building block of schemas.

ServiceDetailSchema

Fundamental building block of schemas.

Services_GET_RequestSchema

Fundamental building block of schemas.

Services_GET_ResponseBodySchema

Fundamental building block of schemas.

Services_GET_OkResponseSchema

Fundamental building block of schemas.

Services_GET_BadRequestResponseSchema

Fundamental building block of schemas.

Services_POST_RequestBodySchema

Fundamental building block of schemas.

Services_POST_RequestSchema

Fundamental building block of schemas.

Services_POST_CreatedResponseSchema

Fundamental building block of schemas.

Services_POST_BadRequestResponseSchema

Fundamental building block of schemas.

Service_SummaryBodyResponseSchema

Fundamental building block of schemas.

Service_GET_RequestSchema

Fundamental building block of schemas.

Service_GET_ResponseBodySchema

Fundamental building block of schemas.

Service_GET_OkResponseSchema

Fundamental building block of schemas.

Service_GET_NotFoundResponseSchema

Fundamental building block of schemas.

Services_POST_ForbiddenResponseSchema

Fundamental building block of schemas.

Services_POST_ConflictResponseSchema

Fundamental building block of schemas.

Services_POST_UnprocessableEntityResponseSchema

Fundamental building block of schemas.

Services_POST_InternalServerErrorResponseSchema

Fundamental building block of schemas.

Service_PATCH_RequestBodySchema

Fundamental building block of schemas.

Service_PATCH_RequestSchema

Fundamental building block of schemas.

Service_PATCH_ResponseBodySchema

Fundamental building block of schemas.

Service_PATCH_OkResponseSchema

Fundamental building block of schemas.

Service_PATCH_BadRequestResponseSchema

Fundamental building block of schemas.

Service_PATCH_ForbiddenResponseSchema_ReservedKeyword

Fundamental building block of schemas.

Service_PATCH_ForbiddenResponseSchema

Fundamental building block of schemas.

Service_PATCH_UnprocessableEntityResponseSchema

Fundamental building block of schemas.

UserWebhook_POST_RequestBodySchema

Fundamental building block of schemas.

UserWebhook_POST_RequestSchema

Fundamental building block of schemas.

UserWebhook_POST_BadRequestResponseSchema

Fundamental building block of schemas.

UserWebhook_POST_OkResponseSchema

Fundamental building block of schemas.

PermissionWebhook_POST_RequestBodySchema

Fundamental building block of schemas.

PermissionWebhook_POST_RequestSchema

Fundamental building block of schemas.

PermissionWebhook_POST_BadRequestResponseSchema

Fundamental building block of schemas.

PermissionWebhook_POST_OkResponseSchema

Fundamental building block of schemas.

Version_GET_ResponseBodySchema

Fundamental building block of schemas.

Version_GET_OkResponseSchema

Fundamental building block of schemas.

Homepage_GET_OkResponseSchema

Fundamental building block of schemas.

SwaggerAPI_GET_OkResponseSchema

Fundamental building block of schemas.

Functions

get_security(service, method)

service_api_route_info(service_api, **kwargs)

Employed to simplify Pyramid route and view config definitions from same schema objects.

generate_api_schema(swagger_base_spec: Dict[str, Union[str, List[str]]]) → cowbird.typedefs.JSON

Return JSON Swagger specifications of Cowbird REST API.

Attributes

TitleAPI

InfoAPI

SecurityCookieAuthAPI

SecurityDefinitionsAPI

SecurityAuthenticatedAPI

SecurityAdministratorAPI

SecurityEveryoneAPI

SwaggerGenerator

SwaggerAPI

VersionAPI

HomepageAPI

ServicesAPI

ServiceAPI

UserWebhookAPI

PermissionWebhookAPI

OperationParameter

ServiceNameParameter

APITag

WebhooksTag

ServicesTag

TAG_DESCRIPTIONS

Services_GET_responses

Services_POST_responses

Service_GET_responses

Service_PATCH_responses

UserWebhook_POST_responses

PermissionWebhook_POST_responses

Version_GET_responses

Homepage_GET_responses

SwaggerAPI_GET_responses

cowbird.api.schemas.TitleAPI[source]
cowbird.api.schemas.InfoAPI[source]
cowbird.api.schemas.SecurityCookieAuthAPI[source]
cowbird.api.schemas.SecurityDefinitionsAPI[source]
cowbird.api.schemas.SecurityAuthenticatedAPI[source]
cowbird.api.schemas.SecurityAdministratorAPI[source]
cowbird.api.schemas.SecurityEveryoneAPI[source]
cowbird.api.schemas.get_security(service, method)[source]
cowbird.api.schemas.service_api_route_info(service_api, **kwargs)[source]

Employed to simplify Pyramid route and view config definitions from same schema objects.

class cowbird.api.schemas.ValidOperations[source]

Bases: cowbird.utils.ExtendedEnum

Valid values as webhook event.

CreateOperation = created[source]
DeleteOperation = deleted[source]
cowbird.api.schemas.generate_api_schema(swagger_base_spec: Dict[str, Union[str, List[str]]])cowbird.typedefs.JSON[source]

Return JSON Swagger specifications of Cowbird REST API.

Uses Cornice Services and Schemas to return swagger specification.

Parameters

swagger_base_spec – dictionary that specifies the ‘host’ and list of HTTP ‘schemes’ to employ.

cowbird.api.schemas.SwaggerGenerator[source]
cowbird.api.schemas.SwaggerAPI[source]
cowbird.api.schemas.VersionAPI[source]
cowbird.api.schemas.HomepageAPI[source]
cowbird.api.schemas.ServicesAPI[source]
cowbird.api.schemas.ServiceAPI[source]
cowbird.api.schemas.UserWebhookAPI[source]
cowbird.api.schemas.PermissionWebhookAPI[source]
cowbird.api.schemas.OperationParameter[source]
cowbird.api.schemas.ServiceNameParameter[source]
class cowbird.api.schemas.Service_RequestPathSchema(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

service_name[source]
cowbird.api.schemas.APITag = API[source]
cowbird.api.schemas.WebhooksTag = Webhooks[source]
cowbird.api.schemas.ServicesTag = Service[source]
cowbird.api.schemas.TAG_DESCRIPTIONS[source]
class cowbird.api.schemas.AcceptType(*arg, **kw)[source]

Bases: colander.SchemaNode

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

schema_type[source]
default[source]
example[source]
missing[source]
class cowbird.api.schemas.ContentType(*arg, **kw)[source]

Bases: colander.SchemaNode

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

schema_type[source]
name = Content-Type[source]
default[source]
example[source]
missing[source]
class cowbird.api.schemas.RequestHeaderSchemaAPI(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

accept[source]
content_type[source]
class cowbird.api.schemas.RequestHeaderSchemaUI(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

content_type[source]
class cowbird.api.schemas.QueryRequestSchemaAPI(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

format[source]
class cowbird.api.schemas.BaseRequestSchemaAPI(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

header[source]
querystring[source]
class cowbird.api.schemas.HeaderResponseSchema(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

content_type[source]
class cowbird.api.schemas.BaseResponseSchemaAPI(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

header[source]
class cowbird.api.schemas.BaseResponseBodySchema(code, description, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

class cowbird.api.schemas.ErrorVerifyParamConditions(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

not_none[source]
not_empty[source]
not_in[source]
not_equal[source]
is_none[source]
is_empty[source]
is_in[source]
is_equal[source]
is_true[source]
is_false[source]
is_type[source]
matches[source]
class cowbird.api.schemas.ErrorVerifyParamBodySchema(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

name[source]
value[source]
compare[source]
conditions[source]
class cowbird.api.schemas.ErrorFallbackBodySchema(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

exception[source]
error[source]
class cowbird.api.schemas.ErrorCallBodySchema(*arg, **kw)[source]

Bases: ErrorFallbackBodySchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

detail[source]
content[source]
class cowbird.api.schemas.ErrorResponseBodySchema(code, description, **kw)[source]

Bases: BaseResponseBodySchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

route_name[source]
request_url[source]
method[source]
param[source]
call[source]
fallback[source]
class cowbird.api.schemas.InternalServerErrorResponseBodySchema(**kw)[source]

Bases: ErrorResponseBodySchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

class cowbird.api.schemas.BadRequestResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Required value for request is missing.[source]
body[source]
class cowbird.api.schemas.UnauthorizedResponseBodySchema(**kw)[source]

Bases: ErrorResponseBodySchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

route_name[source]
request_url[source]
class cowbird.api.schemas.UnauthorizedResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Unauthorized access to this resource. Missing authentication headers or cookies.[source]
body[source]
class cowbird.api.schemas.HTTPForbiddenResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Forbidden operation for this resource or insufficient user privileges.[source]
body[source]
class cowbird.api.schemas.NotFoundResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = The route resource could not be found.[source]
body[source]
class cowbird.api.schemas.MethodNotAllowedResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = The method is not allowed for this resource.[source]
body[source]
class cowbird.api.schemas.NotAcceptableResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Unsupported Content-Type in 'Accept' header was specified.[source]
body[source]
class cowbird.api.schemas.UnprocessableEntityResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Invalid value specified.[source]
body[source]
class cowbird.api.schemas.InternalServerErrorResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Internal Server Error. Unhandled exception occurred.[source]
body[source]
class cowbird.api.schemas.PermissionSchema(*arg, **kw)[source]

Bases: colander.SchemaNode

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Managed permission under a service.[source]
schema_type[source]
example = test-permission[source]
class cowbird.api.schemas.PermissionListSchema(*args, **kw)[source]

Bases: colander.SequenceSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = List of managed permissions under a service.[source]
permission[source]
class cowbird.api.schemas.ResourceSchema(*arg, **kw)[source]

Bases: colander.SchemaNode

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Managed resource under a service.[source]
schema_type[source]
example = test-resource[source]
class cowbird.api.schemas.ResourceListSchema(*args, **kw)[source]

Bases: colander.SequenceSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = List of managed resources under a service.[source]
resource[source]
class cowbird.api.schemas.ServiceSummarySchema(*arg, **kw)[source]

Bases: colander.SchemaNode

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Managed service.[source]
schema_type[source]
example = test-service[source]
class cowbird.api.schemas.ServiceListSchema(*args, **kw)[source]

Bases: colander.SequenceSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = List of managed services.[source]
service[source]
class cowbird.api.schemas.ServiceConfigurationSchema(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Custom configuration of the service. Expected format and fields specific to each service type.[source]
missing[source]
default[source]
class cowbird.api.schemas.ServiceDetailSchema(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

name[source]
type[source]
url[source]
resources[source]
permissions[source]
class cowbird.api.schemas.Services_GET_RequestSchema(*arg, **kw)[source]

Bases: BaseRequestSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

class cowbird.api.schemas.Services_GET_ResponseBodySchema(code, description, **kw)[source]

Bases: BaseResponseBodySchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

services[source]
class cowbird.api.schemas.Services_GET_OkResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Get services successful.[source]
body[source]
class cowbird.api.schemas.Services_GET_BadRequestResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Invalid service name.[source]
body[source]
class cowbird.api.schemas.Services_POST_RequestBodySchema(*arg, **kw)[source]

Bases: ServiceDetailSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

class cowbird.api.schemas.Services_POST_RequestSchema(*arg, **kw)[source]

Bases: BaseRequestSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

body[source]
class cowbird.api.schemas.Services_POST_CreatedResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Service creation successful.[source]
body[source]
class cowbird.api.schemas.Services_POST_BadRequestResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Invalid value parameters for service creation.[source]
body[source]
class cowbird.api.schemas.Service_SummaryBodyResponseSchema(code, description, **kw)[source]

Bases: BaseResponseBodySchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

service[source]
class cowbird.api.schemas.Service_GET_RequestSchema(*arg, **kw)[source]

Bases: BaseRequestSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

path[source]
class cowbird.api.schemas.Service_GET_ResponseBodySchema(code, description, **kw)[source]

Bases: BaseResponseBodySchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

service[source]
class cowbird.api.schemas.Service_GET_OkResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Get service successful.[source]
body[source]
class cowbird.api.schemas.Service_GET_NotFoundResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Could not find specified service.[source]
body[source]
class cowbird.api.schemas.Services_POST_ForbiddenResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Service registration forbidden.[source]
body[source]
class cowbird.api.schemas.Services_POST_ConflictResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Specified 'service_name' value already exists.[source]
body[source]
class cowbird.api.schemas.Services_POST_UnprocessableEntityResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Service creation for registration failed.[source]
body[source]
class cowbird.api.schemas.Services_POST_InternalServerErrorResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Service registration status could not be validated.[source]
body[source]
class cowbird.api.schemas.Service_PATCH_RequestBodySchema(*arg, **kw)[source]

Bases: ServiceDetailSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

class cowbird.api.schemas.Service_PATCH_RequestSchema(*arg, **kw)[source]

Bases: BaseRequestSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

path[source]
body[source]
class cowbird.api.schemas.Service_PATCH_ResponseBodySchema(code, description, **kw)[source]

Bases: Service_GET_ResponseBodySchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

class cowbird.api.schemas.Service_PATCH_OkResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Update service successful.[source]
body[source]
class cowbird.api.schemas.Service_PATCH_BadRequestResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Registered service values are already equal to update values.[source]
body[source]
class cowbird.api.schemas.Service_PATCH_ForbiddenResponseSchema_ReservedKeyword(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Update service name to 'types' not allowed (reserved keyword).[source]
body[source]
class cowbird.api.schemas.Service_PATCH_ForbiddenResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Update service failed during value assignment.[source]
body[source]
class cowbird.api.schemas.Service_PATCH_UnprocessableEntityResponseSchema(*arg, **kw)[source]

Bases: Services_POST_UnprocessableEntityResponseSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

class cowbird.api.schemas.UserWebhook_POST_RequestBodySchema(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

event[source]
user_name[source]
callback_url[source]
class cowbird.api.schemas.UserWebhook_POST_RequestSchema(*arg, **kw)[source]

Bases: BaseRequestSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

body[source]
class cowbird.api.schemas.UserWebhook_POST_BadRequestResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Invalid value parameters for user webhook.[source]
body[source]
class cowbird.api.schemas.UserWebhook_POST_OkResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = User event successfully handled.[source]
body[source]
class cowbird.api.schemas.PermissionWebhook_POST_RequestBodySchema(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

event[source]
service_name[source]
resource_id[source]
resource_full_name[source]
name[source]
access[source]
scope[source]
user[source]
group[source]
class cowbird.api.schemas.PermissionWebhook_POST_RequestSchema(*arg, **kw)[source]

Bases: BaseRequestSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

body[source]
class cowbird.api.schemas.PermissionWebhook_POST_BadRequestResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Invalid value parameters for permission webhook.[source]
body[source]
class cowbird.api.schemas.PermissionWebhook_POST_OkResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Permission event successfully handled.[source]
body[source]
class cowbird.api.schemas.Version_GET_ResponseBodySchema(code, description, **kw)[source]

Bases: BaseResponseBodySchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

version[source]
worker_version[source]
db_version[source]
version_detail[source]
class cowbird.api.schemas.Version_GET_OkResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Get version successful.[source]
body[source]
class cowbird.api.schemas.Homepage_GET_OkResponseSchema(*arg, **kw)[source]

Bases: BaseResponseSchemaAPI

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description = Get homepage successful.[source]
body[source]
class cowbird.api.schemas.SwaggerAPI_GET_OkResponseSchema(*arg, **kw)[source]

Bases: colander.MappingSchema

Fundamental building block of schemas.

The constructor accepts these positional arguments:

  • typ: The ‘type’ for this node. It should be an instance of a class that implements the colander.interfaces.Type interface. If typ is not passed, a call to the schema_type() method on this class is made to get a default type. (When subclassing, schema_type() should be overridden to provide a reasonable default type).

  • *children: a sequence of subnodes. If the subnodes of this node are not known at construction time, they can later be added via the add method.

The constructor accepts these keyword arguments:

  • name: The name of this node.

  • typ: The ‘type’ for this node can optionally be passed in as a keyword argument. See the documentation for the positional arg above.

  • default: The default serialization value for this node when not set. If default is colander.drop, the node will be dropped from schema serialization. If not provided, the node will be serialized to colander.null.

  • missing: The default deserialization value for this node. If it is not provided, the missing value of this node will be the special marker value colander.required, indicating that it is considered ‘required’. When missing is colander.required, the required computed attribute will be True. When missing is colander.drop, the node is dropped from the schema if it isn’t set during deserialization.

  • missing_msg: Optional error message to be used if the value is required and missing.

  • preparer: Optional preparer for this node. It should be an object that implements the colander.interfaces.Preparer interface.

  • validator: Optional validator for this node. It should be an object that implements the colander.interfaces.Validator interface.

  • after_bind: A callback which is called after a clone of this node has ‘bound’ all of its values successfully. This callback is useful for performing arbitrary actions to the cloned node, or direct children of the cloned node (such as removing or adding children) at bind time. A ‘binding’ is the result of an execution of the bind method of the clone’s prototype node, or one of the parents of the clone’s prototype nodes. The deepest nodes in the node tree are bound first, so the after_bind methods of the deepest nodes are called before the shallowest. The after_bind callback should accept two values: node and kw. node will be a clone of the bound node object, kw will be the set of keywords passed to the bind method.

  • title: The title of this node. Defaults to a titleization of the name (underscores replaced with empty strings and the first letter of every resulting word capitalized). The title is used by higher-level systems (not by Colander itself).

  • description: The description for this node. Defaults to '' (the empty string). The description is used by higher-level systems (not by Colander itself).

  • widget: The ‘widget’ for this node. Defaults to None. The widget attribute is not interpreted by Colander itself, it is only meaningful to higher-level systems such as Deform.

  • insert_before: if supplied, it names a sibling defined by a superclass for its parent node; the current node will be inserted before the named node. It is not useful unless a mapping schema is inherited from another mapping schema, and you need to control the ordering of the resulting nodes.

Arbitrary keyword arguments remaining will be attached to the node object unmolested.

description[source]
header[source]
body[source]
cowbird.api.schemas.Services_GET_responses[source]
cowbird.api.schemas.Services_POST_responses[source]
cowbird.api.schemas.Service_GET_responses[source]
cowbird.api.schemas.Service_PATCH_responses[source]
cowbird.api.schemas.UserWebhook_POST_responses[source]
cowbird.api.schemas.PermissionWebhook_POST_responses[source]
cowbird.api.schemas.Version_GET_responses[source]
cowbird.api.schemas.Homepage_GET_responses[source]
cowbird.api.schemas.SwaggerAPI_GET_responses[source]
Package Contents
Functions

get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when

includeme(config)

Include API sub-modules.

cowbird.api.get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None)logging.Logger[source]

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is logging.NOTSET.

cowbird.api.includeme(config)[source]

Include API sub-modules.

Each should defined an includeme function with further sub-modules to include, and every one of their relative views and routes.

cowbird.cli
Submodules
cowbird.cli.services

Cowbird CLI helper to execute service operations.

Module Contents
Functions

make_parser(shared_parsers: cowbird.cli.utils.SharedParsers = None, prefixes: cowbird.cli.utils.CommandPrefixes = None) → argparse.ArgumentParser

main(args: cowbird.cli.utils.ParserArgs = None, parser: cowbird.cli.utils.HelperParser = None, namespace: cowbird.cli.utils.ParsedArgs = None) → cowbird.cli.utils.ParseResult

cowbird.cli.services.make_parser(shared_parsers: cowbird.cli.utils.SharedParsers = None, prefixes: cowbird.cli.utils.CommandPrefixes = None)argparse.ArgumentParser[source]
cowbird.cli.services.main(args: cowbird.cli.utils.ParserArgs = None, parser: cowbird.cli.utils.HelperParser = None, namespace: cowbird.cli.utils.ParsedArgs = None)cowbird.cli.utils.ParseResult[source]
cowbird.cli.utils
Module Contents
Functions

subparser_help(description: str, parent_parser: Optional[argparse.ArgumentParser] = None) → Dict[str, str]

Generates both fields with the same description as each parameter is used in different context.

get_config_parser() → argparse.ArgumentParser

get_logger_parser() → argparse.ArgumentParser

set_log_level(args: argparse.Namespace, logger: Optional[logging.Logger] = None) → None

get_format_parser() → argparse.ArgumentParser

print_format(data, fmt, section=None)

Attributes

CommandPrefixes

cowbird.cli.utils.CommandPrefixes[source]
cowbird.cli.utils.subparser_help(description: str, parent_parser: Optional[argparse.ArgumentParser] = None)Dict[str, str][source]

Generates both fields with the same description as each parameter is used in different context.

Field help is printed next to the subparser name when parent parser is called with --help. Field description populates the help details under the usage command when calling child parser --help.

cowbird.cli.utils.get_config_parser()argparse.ArgumentParser[source]
cowbird.cli.utils.get_logger_parser()argparse.ArgumentParser[source]
cowbird.cli.utils.set_log_level(args: argparse.Namespace, logger: Optional[logging.Logger] = None)None[source]
cowbird.cli.utils.get_format_parser()argparse.ArgumentParser[source]
cowbird.cli.utils.print_format(data, fmt, section=None)[source]
Package Contents
Functions

get_logger_parser() → argparse.ArgumentParser

subparser_help(description: str, parent_parser: Optional[argparse.ArgumentParser] = None) → Dict[str, str]

Generates both fields with the same description as each parameter is used in different context.

get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when

main(args=None)

Automatically groups all sub-helper CLI listed in cowbird.cli as a common cowbird CLI entrypoint.

Attributes

LOGGER

cowbird.cli.get_logger_parser()argparse.ArgumentParser[source]
cowbird.cli.subparser_help(description: str, parent_parser: Optional[argparse.ArgumentParser] = None)Dict[str, str][source]

Generates both fields with the same description as each parameter is used in different context.

Field help is printed next to the subparser name when parent parser is called with --help. Field description populates the help details under the usage command when calling child parser --help.

cowbird.cli.get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None)logging.Logger[source]

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is logging.NOTSET.

cowbird.cli.LOGGER[source]
cowbird.cli.main(args=None)[source]

Automatically groups all sub-helper CLI listed in cowbird.cli as a common cowbird CLI entrypoint.

Dispatches the provided arguments to the appropriate sub-helper CLI as requested. Each sub-helper CLI must implement functions make_parser and main to generate the arguments and dispatch them to the corresponding caller.

cowbird.database

Database package for pyramid.

Add the database in the pyramid registry and a property db for the requests.

Submodules
cowbird.database.base
Module Contents
Classes

DatabaseInterface

Return the unique identifier of db type matching settings.

class cowbird.database.base.DatabaseInterface(_)[source]

Return the unique identifier of db type matching settings.

Database interface defining a minimum set of function mostly around store management.

__slots__ = ['type'][source]
static _get_store_type(store_type: cowbird.typedefs.StoreSelector)str[source]
abstract get_store(self, store_type, *store_args, **store_kwargs)[source]
abstract reset_store(self: cowbird.typedefs.StoreSelector, store_type)None[source]
abstract get_session(self)[source]
abstract get_information(self: Ellipsis)cowbird.typedefs.JSON[source]
Returns

{‘version’: version, ‘type’: db_type}

abstract is_ready(self: Ellipsis)bool[source]
cowbird.database.mongodb
Module Contents
Classes

MongoDatabase

Return the unique identifier of db type matching settings.

Functions

get_mongodb_connection(container: cowbird.typedefs.AnySettingsContainer) → pymongo.database.Database

Obtains the basic database connection from settings.

get_mongodb_engine(container: cowbird.typedefs.AnySettingsContainer) → pymongo.database.Database

Obtains the database with configuration ready for usage.

Attributes

MongoDB

MongodbStores

AnyMongodbStore

cowbird.database.mongodb.MongoDB :Optional[Database][source]
cowbird.database.mongodb.MongodbStores[source]
cowbird.database.mongodb.AnyMongodbStore[source]
class cowbird.database.mongodb.MongoDatabase(container)[source]

Bases: cowbird.database.base.DatabaseInterface

Return the unique identifier of db type matching settings.

Initialize the mongo database from various type of container.

_database[source]
_settings[source]
_stores[source]
type = mongodb[source]
reset_store(self, store_type)[source]
get_store(self: Union[str, Type[cowbird.database.stores.StoreInterface], AnyMongodbStoreType], store_type: Any, *store_args: Any, **store_kwargs)AnyMongodbStore[source]

Retrieve a store from the database.

Parameters
  • store_type – type of the store to retrieve/create.

  • store_args – additional arguments to pass down to the store.

  • store_kwargs – additional keyword arguments to pass down to the store.

get_session(self: Ellipsis)Any[source]
get_information(self: Ellipsis)cowbird.typedefs.JSON[source]
Returns

{‘version’: version, ‘type’: db_type}

is_ready(self: Ellipsis)bool[source]
cowbird.database.mongodb.get_mongodb_connection(container: cowbird.typedefs.AnySettingsContainer)pymongo.database.Database[source]

Obtains the basic database connection from settings.

cowbird.database.mongodb.get_mongodb_engine(container: cowbird.typedefs.AnySettingsContainer)pymongo.database.Database[source]

Obtains the database with configuration ready for usage.

cowbird.database.stores

Stores to read/write data to from/to MongoDB using pymongo.

Module Contents
Classes

StoreInterface

Check that the store implementation defines its type and index_fields.

MongodbStore

Base class extended by all concrete store implementations.

MonitoringStore

Registry for monitoring instances.

Attributes

LOGGER

cowbird.database.stores.LOGGER[source]
class cowbird.database.stores.StoreInterface[source]

Bases: object

Check that the store implementation defines its type and index_fields.

type[source]
index_fields = [][source]
class cowbird.database.stores.MongodbStore(collection: Optional[Dict[str, Any]])[source]

Base class extended by all concrete store implementations.

Validate and hold the collection for all the implementation.

classmethod get_args_kwargs(cls: Any, *args: Any, **kwargs)Tuple[Tuple, Dict][source]

Filters MongodbStore-specific arguments to safely pass them down its __init__.

class cowbird.database.stores.MonitoringStore(*args, **kwargs)[source]

Bases: StoreInterface, MongodbStore

Registry for monitoring instances.

Uses MongoDB to store what is monitored and by whom.

Init the store used to save monitors.

type = monitors[source]
index_fields = ['callback', 'path'][source]
save_monitor(self: cowbird.monitoring.monitor.Monitor, monitor)None[source]

Stores Monitor in MongoDB storage.

delete_monitor(self: cowbird.monitoring.monitor.Monitor, monitor)None[source]

Removes Monitor from MongoDB storage.

list_monitors(self)List[cowbird.monitoring.monitor.Monitor][source]

Lists all Monitor in MongoDB storage.

clear_services(self)None[source]

Removes all Monitor from MongoDB storage.

Package Contents
Classes

MongoDatabase

Return the unique identifier of db type matching settings.

Functions

get_registry(container: cowbird.typedefs.AnyRegistryContainer, nothrow: bool = False) → Optional[pyramid.registry.Registry]

Retrieves the application registry from various containers referencing to it.

get_settings(container: Optional[cowbird.typedefs.AnySettingsContainer], app: bool = False) → cowbird.typedefs.SettingsType

Retrieve application settings from a supported container.

get_db(container: cowbird.typedefs.AnySettingsContainer, reset_connection: bool = False) → mongodb.MongoDatabase

Obtains the database connection from configured application settings.

includeme(config)

Attributes

LOGGER

class cowbird.database.MongoDatabase(container)[source]

Bases: cowbird.database.base.DatabaseInterface

Return the unique identifier of db type matching settings.

Initialize the mongo database from various type of container.

_database
_settings
_stores
type = mongodb
reset_store(self, store_type)
get_store(self: Union[str, Type[cowbird.database.stores.StoreInterface], AnyMongodbStoreType], store_type: Any, *store_args: Any, **store_kwargs)AnyMongodbStore

Retrieve a store from the database.

Parameters
  • store_type – type of the store to retrieve/create.

  • store_args – additional arguments to pass down to the store.

  • store_kwargs – additional keyword arguments to pass down to the store.

get_session(self: Ellipsis)Any
get_information(self: Ellipsis)cowbird.typedefs.JSON
Returns

{‘version’: version, ‘type’: db_type}

is_ready(self: Ellipsis)bool
cowbird.database.get_registry(container: cowbird.typedefs.AnyRegistryContainer, nothrow: bool = False)Optional[pyramid.registry.Registry][source]

Retrieves the application registry from various containers referencing to it.

cowbird.database.get_settings(container: Optional[cowbird.typedefs.AnySettingsContainer], app: bool = False)cowbird.typedefs.SettingsType[source]

Retrieve application settings from a supported container.

Parameters
  • container – supported container with an handle to application settings.

  • app – allow retrieving from current thread registry if no container was defined.

Returns

found application settings dictionary.

Raises

TypeError – when no application settings could be found or unsupported container.

cowbird.database.LOGGER[source]
cowbird.database.get_db(container: cowbird.typedefs.AnySettingsContainer, reset_connection: bool = False)mongodb.MongoDatabase[source]

Obtains the database connection from configured application settings.

If reset_connection is True, the container must be the application Registry or any container that can retrieve it to accomplish reference reset. Otherwise, any settings container can be provided.

cowbird.database.includeme(config)[source]
cowbird.monitoring
Submodules
cowbird.monitoring.fsmonitor
Module Contents
Classes

FSMonitor

Interface being called when something chang on the filesystem.

class cowbird.monitoring.fsmonitor.FSMonitor[source]

Bases: abc.ABC

Interface being called when something chang on the filesystem.

abstract static get_instance()[source]

Must return a monitor instance.

abstract on_created(self: str, filename)None[source]

Call when a new file is found.

Parameters

filename – Relative filename of a new file

abstract on_deleted(self: str, filename)None[source]

Call when a file is deleted.

Parameters

filename – Relative filename of the removed file

abstract on_modified(self: str, filename)None[source]

Call when a file is updated.

Parameters

filename – Relative filename of the updated file

cowbird.monitoring.monitor
Module Contents
Classes

Monitor

Implementation of the watchdog FileSystemEventHandler class Allows to start/stop directory monitoring and

Attributes

LOGGER

cowbird.monitoring.monitor.LOGGER[source]
exception cowbird.monitoring.monitor.MonitorException[source]

Bases: Exception

Error indicating that a Monitor cannot be started because of an invalid path or callback.

Initialize self. See help(type(self)) for accurate signature.

class cowbird.monitoring.monitor.Monitor(path: bool, recursive: Union[cowbird.monitoring.fsmonitor.FSMonitor, Type[cowbird.monitoring.fsmonitor.FSMonitor], str], callback)[source]

Bases: watchdog.events.FileSystemEventHandler

Implementation of the watchdog FileSystemEventHandler class Allows to start/stop directory monitoring and send events to FSMonitor callback.

Initialize the path monitoring and ready to be started.

@param path: Path to monitor @param recursive: Monitor subdirectory recursively? @param callback: Events are sent to this FSMonitor.

Can be an object, a class type implementing FSMonitor or a string containing module and class name. The class type or string is used to instantiate an object using the class method FSMonitor.get_instance()

static get_fsmonitor_instance(callback: Union[cowbird.monitoring.fsmonitor.FSMonitor, Type[cowbird.monitoring.fsmonitor.FSMonitor], str])cowbird.monitoring.fsmonitor.FSMonitor[source]

Return a FSMonitor instance from multiple possible forms including the FSMonitor type, the FSMonitor full qualified class name or a direct instance which is returned as is.

static get_qualified_class_name(monitor: cowbird.monitoring.fsmonitor.FSMonitor)str[source]

Returns the full qualified class name of the FSMonitor object (string of the form module.class_name)

property recursive(self)[source]
property path(self)[source]
property callback(self)[source]
property callback_instance(self)[source]
property key(self)Dict[source]

Return a dict that can be used as a unique key to identify this Monitor in a BD.

params(self)Dict[source]

Return a dict serializing this object from which a new Monitor can be recreated using the init function.

start(self)[source]

Start the monitoring so that events can be fired.

stop(self)[source]

Stop the monitoring so that events stop to be fired.

on_moved(self: Union[watchdog.events.DirMovedEvent, watchdog.events.FileMovedEvent], event)None[source]

Called when a file or a directory is moved or renamed.

@param event: Event representing file/directory movement.

on_created(self: Union[watchdog.events.DirCreatedEvent, watchdog.events.FileCreatedEvent], event)None[source]

Called when a file or directory is created.

@param event: Event representing file/directory creation.

on_deleted(self: Union[watchdog.events.DirDeletedEvent, watchdog.events.FileDeletedEvent], event)None[source]

Called when a file or directory is deleted.

@param event: Event representing file/directory deletion.

on_modified(self: Union[watchdog.events.DirModifiedEvent, watchdog.events.FileModifiedEvent], event)None[source]

Called when a file or directory is modified.

@param event: Event representing file/directory modification.

cowbird.monitoring.monitoring
Module Contents
Classes

Monitoring

Class handling file system monitoring and registering listeners.

Attributes

LOGGER

cowbird.monitoring.monitoring.LOGGER[source]
class cowbird.monitoring.monitoring.Monitoring(config=None)[source]

Class handling file system monitoring and registering listeners.

Todo

At some point we will need a consistency function that goes through all monitored folder and make sure that monitoring services are up to date.

Initialize the monitoring instance from configured application settings.

@param config: AnySettingsContainer object from which the db can be retrieved.

The default value of None is only there to disable pylint E1120. The singleton instance must be initialized with a proper config and after that the init function should not be hit.

start(self)[source]

Load existing monitors and start the monitoring.

register(self: str, path: bool, recursive: Union[cowbird.monitoring.fsmonitor.FSMonitor, Type[cowbird.monitoring.fsmonitor.FSMonitor], str], cb_monitor)cowbird.monitoring.monitor.Monitor[source]

Register a monitor for a specific path and start it. If a monitor already exists for the specific path/cb_monitor combination it is directly returned. If this monitor was not recursively monitoring its path and the recursive flag is now true, this one take precedence and the monitor is updated accordingly. If the recursive flag was true and now it is false it has no effect.

@param path: Path to monitor @param recursive: Monitor subdirectory recursively? @param cb_monitor: FSMonitor for which an instance is created and events are sent

Can be an object, a class type implementing FSMonitor or a string containing module and class name.

@return The monitor registered or already existing for the specific path/cb_monitor combination.

unregister(self: str, path: Union[cowbird.monitoring.fsmonitor.FSMonitor, Type[cowbird.monitoring.fsmonitor.FSMonitor], str], cb_monitor)bool[source]

Stop a monitor and unregister it.

@param path: Path used by the monitor @param cb_monitor: FSMonitor object to remove

Can be an object, a class type implementing FSMonitor or a string containing module and class name.

@return: True if the monitor is found and successfully stopped, False otherwise

cowbird.services
Subpackages
cowbird.services.impl
Submodules
cowbird.services.impl.catalog
Module Contents
Classes

Catalog

Keep the catalog index in sync when files are created/deleted/updated.

Attributes

LOGGER

cowbird.services.impl.catalog.LOGGER[source]
class cowbird.services.impl.catalog.Catalog(name: dict, **kwargs)[source]

Bases: cowbird.services.service.Service, cowbird.monitoring.fsmonitor.FSMonitor

Keep the catalog index in sync when files are created/deleted/updated.

Create the catalog instance.

@param name: Service name

required_params[source]
abstract get_resource_id(self, resource_full_name)[source]

Each service must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

user_created(self, user_name)[source]
user_deleted(self, user_name)[source]
abstract permission_created(self, permission)[source]
abstract permission_deleted(self, permission)[source]
static get_instance()[source]

Return the Catalog singleton instance from the class name used to retrieve the FSMonitor from the DB.

on_created(self, filename)[source]

Call when a new file is found.

Parameters

filename – Relative filename of a new file

on_deleted(self, filename)[source]

Call when a file is deleted.

Parameters

filename – Relative filename of the removed file

on_modified(self, filename)[source]

Call when a file is updated.

Parameters

filename – Relative filename of the updated file

cowbird.services.impl.filesystem
Module Contents
Classes

FileSystem

Keep the proper directory structure in sync with the platform.

Attributes

LOGGER

cowbird.services.impl.filesystem.LOGGER[source]
class cowbird.services.impl.filesystem.FileSystem(name: dict, **kwargs)[source]

Bases: cowbird.services.service.Service

Keep the proper directory structure in sync with the platform.

Create the file system instance.

@param name: Service name

required_params[source]
abstract get_resource_id(self, resource_full_name)[source]

Each service must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

_get_user_workspace_dir(self, user_name)[source]
user_created(self, user_name)[source]
user_deleted(self, user_name)[source]
abstract permission_created(self, permission)[source]
abstract permission_deleted(self, permission)[source]
cowbird.services.impl.geoserver
Module Contents
Classes

Geoserver

Keep Geoserver internal representation in sync with the platform.

Functions

create_workspace(self, name)

create_datastore(self, workspace_id, name)

Attributes

LOGGER

cowbird.services.impl.geoserver.LOGGER[source]
class cowbird.services.impl.geoserver.Geoserver(name: dict, **kwargs)[source]

Bases: cowbird.services.service.Service

Keep Geoserver internal representation in sync with the platform.

Create the geoserver instance.

@param name: Service name

required_params[source]
abstract get_resource_id(self, resource_full_name)[source]

Each service must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

user_created(self, user_name)[source]
abstract user_deleted(self, user_name)[source]
abstract permission_created(self, permission)[source]
abstract permission_deleted(self, permission)[source]
create_workspace(self, name)[source]

Create a new Geoserver workspace.

@param self: Geoserver instance @param name: Workspace name @return: Workspace id

create_datastore(self, workspace_id, name)[source]

Create a new Geoserver workspace.

@param self: Geoserver instance @param workspace_id: Workspace id where the datastore must be created @param name: Datastore name @return: Datastore id

cowbird.services.impl.geoserver.create_workspace(self, name)[source]
cowbird.services.impl.geoserver.create_datastore(self, workspace_id, name)[source]
cowbird.services.impl.magpie
Module Contents
Classes

Magpie

Complete the Magpie’s webhook call by calling Magpie temporary urls. Also keep service-shared resources in sync when

class cowbird.services.impl.magpie.Magpie(name: dict, **kwargs)[source]

Bases: cowbird.services.service.Service

Complete the Magpie’s webhook call by calling Magpie temporary urls. Also keep service-shared resources in sync when permissions are updated for one of them.

** Cowbird components diagram 1.2.0 needs to be update since Magpie can handle permissions synchronisation directly on permission update events. No need to handle them explicitly in nginx, thredds and geoserver classes.

Create the magpie instance and instantiate the permission synchronizer that will handle the permission events.

@param name: Service name

required_params[source]
abstract get_resource_id(self, resource_full_name)[source]

Each service must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

abstract user_created(self, user_name)[source]
abstract user_deleted(self, user_name)[source]
permission_created(self, permission)[source]
permission_deleted(self, permission)[source]
create_permission(self: cowbird.permissions_synchronizer.Permission, permission)None[source]

Make sure that the specified permission exists on Magpie.

Todo

First need to check if the permission already exists If the permission doesn’t exist do a POST to create it If the permission exists but is different do a PUT to update it

delete_permission(self: cowbird.permissions_synchronizer.Permission, permission)None[source]

Remove the specified permission from Magpie if it exists.

cowbird.services.impl.nginx
Module Contents
Classes

Nginx

Nothing to do right now.

class cowbird.services.impl.nginx.Nginx(name: dict, **kwargs)[source]

Bases: cowbird.services.service.Service

Nothing to do right now.

Create the nginx instance.

@param name: Service name

required_params = [][source]
abstract get_resource_id(self, resource_full_name)[source]

Each service must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

abstract user_created(self, user_name)[source]
abstract user_deleted(self, user_name)[source]
abstract permission_created(self, permission)[source]
abstract permission_deleted(self, permission)[source]
cowbird.services.impl.thredds
Module Contents
Classes

Thredds

Nothing to do right now.

class cowbird.services.impl.thredds.Thredds(name: dict, **kwargs)[source]

Bases: cowbird.services.service.Service

Nothing to do right now.

Create the thredds instance.

@param name: Service name

required_params = [][source]
abstract get_resource_id(self, resource_full_name)[source]

Each service must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

abstract user_created(self, user_name)[source]
abstract user_deleted(self, user_name)[source]
abstract permission_created(self, permission)[source]
abstract permission_deleted(self, permission)[source]
Submodules
cowbird.services.service
Module Contents
Classes

Service

Helper class that provides a standard way to create an ABC using

Attributes

SERVICE_PRIORITY_PARAM

SERVICE_URL_PARAM

SERVICE_WORKSPACE_DIR_PARAM

SERVICE_PARAMETERS

LOGGER

cowbird.services.service.SERVICE_PRIORITY_PARAM = priority[source]
cowbird.services.service.SERVICE_URL_PARAM = url[source]
cowbird.services.service.SERVICE_WORKSPACE_DIR_PARAM = workspace_dir[source]
cowbird.services.service.SERVICE_PARAMETERS[source]
cowbird.services.service.LOGGER[source]
exception cowbird.services.service.ServiceConfigurationException[source]

Bases: Exception

Exception thrown when a service cannot be instantiated because of a bad configuration.

Initialize self. See help(type(self)) for accurate signature.

class cowbird.services.service.Service(name, **kwargs)[source]

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

@param name: Service name @param kwargs: The base class handle, but doesn’t require the following variables:

param priority: Relative priority between services while handling events

(lower value has higher priority, default value is last)

param url: Location of the web service represented by the cowbird service param workspace_dir:

__slots__[source]

Service interface used to notify implemented services of users/permissions changes.

Todo

At some point we will need a consistency function that goes through all Magpie users and make sure that services are up to date.

json(self)[source]
_user_workspace_dir(self, user_name)[source]
abstract get_resource_id(self, resource_full_name)[source]

Each service must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

abstract user_created(self, user_name)[source]
abstract user_deleted(self, user_name)[source]
abstract permission_created(self, permission)[source]
abstract permission_deleted(self, permission)[source]
cowbird.services.service_factory
Module Contents
Classes

ServiceFactory

Create service instance using service name.

Attributes

LOGGER

VALID_SERVICES

cowbird.services.service_factory.LOGGER[source]
cowbird.services.service_factory.VALID_SERVICES = ['Catalog', 'Geoserver', 'Magpie', 'Nginx', 'Thredds', 'FileSystem'][source]
class cowbird.services.service_factory.ServiceFactory[source]

Create service instance using service name.

get_service(self: ServiceFactory, name: str)cowbird.services.service.Service[source]

Instantiates a Service implementation using its name if it doesn’t exist or else returns the existing one from cache.

get_active_services(self: ServiceFactory)List[cowbird.services.service.Service][source]

Return a sorted list by priority of Service implementation activated in the config.

Package Contents
Classes

ServiceFactory

Create service instance using service name.

Functions

get_services(container: cowbird.typedefs.AnySettingsContainer) → List[service.Service]

Obtains the services managed by the application.

class cowbird.services.ServiceFactory[source]

Create service instance using service name.

get_service(self: ServiceFactory, name: str)cowbird.services.service.Service

Instantiates a Service implementation using its name if it doesn’t exist or else returns the existing one from cache.

get_active_services(self: ServiceFactory)List[cowbird.services.service.Service]

Return a sorted list by priority of Service implementation activated in the config.

cowbird.services.get_services(container: cowbird.typedefs.AnySettingsContainer)List[service.Service][source]

Obtains the services managed by the application.

Submodules
cowbird.__meta__

General meta information on the package.

Module Contents
cowbird.__meta__.__version__ = 0.4.0[source]
cowbird.__meta__.__title__ = Cowbird[source]
cowbird.__meta__.__package__ = cowbird[source]
cowbird.__meta__.__author__ = Ouranos inc., CRIM[source]
cowbird.__meta__.__maintainer__ = Ouranos inc., CRIM[source]
cowbird.__meta__.__email__ =[source]
cowbird.__meta__.__url__ = https://github.com/Ouranosinc/cowbird[source]
cowbird.__meta__.__docker__ = https://hub.docker.com/r/pavics/cowbird[source]
cowbird.__meta__.__description__ = Cowbird is a middleware that manages interactions between various birds of the bird-house stack.[source]
cowbird.__meta__.__platforms__ = ['linux_x86_64'][source]
cowbird.__meta__.__natural_language__ = English[source]
cowbird.__meta__.__license__ = MIT[source]
cowbird.__meta__.__keywords__[source]
cowbird.app

Cowbird is a middleware that manages interactions between various birds of the bird-house stack.

Module Contents
Functions

get_app(global_config=None, **settings)

This function returns the Pyramid WSGI application.

main(global_config=None, **settings)

This function returns the Pyramid WSGI application.

Attributes

LOGGER

cowbird.app.LOGGER[source]
cowbird.app.get_app(global_config=None, **settings)[source]

This function returns the Pyramid WSGI application.

It can also be used for test purpose (some config needed only in pyramid and not in tests are still in the main)

cowbird.app.main(global_config=None, **settings)[source]

This function returns the Pyramid WSGI application.

cowbird.config
Module Contents
Functions

_load_config(path_or_dict: Union[str, cowbird.typedefs.ConfigDict], section: str, allow_missing: bool = False) → cowbird.typedefs.ConfigDict

Loads a file path or dictionary as YAML/JSON configuration.

get_all_configs(path_or_dict: Union[str, cowbird.typedefs.ConfigDict], section: str, allow_missing: bool = False) → List[cowbird.typedefs.ConfigDict]

Loads all configuration files specified by the path (if a directory),

_expand_all(config: cowbird.typedefs.ConfigDict) → cowbird.typedefs.ConfigDict

Applies environment variable expansion recursively to all applicable fields of a configuration definition.

Attributes

LOGGER

cowbird.config.LOGGER[source]
exception cowbird.config.ConfigError[source]

Bases: RuntimeError

Generic error during configuration loading.

Initialize self. See help(type(self)) for accurate signature.

cowbird.config._load_config(path_or_dict: Union[str, cowbird.typedefs.ConfigDict], section: str, allow_missing: bool = False)cowbird.typedefs.ConfigDict[source]

Loads a file path or dictionary as YAML/JSON configuration.

cowbird.config.get_all_configs(path_or_dict: Union[str, cowbird.typedefs.ConfigDict], section: str, allow_missing: bool = False)List[cowbird.typedefs.ConfigDict][source]

Loads all configuration files specified by the path (if a directory), a single configuration (if a file) or directly returns the specified dictionary section (if a configuration dictionary). :returns:

  • list of configurations loaded if input was a directory path

  • list of single configuration if input was a file path

  • list of single configuration if input was a JSON dict

  • empty list if none of the other cases where matched

Note

Order of file loading will be resolved by alphabetically sorted filename if specifying a directory path.

cowbird.config._expand_all(config: cowbird.typedefs.ConfigDict)cowbird.typedefs.ConfigDict[source]

Applies environment variable expansion recursively to all applicable fields of a configuration definition.

cowbird.constants

Constant settings for Cowbird application.

Constants defined with format COWBIRD_[VARIABLE_NAME] can be matched with corresponding settings formatted as cowbird.[variable_name] in the cowbird.ini configuration file.

Note

Since the cowbird.ini file has to be loaded by the application to retrieve various configuration settings, constant COWBIRD_INI_FILE_PATH (or any other path variable defined before it - see below) has to be defined by environment variable if the default location is not desired (ie: if you want to provide your own configuration).

Module Contents
Functions

_get_default_log_level()

Get logging level from INI configuration file or fallback to default INFO if it cannot be retrieved.

get_constant_setting_name(name)

Find the equivalent setting name of the provided environment variable name.

get_constant(constant_name: Ellipsis, settings_container: Optional[cowbird.typedefs.AnySettingsContainer] = None, settings_name: Optional[str] = None, default_value: Optional[cowbird.typedefs.SettingValue] = None, raise_missing: bool = True, print_missing: bool = False, raise_not_set: bool = True) → cowbird.typedefs.SettingValue

Search in order for matched value of constant_name:

validate_required(container: cowbird.typedefs.AnySettingsContainer) → None

Validates that some value is provided for every mandatory configuration setting.

Attributes

COWBIRD_MODULE_DIR

COWBIRD_ROOT

COWBIRD_CONFIG_DIR

COWBIRD_CONFIG_PATH

COWBIRD_INI_FILE_PATH

COWBIRD_URL

COWBIRD_LOG_LEVEL

COWBIRD_LOG_PRINT

COWBIRD_LOG_REQUEST

COWBIRD_LOG_EXCEPTION

COWBIRD_ADMIN_PERMISSION

COWBIRD_CONSTANTS

_REGEX_ASCII_ONLY

_SETTING_SECTION_PREFIXES

_SETTINGS_REQUIRED

cowbird.constants.COWBIRD_MODULE_DIR[source]
cowbird.constants.COWBIRD_ROOT[source]
cowbird.constants.COWBIRD_CONFIG_DIR[source]
cowbird.constants.COWBIRD_CONFIG_PATH[source]
cowbird.constants.COWBIRD_INI_FILE_PATH[source]
cowbird.constants._get_default_log_level()[source]

Get logging level from INI configuration file or fallback to default INFO if it cannot be retrieved.

cowbird.constants.COWBIRD_URL[source]
cowbird.constants.COWBIRD_LOG_LEVEL[source]
cowbird.constants.COWBIRD_LOG_PRINT[source]
cowbird.constants.COWBIRD_LOG_REQUEST[source]
cowbird.constants.COWBIRD_LOG_EXCEPTION[source]
cowbird.constants.COWBIRD_ADMIN_PERMISSION = admin[source]
cowbird.constants.COWBIRD_CONSTANTS = ['COWBIRD_CONSTANTS', 'COWBIRD_MODULE_DIR', 'COWBIRD_ROOT', 'COWBIRD_ADMIN_PERMISSION'][source]
cowbird.constants._REGEX_ASCII_ONLY[source]
cowbird.constants._SETTING_SECTION_PREFIXES = ['cowbird'][source]
cowbird.constants._SETTINGS_REQUIRED = ['COWBIRD_URL'][source]
cowbird.constants.get_constant_setting_name(name)[source]

Find the equivalent setting name of the provided environment variable name.

Lower-case name and replace all non-ascii chars by _. Then, convert known prefixes with their dotted name.

cowbird.constants.get_constant(constant_name: Ellipsis, settings_container: Optional[cowbird.typedefs.AnySettingsContainer] = None, settings_name: Optional[str] = None, default_value: Optional[cowbird.typedefs.SettingValue] = None, raise_missing: bool = True, print_missing: bool = False, raise_not_set: bool = True)cowbird.typedefs.SettingValue[source]
Search in order for matched value of constant_name:
  1. search in COWBIRD_CONSTANTS

  2. search in settings if specified

  3. search alternative setting names (see below)

  4. search in cowbird.constants definitions

  5. search in environment variables

Parameter constant_name is expected to have the format COWBIRD_[VARIABLE_NAME] although any value can be passed to retrieve generic settings from all above mentioned search locations.

If settings_name is provided as alternative name, it is used as is to search for results if constant_name was not found. Otherwise, cowbird.[variable_name] is used for additional search when the format COWBIRD_[VARIABLE_NAME] was used for constant_name (i.e.: COWBIRD_ADMIN_USER will also search for cowbird.admin_user and so on for corresponding constants).

Parameters
  • constant_name – key to search for a value

  • settings_container – WSGI application settings container (if not provided, uses found one in current thread)

  • settings_name – alternative name for settings if specified

  • default_value – default value to be returned if not found anywhere, and exception raises are disabled.

  • raise_missing – raise exception if key is not found anywhere

  • print_missing – print message if key is not found anywhere, return None

  • raise_not_set – raise an exception if the found key is None, search until last case if others are None

Returns

found value or default_value

Raises
  • ValueError – if resulting value is invalid based on options (by default raise missing/None value)

  • LookupError – if no appropriate value could be found from all search locations (according to options)

cowbird.constants.validate_required(container: cowbird.typedefs.AnySettingsContainer)None[source]

Validates that some value is provided for every mandatory configuration setting.

Raises

when any of the requirements are missing a definition.

cowbird.permissions_synchronizer
Module Contents
Classes

Permission

Define every property required to set a permission in Magpie.

SyncPoint

A sync point contain services sharing resources via multiple API.

PermissionSynchronizer

Keep service-shared resources in sync when permissions are updated for one of them.

Attributes

SyncPointServicesType

LOGGER

cowbird.permissions_synchronizer.SyncPointServicesType[source]
cowbird.permissions_synchronizer.LOGGER[source]
class cowbird.permissions_synchronizer.Permission(service_name: str, resource_id: str, resource_full_name: str, name: str, access: str, scope: str, user: str = None, group: str = None)[source]

Define every property required to set a permission in Magpie.

__eq__(self: Permission, other)bool[source]

Return self==value.

class cowbird.permissions_synchronizer.SyncPoint(services: SyncPointServicesType, mapping: SyncPointMappingType)[source]

A sync point contain services sharing resources via multiple API.

It defines how the same resource is defined in each service and what are the mapping between permission accesses.

Init the sync point, holding services with their respective resources root and how access are mapped between them.

@param services: Dict, where the service is the key and its resources root is the value @param mapping: List of dict where the service is the key and an access list is the value

resource_match(self: Permission, permission)bool[source]

Define if the permission name is covered by this sync point.

find_match(self: Permission, permission)Generator[Tuple[str, str], None, None][source]

Search and yield for every match a (service, permission name) tuple that is mapped with this permission.

sync(self: Callable[Permission], perm_operation: Permission, permission)None[source]

Create or delete the same permission on each service sharing the same resource.

@param perm_operation Magpie create_permission or delete_permission function @param permission Permission to synchronize with others services

class cowbird.permissions_synchronizer.PermissionSynchronizer(magpie_inst)[source]

Bases: object

Keep service-shared resources in sync when permissions are updated for one of them.

Todo

At some point we will need a consistency function that goes through all permissions of all services and make sure that linked services have the same permissions.

create_permission(self: Permission, permission)None[source]

Create the same permission on each service sharing the same resource.

delete_permission(self: Permission, permission)None[source]

Delete the same permission on each service sharing the same resource.

cowbird.request_task
Module Contents
Classes

RequestTask

Celery base task that should be used to handle API requests.

exception cowbird.request_task.AbortException[source]

Bases: Exception

Exception raised when the chain must be interrupted.

Initialize self. See help(type(self)) for accurate signature.

class cowbird.request_task.RequestTask[source]

Bases: celery.app.task.Task, abc.ABC

Celery base task that should be used to handle API requests.

Using this class will set the following Task configuration :
  • auto-retry for every RequestException

  • backoff and jitter strategy

There is also an abort_chain function to stop the chain of requests in case of an unrecoverable event

To use this class simply decorate your asynchronous function like this:

from celery import shared_task

@shared_task(bind=True, base=RequestTask)
def function_name(self, any, wanted, parameters):
    pass  # function operations

Parameter bind=True will provide the self argument to the function which is the celery Task (not required).

Parameter base=RequestTask will instantiate a RequestTask rather than a base celery Task as the self object.

autoretry_for :Tuple[Exception][source]

Exceptions that are accepted as valid raising cases to attempt request retry.

retry_backoff = True[source]

Enable backoff strategy during request retry upon known raised exception.

retry_backoff_max = 600[source]

Maximum backoff delay permitted using request retry. Retries are abandoned if this delay is reached.

retry_jitter = True[source]

Enable jitter strategy during request retry upon known raised exception.

retry_kwargs[source]

Additional parameters to be passed down to requests for retry control.

abort_chain(self)[source]

Calling this function from a task will prevent any downstream tasks to be run after it.

cowbird.typedefs

Additional typing definitions.

Module Contents
cowbird.typedefs.Number[source]
cowbird.utils
Module Contents
Classes

ExtendedEnum

Utility enum.Enum methods.

SingletonMeta

A metaclass that creates a Singleton base class when called.

NullType

Represents a null value to differentiate from None.

Functions

get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when

set_logger_config(logger: logging.Logger, force_stdout: bool = False, message_format: Optional[str] = None, datetime_format: Optional[str] = None) → logging.Logger

Applies the provided logging configuration settings to the logger.

print_log(msg: str, logger: Optional[logging.Logger] = None, level: int = logging.INFO, **kwargs: Any) → None

Logs the requested message to the logger and optionally enforce printing to the console according to configuration

raise_log(msg: str, exception: Type[Exception] = Exception, logger: Optional[logging.Logger] = None, level: int = logging.ERROR) → NoReturn

Logs the provided message to the logger and raises the corresponding exception afterwards.

bool2str(value: Any) → str

Converts value to explicit "true" or "false" str with permissive variants comparison

islambda(func: Any) → bool

Evaluate if argument is a callable lambda expression.

configure_celery(config, config_ini)

get_app_config(container: cowbird.typedefs.AnySettingsContainer) → pyramid.config.Configurator

Generates application configuration with all required utilities and settings configured.

get_settings_from_config_ini(config_ini_path, section=None)

Loads configuration INI settings with additional handling.

get_registry(container: cowbird.typedefs.AnyRegistryContainer, nothrow: bool = False) → Optional[pyramid.registry.Registry]

Retrieves the application registry from various containers referencing to it.

get_json(response)

Retrieves the ‘JSON’ body of a response using the property/callable according to the response’s implementation.

get_header(header_name: str, header_container: cowbird.typedefs.AnyHeadersType, default: Optional[str] = None, split: Optional[Union[str, List[str]]] = None) → Optional[str]

Retrieves header_name by fuzzy match (independently of upper/lower-case and underscore/dash) from various

convert_response(response: cowbird.typedefs.AnyResponseType) → pyramid.response.Response

Converts a requests.Response object to an equivalent pyramid.response.Response object.

get_settings(container: Optional[cowbird.typedefs.AnySettingsContainer], app: bool = False) → cowbird.typedefs.SettingsType

Retrieve application settings from a supported container.

fully_qualified_name(obj: Union[Any, Type[Any]]) → str

Obtains the '<module>.<name>' full path definition of the object to allow finding and importing it.

log_request_format(request: pyramid.request.Request) → str

log_request(event: pyramid.events.NewRequest) → None

Subscriber event that logs basic details about the incoming requests.

log_exception_tween(handler, registry)

Tween factory that logs any exception before re-raising it.

is_json_body(body: Any) → bool

is_null(item)

get_config_path()

Attributes

CONTENT_TYPE_ANY

CONTENT_TYPE_JSON

CONTENT_TYPE_FORM

CONTENT_TYPE_HTML

CONTENT_TYPE_PLAIN

CONTENT_TYPE_APP_XML

CONTENT_TYPE_TXT_XML

FORMAT_TYPE_MAPPING

SUPPORTED_ACCEPT_TYPES

SUPPORTED_FORMAT_TYPES

KNOWN_CONTENT_TYPES

CLI_MODE_CFG

USE_TEST_CELERY_APP_CFG

LOGGER

null

cowbird.utils.CONTENT_TYPE_ANY = */*[source]
cowbird.utils.CONTENT_TYPE_JSON = application/json[source]
cowbird.utils.CONTENT_TYPE_FORM = application/x-www-form-urlencoded[source]
cowbird.utils.CONTENT_TYPE_HTML = text/html[source]
cowbird.utils.CONTENT_TYPE_PLAIN = text/plain[source]
cowbird.utils.CONTENT_TYPE_APP_XML = application/xml[source]
cowbird.utils.CONTENT_TYPE_TXT_XML = text/xml[source]
cowbird.utils.FORMAT_TYPE_MAPPING[source]
cowbird.utils.SUPPORTED_ACCEPT_TYPES[source]
cowbird.utils.SUPPORTED_FORMAT_TYPES[source]
cowbird.utils.KNOWN_CONTENT_TYPES[source]
cowbird.utils.CLI_MODE_CFG = cli_mode[source]
cowbird.utils.USE_TEST_CELERY_APP_CFG = use_test_celery_app[source]
cowbird.utils.get_logger(name: str, level: Optional[int] = None, force_stdout: bool = None, message_format: Optional[str] = None, datetime_format: Optional[str] = None)logging.Logger[source]

Immediately sets the logger level to avoid duplicate log outputs from the root logger and this logger when level is logging.NOTSET.

cowbird.utils.LOGGER[source]
cowbird.utils.set_logger_config(logger: logging.Logger, force_stdout: bool = False, message_format: Optional[str] = None, datetime_format: Optional[str] = None)logging.Logger[source]

Applies the provided logging configuration settings to the logger.

cowbird.utils.print_log(msg: str, logger: Optional[logging.Logger] = None, level: int = logging.INFO, **kwargs: Any)None[source]

Logs the requested message to the logger and optionally enforce printing to the console according to configuration value defined by COWBIRD_LOG_PRINT.

cowbird.utils.raise_log(msg: str, exception: Type[Exception] = Exception, logger: Optional[logging.Logger] = None, level: int = logging.ERROR)NoReturn[source]

Logs the provided message to the logger and raises the corresponding exception afterwards.

Raises

exception – whichever exception provided is raised systematically after logging.

cowbird.utils.bool2str(value: Any)str[source]

Converts value to explicit "true" or "false" str with permissive variants comparison that can represent common falsy or truthy values.

cowbird.utils.islambda(func: Any)bool[source]

Evaluate if argument is a callable lambda expression.

cowbird.utils.configure_celery(config, config_ini)[source]
cowbird.utils.get_app_config(container: cowbird.typedefs.AnySettingsContainer)pyramid.config.Configurator[source]

Generates application configuration with all required utilities and settings configured.

cowbird.utils.get_settings_from_config_ini(config_ini_path, section=None)[source]

Loads configuration INI settings with additional handling.

cowbird.utils.get_registry(container: cowbird.typedefs.AnyRegistryContainer, nothrow: bool = False)Optional[pyramid.registry.Registry][source]

Retrieves the application registry from various containers referencing to it.

cowbird.utils.get_json(response)[source]

Retrieves the ‘JSON’ body of a response using the property/callable according to the response’s implementation.

cowbird.utils.get_header(header_name: str, header_container: cowbird.typedefs.AnyHeadersType, default: Optional[str] = None, split: Optional[Union[str, List[str]]] = None)Optional[str][source]

Retrieves header_name by fuzzy match (independently of upper/lower-case and underscore/dash) from various framework implementations of Headers.

If split is specified, the matched header_name is first split with it and the first item is returned. This allows to parse complex headers (e.g.: text/plain; charset=UTF-8 to text/plain with split=';').

Parameters
  • header_name – header to find.

  • header_container – where to look for header_name.

  • default – value to returned if header_container is invalid or header_name could not be found.

  • split – character(s) to use to split the found header_name.

cowbird.utils.convert_response(response: cowbird.typedefs.AnyResponseType)pyramid.response.Response[source]

Converts a requests.Response object to an equivalent pyramid.response.Response object.

Content of the response is expected to be JSON.

Parameters

response – response to be converted

Returns

converted response

cowbird.utils.get_settings(container: Optional[cowbird.typedefs.AnySettingsContainer], app: bool = False)cowbird.typedefs.SettingsType[source]

Retrieve application settings from a supported container.

Parameters
  • container – supported container with an handle to application settings.

  • app – allow retrieving from current thread registry if no container was defined.

Returns

found application settings dictionary.

Raises

TypeError – when no application settings could be found or unsupported container.

cowbird.utils.fully_qualified_name(obj: Union[Any, Type[Any]])str[source]

Obtains the '<module>.<name>' full path definition of the object to allow finding and importing it.

cowbird.utils.log_request_format(request: pyramid.request.Request)str[source]
cowbird.utils.log_request(event: pyramid.events.NewRequest)None[source]

Subscriber event that logs basic details about the incoming requests.

cowbird.utils.log_exception_tween(handler, registry)[source]

Tween factory that logs any exception before re-raising it.

Application errors are marked as ERROR while non critical HTTP errors are marked as WARNING.

cowbird.utils.is_json_body(body: Any)bool[source]
class cowbird.utils.ExtendedEnum[source]

Bases: enum.Enum

Utility enum.Enum methods.

Create an extended enum with these utilities as follows:

class CustomEnum(ExtendedEnum):
    ItemA = "A"
    ItemB = "B"
classmethod names(cls)List[str][source]

Returns the member names assigned to corresponding enum elements.

classmethod values(cls)List[cowbird.typedefs.AnyKey][source]

Returns the literal values assigned to corresponding enum elements.

classmethod get(cls: cowbird.typedefs.AnyKey, key_or_value: Optional[Any], default=None)Optional[_TC][source]

Finds an enum entry by defined name or its value.

Returns the entry directly if it is already a valid enum.

class cowbird.utils.SingletonMeta[source]

Bases: type

A metaclass that creates a Singleton base class when called.

Create a class such that.

class A(object, metaclass=SingletonMeta):
    pass

class B(object, metaclass=SingletonMeta):
    pass

a1 = A()
a2 = A()
b1 = B()
b2 = B()
a1 is a2    # True
b1 is b2    # True
a1 is b1    # False
_instances[source]
__call__(cls, *args, **kwargs)[source]

Call self as a function.

class cowbird.utils.NullType[source]

Bases: object

Represents a null value to differentiate from None.

__bool__[source]
__len__[source]
__repr__(self)[source]

Return repr(self).

static __nonzero__()[source]
cowbird.utils.null[source]
cowbird.utils.is_null(item)[source]
cowbird.utils.get_config_path()[source]
Package Contents
Classes

RemoveSlashNotFoundViewFactory

Utility that will try to resolve a path without appended slash if one was provided.

Functions

includeme(config)

cowbird.includeme(config)[source]
class cowbird.RemoveSlashNotFoundViewFactory(notfound_view=None)[source]

Bases: object

Utility that will try to resolve a path without appended slash if one was provided.

__call__(self, request)[source]
1

Created with sphinx-autoapi

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. All contributors are presented in AUTHORS file.

You can contribute in many ways:

Types of Contributions

Report Bugs

Report bugs as a new issue.

If you are reporting a bug, please include:

  • Your operating system name and version.

  • Any details about your local setup that might be helpful in troubleshooting.

  • Detailed steps to reproduce the bug.

Write Documentation

Cowbird could always use more documentation, whether as part of the official Cowbird docs, in docstrings, or even on the web in blog posts, articles, and such.

Submit Feedback

The best way to send feedback is to file a new issue.

If you are proposing a feature:

  • Explain in detail how it would work.

  • Keep the scope as narrow as possible, to make it easier to implement.

  • Remember that this is a volunteer-driven project, and that contributions are welcome :)

Provide utilities

If you made a convenient utility or tool that works conjointly with Cowbird in other to provide useful features or simply provide ease-of-life, don’t hesitate to open a PR referring to it in the documentation utilities. We love sharing and avoiding to rewrite stuff.

Get Started!

Ready to contribute? Here’s how to set up cowbird for local development.

  1. Clone the repository :

git clone https://github.com/Ouranosinc/cowbird
  1. Install your local copy (see installation)

  2. When you’re done making changes, check that your changes pass code formatting and tests:

make check
make test
  1. Commit your changes and push your branch to GitHub.

  2. Submit a pull request to the author (tests will run to evaluate that everything still works).

Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

  1. The pull request should include tests.

  2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in CHANGES (under relevant category of section Unreleased).

  3. The tests should work for the specified version of Python for this project.

Tips

To run a subset of tests:

make SPEC="<CUSTOM TEST SPECIFICATIONS>" test-custom

With <CUSTOM TEST SPECIFICATIONS> being any predefined markers, specific test classes or functions as supported by pytest runner.

Credits

Contributors

Changes

Unreleased (latest)

  • Nothing yet.

0.4.0 (2021-08-05)

Features / Changes
  • Basic users’ workspaces management for new or removed users.

  • Add a Mongo database backend to store/restore monitoring state across sessions.

Bug Fixes
  • Celery has now a proper result backend.

  • Celery tasks are auto-discovered package-wide, no need to import them manually.

0.3.0 (2021-07-06)

Features / Changes
  • Add the RequestTask celery task for handling external services requests.

  • Add a docker image for the celery worker

Bug Fixes

n/a

0.2.0 (2021-05-12)

Features / Changes
  • Preliminary design which includes:

    • Webhook API

    • Services interface

    • Permissions synchronizer

    • File system monitoring

Bug Fixes

n/a

0.1.0 (2021-02-18)

Features / Changes
  • First structured release which includes:

    • CI/CD utilities

    • Minimal testing of utils

    • Documentation of generic details (WebApp, CLI, OpenAPI, configs, etc.)

    • Metadata of the package

    • Minimal /services API route with dummy Service

    • Corresponding cowbird services list CLI command

Bug Fixes

n/a

Glossary

Operation

Sequence of execution steps that configures or sends requests to other components of the bird-house stack in order to produce an end result where those components, that normally don’t interact directly together, will be able to obtain a combined and enhanced feature.

Service

Managed component for which Cowbird provides some sort interactive Operation.

Indices and Tables